AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
RenderMaterial.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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>
23
24namespace agxCollide
25{
26
28
33 {
34 public:
35
37 {
38 DIFFUSE_TEXTURE=0,
39 NORMALMAP_TEXTURE = 1,
40 HEIGHTMAP_TEXTURE = 2,
41 SPECULARMAP_TEXTURE = 3,
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
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
163
168
169 protected:
170
173
175
185 };
186
187
189}
190
#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...
#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
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 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...
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.
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