Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ShapeCastT< Vec, Mat, ShapeCastType > Struct Template Reference

Structure that holds a single shape cast (a shape moving along a linear path in 3d space with no rotation) More...

#include <ShapeCast.h>

Public Member Functions

JPH_OVERRIDE_NEW_DELETE ShapeCastT (const Shape *inShape, Vec3Arg inScale, typename Mat::ArgType inCenterOfMassStart, Vec3Arg inDirection, const AABox &inWorldSpaceBounds)
 Constructor.
 
 ShapeCastT (const Shape *inShape, Vec3Arg inScale, typename Mat::ArgType inCenterOfMassStart, Vec3Arg inDirection)
 Constructor.
 
ShapeCastType PostTransformed (typename Mat::ArgType inTransform) const
 Transform this shape cast using inTransform. Multiply transform on the left left hand side.
 
ShapeCastType PostTranslated (typename Vec::ArgType inTranslation) const
 Translate this shape cast by inTranslation.
 
Vec GetPointOnRay (float inFraction) const
 Get point with fraction inFraction on ray from mCenterOfMassStart to mCenterOfMassStart + mDirection (0 = start of ray, 1 = end of ray)
 

Static Public Member Functions

static ShapeCastType sFromWorldTransform (const Shape *inShape, Vec3Arg inScale, typename Mat::ArgType inWorldTransform, Vec3Arg inDirection)
 Construct a shape cast using a world transform for a shape instead of a center of mass transform.
 

Public Attributes

const ShapemShape
 Shape that's being cast (cannot be mesh shape). Note that this structure does not assume ownership over the shape for performance reasons.
 
const Vec3 mScale
 Scale in local space of the shape being cast (scales relative to its center of mass)
 
const Mat mCenterOfMassStart
 Start position and orientation of the center of mass of the shape (construct using sFromWorldTransform if you have a world transform for your shape)
 
const Vec3 mDirection
 Direction and length of the cast (anything beyond this length will not be reported as a hit)
 
const AABox mShapeWorldBounds
 Cached shape's world bounds, calculated in constructor.
 

Detailed Description

template<class Vec, class Mat, class ShapeCastType>
struct ShapeCastT< Vec, Mat, ShapeCastType >

Structure that holds a single shape cast (a shape moving along a linear path in 3d space with no rotation)

Constructor & Destructor Documentation

◆ ShapeCastT() [1/2]

template<class Vec , class Mat , class ShapeCastType >
JPH_OVERRIDE_NEW_DELETE ShapeCastT< Vec, Mat, ShapeCastType >::ShapeCastT ( const Shape inShape,
Vec3Arg  inScale,
typename Mat::ArgType  inCenterOfMassStart,
Vec3Arg  inDirection,
const AABox inWorldSpaceBounds 
)
inline

Constructor.

◆ ShapeCastT() [2/2]

template<class Vec , class Mat , class ShapeCastType >
ShapeCastT< Vec, Mat, ShapeCastType >::ShapeCastT ( const Shape inShape,
Vec3Arg  inScale,
typename Mat::ArgType  inCenterOfMassStart,
Vec3Arg  inDirection 
)
inline

Constructor.

Member Function Documentation

◆ GetPointOnRay()

template<class Vec , class Mat , class ShapeCastType >
Vec ShapeCastT< Vec, Mat, ShapeCastType >::GetPointOnRay ( float  inFraction) const
inline

Get point with fraction inFraction on ray from mCenterOfMassStart to mCenterOfMassStart + mDirection (0 = start of ray, 1 = end of ray)

◆ PostTransformed()

template<class Vec , class Mat , class ShapeCastType >
ShapeCastType ShapeCastT< Vec, Mat, ShapeCastType >::PostTransformed ( typename Mat::ArgType  inTransform) const
inline

Transform this shape cast using inTransform. Multiply transform on the left left hand side.

◆ PostTranslated()

template<class Vec , class Mat , class ShapeCastType >
ShapeCastType ShapeCastT< Vec, Mat, ShapeCastType >::PostTranslated ( typename Vec::ArgType  inTranslation) const
inline

Translate this shape cast by inTranslation.

◆ sFromWorldTransform()

template<class Vec , class Mat , class ShapeCastType >
static ShapeCastType ShapeCastT< Vec, Mat, ShapeCastType >::sFromWorldTransform ( const Shape inShape,
Vec3Arg  inScale,
typename Mat::ArgType  inWorldTransform,
Vec3Arg  inDirection 
)
inlinestatic

Construct a shape cast using a world transform for a shape instead of a center of mass transform.

Member Data Documentation

◆ mCenterOfMassStart

template<class Vec , class Mat , class ShapeCastType >
const Mat ShapeCastT< Vec, Mat, ShapeCastType >::mCenterOfMassStart

Start position and orientation of the center of mass of the shape (construct using sFromWorldTransform if you have a world transform for your shape)

◆ mDirection

template<class Vec , class Mat , class ShapeCastType >
const Vec3 ShapeCastT< Vec, Mat, ShapeCastType >::mDirection

Direction and length of the cast (anything beyond this length will not be reported as a hit)

◆ mScale

template<class Vec , class Mat , class ShapeCastType >
const Vec3 ShapeCastT< Vec, Mat, ShapeCastType >::mScale

Scale in local space of the shape being cast (scales relative to its center of mass)

◆ mShape

template<class Vec , class Mat , class ShapeCastType >
const Shape* ShapeCastT< Vec, Mat, ShapeCastType >::mShape

Shape that's being cast (cannot be mesh shape). Note that this structure does not assume ownership over the shape for performance reasons.

◆ mShapeWorldBounds

template<class Vec , class Mat , class ShapeCastType >
const AABox ShapeCastT< Vec, Mat, ShapeCastType >::mShapeWorldBounds

Cached shape's world bounds, calculated in constructor.


The documentation for this struct was generated from the following file: