Jolt Physics
A multi core friendly Game Physics Engine
|
The path for a path constraint. It allows attaching two bodies to each other while giving the second body the freedom to move along a path relative to the first. More...
#include <PathConstraintPath.h>
Public Types | |
using | PathResult = Result< Ref< PathConstraintPath > > |
Public Member Functions | |
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 |
RefTarget & | operator= (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 |
Static Public Member Functions | |
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 Member Functions | |
virtual void | RestoreBinaryState (StreamIn &inStream) |
This function should not be called directly, it is used by sRestoreFromBinaryState. More... | |
Additional Inherited Members | |
Protected Attributes inherited from RefTarget< PathConstraintPath > | |
atomic< uint32 > | mRefCount |
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... | |
The path for a path constraint. It allows attaching two bodies to each other while giving the second body the freedom to move along a path relative to the first.
|
overridevirtualdefault |
Virtual destructor to ensure that derived types get their destructors called.
void PathConstraintPath::DrawPath | ( | DebugRenderer * | inRenderer, |
RMat44Arg | inBaseTransform | ||
) | const |
Draw the path relative to inBaseTransform. Used for debug purposes.
|
pure virtual |
Get the globally closest point on the curve (Could be slow!)
inPosition | Position to find closest point for |
inFractionHint | Last known fraction along the path (can be used to speed up the search) |
Implemented in PathConstraintPathHermite.
|
pure virtual |
Gets the max fraction along the path. I.e. sort of the length of the path.
Implemented in PathConstraintPathHermite.
|
pure virtual |
Given the fraction along the path, get the point, tangent and normal.
inFraction | Fraction along the path [0, GetPathMaxFraction()]. |
outPathPosition | Returns the closest position to inSearchPosition on the path. |
outPathTangent | Returns the tangent to the path at outPathPosition (the vector that follows the direction of the path) |
outPathNormal | Return the normal to the path at outPathPosition (a vector that's perpendicular to outPathTangent) |
outPathBinormal | Returns the binormal to the path at outPathPosition (a vector so that normal cross tangent = binormal) |
Implemented in PathConstraintPathHermite.
|
inline |
|
protectedvirtual |
This function should not be called directly, it is used by sRestoreFromBinaryState.
Reimplemented in PathConstraintPathHermite.
|
virtual |
Saves the contents of the path in binary form to inStream.
Reimplemented in PathConstraintPathHermite.
|
inline |
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.
|
static |
Creates a Shape of the correct type and restores its contents from the binary stream inStream.