└>Geo::IRtMesh
└>Geo::IGeoReleasable
Utility class for projecting points into a triangle surface, and optionally 'pushing up'.
Name | Description |
---|---|
Create(Geo::GeoArray< PointProjectionVertex > &, Geo::GeoArray< Geo::s32 > &, Geo::GeoArray< bool > &, bool) | Create the projection object with a set of geometry to project onto. |
GetNumRtTriangles() | Returns how many triangles in the mesh. |
GetNumRtVertices() | Returns how many vertices in the mesh. |
ProjectPoint(PointProjectionScratchMem &, const Geo::v128, const Geo::v128, float, float) | Project a point. |
ProjectPointAndCalculateNormal(PointProjectionScratchMem &, const Geo::v128, const Geo::v128, Geo::v128 &, Geo::v128 &, float, float) | Project a point and retrieve the normal of this point on the projected onto surface Note that this requires that the ProjectionPoint structures have proper normals set. |
Release() | Destroy this object. |
Release() | Free this object that was created within the Enlighten libraries. |
VisitRtMesh(EmbreeRtMeshVisitor &) | Calls methods on the given RtMeshVisitor for each vertex and triangle in the mesh. |
public: PointProjection * Create
(
Geo::GeoArray< PointProjectionVertex > & verts,
Geo::GeoArray< Geo::s32 > & triIndices,
Geo::GeoArray< bool > & triIsBlocking,
bool includePushOff
)
Create the projection object with a set of geometry to project onto.
In order to save on unnecessary memory copies the contents of the input arrays are grabbed by this class, so after this call these arrays will be empty. Take a copy in advance if you need to use the data in the arrays beyond this call. Also, this class uses the Embree ray tracing engine if you specify includePushOff==true. Embree must be initialised during the lifetime of this class. For instance, using the Geo::InitRayTracing class. This is not required if includePushOff==false. |
[in] | verts | The vertices of the geometry to project onto. All must have valid positions. Normals only need to be valid if includePushOff is true. |
[in] | triIndices | The triangle indices of the geometry to project onto. Must be a multiple of 3 and all indices must be in range of verts. |
[in] | triIsBlocking | Array of bools a 1/3rd of the length of triIndices that determines whether a triangle can be pushed through or is blocking. |
[in] | includePushOff | Whether to build acceleration structures to allow a non-zero maxRayIntersectionDistance in ProjectPoint(). |
public: Geo::s32 GetNumRtTriangles() const
Returns how many triangles in the mesh.
public: Geo::s32 GetNumRtVertices() const
Returns how many vertices in the mesh.
public: Geo::v128 ProjectPoint
(
PointProjectionScratchMem & scratchMem,
const Geo::v128 position,
const Geo::v128 normal,
float maxRayIntersectionDistance,
float triThickness
) const
Project a point.
public: void ProjectPointAndCalculateNormal
(
PointProjectionScratchMem & scratchMem,
const Geo::v128 position,
const Geo::v128 normal,
Geo::v128 & outputPosition,
Geo::v128 & outputNormal,
float maxRayIntersectionDistance,
float triThickness
) const
Project a point and retrieve the normal of this point on the projected onto surface Note that this requires that the ProjectionPoint structures have proper normals set.
public: virtual void Release()
Destroy this object.
public: void Release()
Free this object that was created within the Enlighten libraries.
Expect this to behave in a similar way to calling 'delete(this)'
public: void VisitRtMesh
(
EmbreeRtMeshVisitor & visitor
) const
Calls methods on the given RtMeshVisitor for each vertex and triangle in the mesh.