AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
RaytraceMaterial.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#pragma once
18
19namespace agxSensor
20{
25 {
26 public:
31
36
40 bool isValid() const;
41
46 bool operator== ( const RtMaterial& other ) const;
47 bool operator!= ( const RtMaterial& other ) const;
48
52 RtMaterialHandleRef getHandle() const;
53
57 RtMaterialHandle::Type getType() const;
58
62 operator RtMaterialInstance() const;
63
65
66 protected:
67 RtMaterial( RtMaterialHandle::Type type );
68
70
71 private:
72 RtMaterialInstance m_instance;
73 };
74
76 : m_instance{}
77 {
78 }
79
80 inline RtMaterial::RtMaterial( RtMaterialHandle::Type type )
81 : m_instance{ RtMaterialInstance::create( type ) }
82 {
83 }
84
86 : m_instance{ instance }
87 {
88 }
89
90 inline bool RtMaterial::isValid() const
91 {
92 return m_instance.handle != nullptr;
93 }
94
95 inline bool RtMaterial::operator== ( const RtMaterial& other ) const
96 {
97 return m_instance.handle == other.m_instance.handle;
98 }
99
100 inline bool RtMaterial::operator!= ( const RtMaterial& other ) const
101 {
102 return !( (*this) == other );
103 }
104
106 {
107 return m_instance.handle;
108 }
109
111 {
112 return m_instance.type;
113 }
114
115 inline RtMaterial::operator RtMaterialInstance() const
116 {
117 return m_instance;
118 }
119}
#define AGXSENSOR_EXPORT
Base type for all surface, and transmission, materials used in raytracing.
RtMaterial()
Construct an invalid material.
RtMaterialHandle::Type getType() const
bool operator!=(const RtMaterial &other) const
RtMaterialHandleRef getHandle() const
bool operator==(const RtMaterial &other) const
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
std::shared_ptr< RtMaterialHandle > RtMaterialHandleRef
Material handle of implicit type in the raytrace environment.
Material instance in the raytrace environment, containing handle and type.
RtMaterialHandle::Type type