AGX Dynamics  2.37.2.0
RenderMaterial.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/agxPhysics_export.h>
20 #include <agx/Referenced.h>
21 #include <agx/Vec4.h>
22 #include <agxStream/Serializable.h>
23 
24 namespace agxCollide
25 {
26 
28 
33  {
34  public:
35 
37  {
42  NUM_TEXTURE_MODES=4
43  };
44 
47 
49  void setName( const agx::String& name );
50 
52  agx::String getName() const;
53 
55  void setTransparency( float transparency );
56 
58  bool hasTransparency() const;
59 
61  float getTransparency() const;
62 
64  void setShininess( float shininess );
65 
67  bool hasShininess() const;
68 
70  float getShininess() const;
71 
73  void setDiffuseColor( const agx::Vec4f& color );
74 
76  bool hasDiffuseColor() const;
77 
79  agx::Vec4f getDiffuseColor() const;
80 
82  void setSpecularColor( const agx::Vec4f& color );
83 
85  bool hasSpecularColor() const;
86 
88  agx::Vec4f getSpecularColor() const;
89 
91  void setAmbientColor( const agx::Vec4f& color );
92 
94  bool hasAmbientColor() const;
95 
97  agx::Vec4f getAmbientColor() const;
98 
100  void setEmissiveColor( const agx::Vec4f& color );
101 
103  bool hasEmissiveColor() const;
104 
106  agx::Vec4f getEmissiveColor() const;
107 
109  void setMaterialSpecification( const agx::String& material );
110 
112  agx::String getMaterialSpecification() const;
113 
115  bool hasMaterialSpecification() const;
116 
117 
123  void setTexturePath( const agx::String& path, TextureMode mode = DIFFUSE_TEXTURE);
124 
128  agx::String getTexturePath(TextureMode mode = DIFFUSE_TEXTURE) const;
129 
133  bool hasTexturePath(TextureMode mode = DIFFUSE_TEXTURE) const;
134 
135 #ifndef SWIG
137 #endif
138 
143  bool equal(const RenderMaterial& other) const;
144 
148  bool operator ==(const RenderMaterial& other) const;
149 
150 
156  int compare(const RenderMaterial& other) const;
157 
158 
162  agx::UInt32 getHash() const;
163 
167  RenderMaterial* clone() const;
168 
169  protected:
170 
172  agx::String toString() const;
173 
174  virtual ~RenderMaterial();
175 
182  float m_shininess;
185  };
186 
187 
189 }
190 
This namespace consists of a set of classes for handling geometric intersection tests including boole...
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:194
#define AGXPHYSICS_EXPORT
AGXOSG_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
Base class providing referencing counted objects.
Definition: Referenced.h:119
agx::StringVector m_texturePaths
Class for storing rendering material.
agx::HashTable< agx::UInt32, RenderMaterialRef > RenderMaterialValueHashTable
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
AGXOSG_EXPORT void setDiffuseColor(osg::Node *node, const agx::Vec4f &color)
Set the diffuse part of a material for a node.
Inheritance with partial specialization due to bug with ref_ptr containers.
uint32_t UInt32
Definition: Integer.h:40
AGXOSG_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.
AGX_DECLARE_POINTER_TYPES(SpaceListener)