Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Enlighten::PointProjection

    └>Geo::IRtMesh
        └>Geo::IGeoReleasable

Utility class for projecting points into a triangle surface, and optionally 'pushing up'.

Functions

NameDescription
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.


Anchor
a030bef5c09cf6109b3bfbea36cfe4b0f
a030bef5c09cf6109b3bfbea36cfe4b0f

static PointProjection* Enlighten::PointProjection::Create

...

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.

Note
titleNote

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.

Parameters
[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().


Anchor
a5e151a9a555443c1cef118eb5942f574
a5e151a9a555443c1cef118eb5942f574

virtual Geo::s32 Geo::IRtMesh::GetNumRtTriangles

...

public: Geo::s32 GetNumRtTriangles() const

...

Returns how many triangles in the mesh.


Anchor
a44d281ca0daccbbafebf93eb92872cda
a44d281ca0daccbbafebf93eb92872cda

virtual Geo::s32 Geo::IRtMesh::GetNumRtVertices

...

public: Geo::s32 GetNumRtVertices() const

...

Returns how many vertices in the mesh.


Anchor
a81ec83d7353a148e768137bdf4e3476a
a81ec83d7353a148e768137bdf4e3476a

Geo::v128 Enlighten::PointProjection::ProjectPoint

...

public: Geo::v128 ProjectPoint
(
    PointProjectionScratchMem & scratchMem,
    const Geo::v128 position,
    const Geo::v128 normal,
    float maxRayIntersectionDistance,
    float triThickness
) const

...

Project a point.


Anchor
aa49eeda59e94416c9ca2924e106ffe93
aa49eeda59e94416c9ca2924e106ffe93

void Enlighten::PointProjection::ProjectPointAndCalculateNormal

...

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.


Anchor
ab30dd2a11eebe188f69e6b9438c755be
ab30dd2a11eebe188f69e6b9438c755be

virtual void Enlighten::PointProjection::Release

...

public: virtual void Release()

...

Destroy this object.


Anchor
af6bdf30b42adde386c428e9dc2821eb9
af6bdf30b42adde386c428e9dc2821eb9

virtual void Geo::IGeoReleasable::Release

...

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)'


Anchor
ab39c603c35482a228bef0ec42c9ab5ad
ab39c603c35482a228bef0ec42c9ab5ad

virtual void Geo::IRtMesh::VisitRtMesh

...

public: void VisitRtMesh
(
    EmbreeRtMeshVisitor & visitor
) const

...

Calls methods on the given RtMeshVisitor for each vertex and triangle in the mesh.