AGX Dynamics  2.38.0.2
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 
agxPhysics_export.h
agxOSG::setAmbientColor
AGXOSG_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.
Referenced.h
agxCollide::RenderMaterial::m_specularColor
agx::Vec4f m_specularColor
Definition: RenderMaterial.h:178
agxOSG::DIFFUSE_TEXTURE
@ DIFFUSE_TEXTURE
Definition: utils.h:96
agx::Vector< AgXString< std::string > >
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
agxCollide::RenderMaterial::TextureMode
TextureMode
Definition: RenderMaterial.h:36
agxOSG::setDiffuseColor
AGXOSG_EXPORT void setDiffuseColor(osg::Node *node, const agx::Vec4f &color, bool override=false)
Set the diffuse part of a material for a node.
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
agxOSG::SPECULARMAP_TEXTURE
@ SPECULARMAP_TEXTURE
Definition: utils.h:101
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agxOSG::TextureMode
TextureMode
Definition: utils.h:94
agxCollide::RenderMaterial::m_emissiveColor
agx::Vec4f m_emissiveColor
Definition: RenderMaterial.h:180
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
Vec4.h
agxCollide::RenderMaterialValueHashTable
agx::HashTable< agx::UInt32, RenderMaterialRef > RenderMaterialValueHashTable
Definition: RenderMaterial.h:188
agxCollide::RenderMaterial::m_shininess
float m_shininess
Definition: RenderMaterial.h:182
agxOSG::setSpecularColor
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
agxCollide::RenderMaterial::m_texturePaths
agx::StringVector m_texturePaths
Definition: RenderMaterial.h:184
agxCollide::RenderMaterial::m_ambientColor
agx::Vec4f m_ambientColor
Definition: RenderMaterial.h:179
agxOSG::NORMALMAP_TEXTURE
@ NORMALMAP_TEXTURE
Definition: utils.h:99
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:926
Serializable.h
agxCollide::RenderMaterial::m_transparency
float m_transparency
Definition: RenderMaterial.h:181
agxCollide::RenderMaterial
Class for storing rendering material.
Definition: RenderMaterial.h:32
agxOSG::HEIGHTMAP_TEXTURE
@ HEIGHTMAP_TEXTURE
Definition: utils.h:100
agxCollide::RenderMaterial::m_materialSpecification
agx::String m_materialSpecification
Definition: RenderMaterial.h:176
agxOSG::setShininess
AGXOSG_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::operator==
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:201
agxCollide::RenderMaterial::m_diffuseColor
agx::Vec4f m_diffuseColor
Definition: RenderMaterial.h:177
agxCollide::AGX_DECLARE_POINTER_TYPES
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agx::AgXString< std::string >
agxCollide::RenderMaterial::m_name
agx::String m_name
Definition: RenderMaterial.h:183
agx::UInt32
uint32_t UInt32
Definition: Integer.h:32