RayHitID Struct Reference

#include <c4d_shader.h>

详细描述

RayHitID replaces the old Int32 value that stored information of an object/polygon.
It conveniently allows to set objects with a polygon index, or read this information.
SetSecond() / GetSecond() determine for a non-coplanar quadrangle which part of the quadrangle was stored (A-B-C or A-C-D). In case of a coplanar quadrangle "second" is not set.

注意
- Instead of if (lhit==0) write if (lhit.IsPopulated())
  • Instead of lhit=0 write lhit.Clear()

公共成员函数

  RayHitID ()
  RayHitID ( _DONTCONSTRUCT DC )
  RayHitID (const RayHitID &other)
  RayHitID (const RayObject *t_rayobject, Int32 t_polygon, Bool second)
Bool   IsEqual (const RayHitID &snd) const
Bool   IsPopulated () const
void  清零 ()
void  Set (const RayObject *t_rayobject, Int32 t_polygon, Bool second)
const RayObject GetObject (const VolumeData *vd) const
Int32   GetPolygon () const
Bool   GetSecond () const
void  ClearSecond ()
void  SetSecond ()
void  SetPrivateData ( Int32 t_rayobject, Int32 t_polygon)
void  GetPrivateData ( Int32 *t_rayobject, Int32 *t_polygon) const

Private Attributes

Int32   rayobject
Int32   polygon

构造函数 & 析构函数文档编制

◆  RayHitID() [1/4]

RayHitID ( )

Default constructor.

◆  RayHitID() [2/4]

RayHitID ( _DONTCONSTRUCT   DC )
explicit

Creates an uninitialized ray hit structure.

参数
[in] DC Dummy argument. Pass DC .

◆  RayHitID() [3/4]

RayHitID ( const RayHitID other )

Copy constructor. Creates a new RayHitID structure with all of the values from the other one.

参数
[in] other The source ray hit structure.

◆  RayHitID() [4/4]

RayHitID ( const RayObject t_rayobject ,
Int32   t_polygon ,
Bool   second  
)

Creates a ray hit structure based on the passed parameters.

参数
[in] t_rayobject The ray object.
[in] t_polygon The polygon index.
[in] second true for second part (A-C-D) of a quadrangle, false for the first part (A-B-C).

成员函数文档编制

◆  IsEqual()

Bool IsEqual ( const RayHitID snd ) const

Checks if 2 ray hit structures are equal.

参数
[in] snd The ray hit structure to compare with.
返回
true if the ray hit structures are equal, otherwise false .

◆  IsPopulated()

Bool IsPopulated ( ) const

Checks if the ray hit identity is zero.

返回
true if he ray hit identity is zero, otherwise false .

◆  Clear()

void Clear ( )

Clears the ray hit identity.

◆  Set()

void Set ( const RayObject t_rayobject ,
Int32   t_polygon ,
Bool   second  
)

Setups the ray hit structure.

参数
[in] t_rayobject The ray object.
[in] t_polygon The polygon index.
[in] second true for second part (A-C-D) of a quadrangle, false for the first part (A-B-C).

◆  GetObject()

const RayObject * GetObject ( const VolumeData vd ) const

Retrieves the ray object of the ray hit identity for a volume data.

参数
[in] vd The volume data.
返回
The ray object, or nullptr if not available.

◆  GetPolygon()

Int32 GetPolygon ( ) const

Gets the polygon index.

返回
The polygon index.

◆  GetSecond()

Bool GetSecond ( ) const

Checks if the polygon is the second part of a quadrangle.

返回
true if the polygon is a second part of a quadrangle (A-C-D), false for the first part (A-B-C).

◆  ClearSecond()

void ClearSecond ( )

Sets the polygon to be a first part of a quadrangle (A-B-C).

◆  SetSecond()

void SetSecond ( )

Set the polygon to be a second part of a quadrangle (A-C-D).

◆  SetPrivateData()

void SetPrivateData ( Int32   t_rayobject ,
Int32   t_polygon  
)

Sets the private data.

参数
[in] t_rayobject The ray object index.
[in] t_polygon The polygon index.

◆  GetPrivateData()

void GetPrivateData ( Int32 t_rayobject ,
Int32 t_polygon  
) const

Gets the private data.

参数
[out] t_rayobject Assigned the ray object index.
[out] t_polygon Assigned the polygon index.

Member Data Documentation

◆  rayobject

Int32 rayobject
private

◆  polygon

Int32 polygon
private