#include <c4d_shader.h>
The class 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.
if (lhit==0) write if (lhit.IsPopulated())lhit=0 write lhit.Clear() Public Member Functions | |
| 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 | Clear () |
| 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 | ( | ) |
Default constructor.
|
explicit |
Creates an uninitialized ray hit structure.
| [in] | DC | Dummy argument. Pass DC. |
Copy constructor. Creates a new RayHitID structure with all of the values from the other one.
| [in] | other | The source ray hit structure. |
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). |
Checks if 2 ray hit structures are equal.
| [in] | snd | The ray hit structure to compare with. |
| Bool IsPopulated | ( | ) | const |
Checks if the ray hit identity is zero.
| void Clear | ( | ) |
Clears the ray hit identity.
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). |
| 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. |
| Int32 GetPolygon | ( | ) | const |
Gets the polygon index.
| Bool GetSecond | ( | ) | const |
Checks if the polygon is the second part of a quadrangle.
| void ClearSecond | ( | ) |
Sets the polygon to be a first part of a quadrangle (A-B-C).
| void SetSecond | ( | ) |
Set the polygon to be a second part of a quadrangle (A-C-D).
Sets the private data.
| [in] | t_rayobject | The ray object index. |
| [in] | t_polygon | The polygon index. |
Gets the private data.
| [out] | t_rayobject | Assigned the ray object index. |
| [out] | t_polygon | Assigned the polygon index. |
|
private |
|
private |