AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxSensor::RtMaterialInstance Struct Reference

Material instance in the raytrace environment, containing handle and type. More...

#include <RaytraceHandles.h>

Public Member Functions

template<RtMaterialHandle::Type Type>
RtMaterialInstance as () const
 "Cast" this material instance the given template parameter Type.
 
RtMaterialInstance as (RtMaterialHandle::Type inType) const
 "Cast" this material instance to the given type inType.
 
template<RtMaterialHandle::Type Type>
bool is () const
 Check if this material instance is of the given type.
 
bool is (RtMaterialHandle::Type inType) const
 Check if this material instance is of the given type inType.
 
bool operator!= (const RtMaterialInstance &other) const
 
bool operator== (const RtMaterialInstance &other) const
 

Static Public Member Functions

static RtMaterialInstance create (RtMaterialHandle::Type type)
 Create a new handle and instance in of a material of the given type in the raytrace environment.
 

Public Attributes

RtMaterialHandleRef handle { nullptr }
 
RtMaterialHandle::Type type { RtMaterialHandle::Type::UNKNOWN }
 

Detailed Description

Material instance in the raytrace environment, containing handle and type.

Definition at line 63 of file RaytraceHandles.h.

Member Function Documentation

◆ as() [1/2]

template<RtMaterialHandle::Type Type>
RtMaterialInstance agxSensor::RtMaterialInstance::as
inline

"Cast" this material instance the given template parameter Type.

Template Parameters
Type- material type to cast this instance to
Returns
instance of the given type inType
See also
as( RtMaterialHandle::Type )

Definition at line 132 of file RaytraceHandles.h.

References as().

Referenced by as().

◆ as() [2/2]

RtMaterialInstance agxSensor::RtMaterialInstance::as ( RtMaterialHandle::Type  inType) const
inline

"Cast" this material instance to the given type inType.

This is short for checking the type while constructing materials given a RtMaterialInstance. If inType doesn't match the type of this instance, the returned instance will be invalid (with only default values). Returned instance will always have the type inType.

Parameters
inType- type to cast this instance to
Returns
instance of the given type inType

Definition at line 123 of file RaytraceHandles.h.

References is().

◆ create()

static RtMaterialInstance agxSensor::RtMaterialInstance::create ( RtMaterialHandle::Type  type)
static

Create a new handle and instance in of a material of the given type in the raytrace environment.

Parameters
type- type of the material
Returns
instance (check isValid()) of the material

◆ is() [1/2]

template<RtMaterialHandle::Type Type>
bool agxSensor::RtMaterialInstance::is
inline

Check if this material instance is of the given type.

Template Parameters
Type- material type
Returns
true if the type matches the type of this instance, otherwise false

Definition at line 143 of file RaytraceHandles.h.

References is().

Referenced by as(), and is().

◆ is() [2/2]

bool agxSensor::RtMaterialInstance::is ( RtMaterialHandle::Type  inType) const
inline

Check if this material instance is of the given type inType.

Parameters
inType- material type
Returns
true if inType matches the type of this instance, otherwise false

Definition at line 137 of file RaytraceHandles.h.

References type.

◆ operator!=()

bool agxSensor::RtMaterialInstance::operator!= ( const RtMaterialInstance other) const
inline
Returns
true of other.handle != this->handle || other.type != this->type

Definition at line 153 of file RaytraceHandles.h.

◆ operator==()

bool agxSensor::RtMaterialInstance::operator== ( const RtMaterialInstance other) const
inline
Returns
true of other.handle == this->handle && other.type == this->type, the latter to handle nullptr

Definition at line 148 of file RaytraceHandles.h.

References handle, and type.

Member Data Documentation

◆ handle

RtMaterialHandleRef agxSensor::RtMaterialInstance::handle { nullptr }

◆ type

RtMaterialHandle::Type agxSensor::RtMaterialInstance::type { RtMaterialHandle::Type::UNKNOWN }

Definition at line 120 of file RaytraceHandles.h.

Referenced by agxSensor::RtMaterial::getType(), is(), and operator==().


The documentation for this struct was generated from the following file: