|
Avara3D 0.2.0
C++ API reference
|
Describes an intersection with scene geometry or a physics body. More...
#include <a3d/scene/HitTestResult.h>
Public Member Functions | |
| std::shared_ptr< Node > | node () const |
| Returns the hit node, or nullptr if it has since been destroyed. More... | |
| const MeshElement * | meshElement () const |
| Returns the hit visual mesh element, or nullptr when no visual mesh element is identified. More... | |
| std::optional< uint32_t > | faceIndex () const |
| Returns the zero-based triangle index within meshElement(). More... | |
| const math::vec3 & | localCoordinates () const |
| Returns the hit position in the node's local coordinate system. More... | |
| const math::vec3 & | worldCoordinates () const |
| Returns the hit position in world coordinates. More... | |
| const math::vec3 & | localNormal () const |
| Returns the hit surface normal in the node's local coordinate system. More... | |
| const math::vec3 & | worldNormal () const |
| Returns the hit surface normal in world coordinates. More... | |
| const math::mat4 & | modelTransform () const |
| Returns the local-to-world model transform used for this hit. More... | |
Describes an intersection with scene geometry or a physics body.
Coordinates, normals, and the model transform are snapshots from the time of the hit test. Visual geometry hits may identify a MeshElement and triangle face; physics hits do not necessarily have corresponding visual geometry.
The result retains any visual Mesh needed to keep meshElement() alive, but retains the hit Node weakly.
Definition at line 43 of file HitTestResult.h.
| std::optional< uint32_t > a3d::HitTestResult::faceIndex | ( | ) | const |
Returns the zero-based triangle index within meshElement().
| const math::vec3 & a3d::HitTestResult::localCoordinates | ( | ) | const |
Returns the hit position in the node's local coordinate system.
| const math::vec3 & a3d::HitTestResult::localNormal | ( | ) | const |
Returns the hit surface normal in the node's local coordinate system.
| const MeshElement * a3d::HitTestResult::meshElement | ( | ) | const |
Returns the hit visual mesh element, or nullptr when no visual mesh element is identified.
| const math::mat4 & a3d::HitTestResult::modelTransform | ( | ) | const |
Returns the local-to-world model transform used for this hit.
| std::shared_ptr< Node > a3d::HitTestResult::node | ( | ) | const |
Returns the hit node, or nullptr if it has since been destroyed.
| const math::vec3 & a3d::HitTestResult::worldCoordinates | ( | ) | const |
Returns the hit position in world coordinates.
| const math::vec3 & a3d::HitTestResult::worldNormal | ( | ) | const |
Returns the hit surface normal in world coordinates.