AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
RenderMaterial.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
20#include <agx/Referenced.h>
21#include <agx/Vec4.h>
24
25namespace agxCollide
26{
27
29
34 {
35 public:
36
38 {
39 DIFFUSE_TEXTURE=0,
40 NORMALMAP_TEXTURE = 1,
41 HEIGHTMAP_TEXTURE = 2,
42 ROUGHNESS_TEXTURE = 3,
43 METALLIC_TEXTURE = 4,
44 NUM_TEXTURE_MODES=5
45 };
46
49
51 void setName( const agx::String& name );
52
55
57 void setTransparency( float transparency );
58
60 bool hasTransparency() const;
61
63 float getTransparency() const;
64
66 void setRoughness( float roughness );
67
69 bool hasRoughness() const;
70
72 float getShininess() const;
73
75 float getRoughness() const;
76
78 void setMetallic( float metallic );
79
81 bool hasMetallic() const;
82
84 float getMetallic() const;
85
87 void setDiffuseColor( const agx::Vec4f& color );
88
90 bool hasDiffuseColor() const;
91
94
96 void setSpecularColor( const agx::Vec4f& color );
97
99 bool hasSpecularColor() const;
100
103
105 void setAmbientColor( const agx::Vec4f& color );
106
108 bool hasAmbientColor() const;
109
112
114 void setEmissiveColor( const agx::Vec4f& color );
115
117 bool hasEmissiveColor() const;
118
121
123 void setMaterialSpecification( const agx::String& material );
124
127
130
131
137 void setTexturePath( const agx::String& path, TextureMode mode = DIFFUSE_TEXTURE);
138
142 agx::String getTexturePath(TextureMode mode = DIFFUSE_TEXTURE) const;
143
147 bool hasTexturePath(TextureMode mode = DIFFUSE_TEXTURE) const;
148
154 void setTextureData(TextureDataRef data, TextureMode mode = DIFFUSE_TEXTURE);
155
159 TextureDataRef getTextureData(TextureMode mode = DIFFUSE_TEXTURE) const;
160
164 bool hasTextureData(TextureMode mode = DIFFUSE_TEXTURE) const;
165
166#ifndef SWIG
168#endif
169
174 bool equal(const RenderMaterial& other) const;
175
179 bool operator ==(const RenderMaterial& other) const;
180
181
187 int compare(const RenderMaterial& other) const;
188
189
194
199
200 protected:
201
204
206
218 };
219
220
222}
223
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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
bool hasTextureData(TextureMode mode=DIFFUSE_TEXTURE) 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.
TextureDataRef getTextureData(TextureMode mode=DIFFUSE_TEXTURE) const
void setMetallic(float metallic)
Set the metallic of the material.
agx::String getTexturePath(TextureMode mode=DIFFUSE_TEXTURE) const
agx::Vector< TextureDataRef > m_textureDatas
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 setEmissiveColor(const agx::Vec4f &color)
Set the emissive color.
agx::String toString() const
void setRoughness(float roughness)
Set the roughness of the material.
RenderMaterial * clone() const
Returns a cloned copy of the RenderMaterial.
void setTransparency(float transparency)
Set the transparency of the material 1 - transparent, 0 - opaque.
agx::Vec4f getDiffuseColor() const
void setTextureData(TextureDataRef data, TextureMode mode=DIFFUSE_TEXTURE)
Set the data of a texture used for the specified texturing mode (default DIFFUSE)
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:44
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
Definition: Referenced.h:120
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::HashTable< agx::UInt32, RenderMaterialRef > RenderMaterialValueHashTable
uint32_t UInt32
Definition: Integer.h:32