Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PathConstraintPathHermite Class Referencefinal

A path that follows a Hermite spline. More...

#include <PathConstraintPathHermite.h>

Inheritance diagram for PathConstraintPathHermite:
PathConstraintPath SerializableObject RefTarget< PathConstraintPath > NonCopyable

Classes

struct  Point
 

Public Member Functions

virtual float GetPathMaxFraction () const override
 Gets the max fraction along the path. I.e. sort of the length of the path. More...
 
virtual float GetClosestPoint (Vec3Arg inPosition, float inFractionHint) const override
 
virtual void GetPointOnPath (float inFraction, Vec3 &outPathPosition, Vec3 &outPathTangent, Vec3 &outPathNormal, Vec3 &outPathBinormal) const override
 
void AddPoint (Vec3Arg inPosition, Vec3Arg inTangent, Vec3Arg inNormal)
 Adds a point to the path. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const override
 Saves the contents of the path in binary form to inStream. More...
 
- Public Member Functions inherited from PathConstraintPath
virtual ~PathConstraintPath () override=default
 Virtual destructor to ensure that derived types get their destructors called. More...
 
virtual float GetPathMaxFraction () const =0
 Gets the max fraction along the path. I.e. sort of the length of the path. More...
 
virtual float GetClosestPoint (Vec3Arg inPosition, float inFractionHint) const =0
 
virtual void GetPointOnPath (float inFraction, Vec3 &outPathPosition, Vec3 &outPathTangent, Vec3 &outPathNormal, Vec3 &outPathBinormal) const =0
 
void SetIsLooping (bool inIsLooping)
 If the path is looping or not. If a path is looping, the first and last point are automatically connected to each other. They should not be the same points. More...
 
bool IsLooping () const
 
void DrawPath (DebugRenderer *inRenderer, RMat44Arg inBaseTransform) const
 Draw the path relative to inBaseTransform. Used for debug purposes. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const
 Saves the contents of the path in binary form to inStream. More...
 
- Public Member Functions inherited from SerializableObject
virtual ~SerializableObject ()=default
 Constructor. More...
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 
- Public Member Functions inherited from RefTarget< PathConstraintPath >
 RefTarget ()=default
 Constructor. More...
 
 RefTarget (const RefTarget &)
 
 ~RefTarget ()
 assert no one is referencing us More...
 
void SetEmbedded () const
 
RefTargetoperator= (const RefTarget &)
 Assignment operator. More...
 
uint32 GetRefCount () const
 Get current refcount of this object. More...
 
void AddRef () const
 Add or release a reference to this object. More...
 
void Release () const
 

Protected Member Functions

virtual void RestoreBinaryState (StreamIn &inStream) override
 This function should not be called directly, it is used by sRestoreFromBinaryState. More...
 
virtual void RestoreBinaryState (StreamIn &inStream)
 This function should not be called directly, it is used by sRestoreFromBinaryState. More...
 

Additional Inherited Members

- Public Types inherited from PathConstraintPath
using PathResult = Result< Ref< PathConstraintPath > >
 
- Static Public Member Functions inherited from PathConstraintPath
static PathResult sRestoreFromBinaryState (StreamIn &inStream)
 Creates a Shape of the correct type and restores its contents from the binary stream inStream. More...
 
- Static Public Member Functions inherited from RefTarget< PathConstraintPath >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION. More...
 
- Protected Attributes inherited from RefTarget< PathConstraintPath >
atomic< uint32mRefCount
 Current reference count. More...
 
- Static Protected Attributes inherited from RefTarget< PathConstraintPath >
static constexpr uint32 cEmbedded
 A large value that gets added to the refcount to mark the object as embedded. More...
 

Detailed Description

A path that follows a Hermite spline.

Member Function Documentation

◆ AddPoint()

void PathConstraintPathHermite::AddPoint ( Vec3Arg  inPosition,
Vec3Arg  inTangent,
Vec3Arg  inNormal 
)
inline

Adds a point to the path.

◆ GetClosestPoint()

float PathConstraintPathHermite::GetClosestPoint ( Vec3Arg  inPosition,
float  inFractionHint 
) const
overridevirtual

Get the globally closest point on the curve (Could be slow!)

Parameters
inPositionPosition to find closest point for
inFractionHintLast known fraction along the path (can be used to speed up the search)
Returns
Fraction of closest point along the path

Implements PathConstraintPath.

◆ GetPathMaxFraction()

virtual float PathConstraintPathHermite::GetPathMaxFraction ( ) const
inlineoverridevirtual

Gets the max fraction along the path. I.e. sort of the length of the path.

Implements PathConstraintPath.

◆ GetPointOnPath()

void PathConstraintPathHermite::GetPointOnPath ( float  inFraction,
Vec3 outPathPosition,
Vec3 outPathTangent,
Vec3 outPathNormal,
Vec3 outPathBinormal 
) const
overridevirtual

Given the fraction along the path, get the point, tangent and normal.

Parameters
inFractionFraction along the path [0, GetPathMaxFraction()].
outPathPositionReturns the closest position to inSearchPosition on the path.
outPathTangentReturns the tangent to the path at outPathPosition (the vector that follows the direction of the path)
outPathNormalReturn the normal to the path at outPathPosition (a vector that's perpendicular to outPathTangent)
outPathBinormalReturns the binormal to the path at outPathPosition (a vector so that normal cross tangent = binormal)

Implements PathConstraintPath.

◆ RestoreBinaryState()

void PathConstraintPathHermite::RestoreBinaryState ( StreamIn inStream)
overrideprotectedvirtual

This function should not be called directly, it is used by sRestoreFromBinaryState.

Reimplemented from PathConstraintPath.

◆ SaveBinaryState()

void PathConstraintPathHermite::SaveBinaryState ( StreamOut inStream) const
overridevirtual

Saves the contents of the path in binary form to inStream.

Reimplemented from PathConstraintPath.


The documentation for this class was generated from the following files: