AGX Dynamics  2.35.0.1
RenderMaterial.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
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 
80 
82  void setSpecularColor( const agx::Vec4f& color );
83 
85  bool hasSpecularColor() const;
86 
89 
91  void setAmbientColor( const agx::Vec4f& color );
92 
94  bool hasAmbientColor() const;
95 
98 
100  void setEmissiveColor( const agx::Vec4f& color );
101 
103  bool hasEmissiveColor() const;
104 
107 
109  void setMaterialSpecification( const agx::String& material );
110 
113 
116 
117 
124 
129 
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 
163 
168 
169  protected:
170 
173 
174  virtual ~RenderMaterial();
175 
182  float m_shininess;
185  };
186 
187 
189 }
190 
#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
#define AGXPHYSICS_EXPORT
Class for storing rendering material.
agx::String getName() const
agx::UInt32 getHash() const
void setTexturePath(const agx::String &path, TextureMode mode=DIFFUSE_TEXTURE)
Set the path to a texture for the specified texturing mode (default DIFFUSE)
void setDiffuseColor(const agx::Vec4f &color)
Set the diffuse color.
agx::String getTexturePath(TextureMode mode=DIFFUSE_TEXTURE) const
RenderMaterial()
Constructor.
agx::String getMaterialSpecification() const
void setMaterialSpecification(const agx::String &material)
Store a string with a material specification, for example Keyshot material string.
int compare(const RenderMaterial &other) const
Slow string comparison function that uses the toString() method to convert each material to a string.
agx::Vec4f getEmissiveColor() const
void setAmbientColor(const agx::Vec4f &color)
Set the ambient color.
void setSpecularColor(const agx::Vec4f &color)
Set the specular color.
void setShininess(float shininess)
Set the shininess of the material.
void setEmissiveColor(const agx::Vec4f &color)
Set the emissive color.
agx::String toString() const
void setTransparency(float transparency)
Set the transparency of the material 1 - transparent, 0 - opaque.
agx::Vec4f getDiffuseColor() const
RenderMaterial * clone() const
Returns a cloned copy of the RenderMaterial.
void setName(const agx::String &name)
Set the name of this material.
bool equal(const RenderMaterial &other) const
float getTransparency() const
bool hasTexturePath(TextureMode mode=DIFFUSE_TEXTURE) const
bool hasMaterialSpecification() const
agx::Vec4f getSpecularColor() const
agx::StringVector m_texturePaths
agx::Vec4f getAmbientColor() const
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
Definition: Referenced.h:114
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
This namespace consists of a set of classes for handling geometric intersection tests including boole...
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agx::HashTable< agx::UInt32, RenderMaterialRef > RenderMaterialValueHashTable
@ DIFFUSE_TEXTURE
Definition: utils.h:91
@ NORMALMAP_TEXTURE
Definition: utils.h:94
@ SPECULARMAP_TEXTURE
Definition: utils.h:96
@ HEIGHTMAP_TEXTURE
Definition: utils.h:95
uint32_t UInt32
Definition: Integer.h:40
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:190