Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CastSphereVsTriangles Class Reference

Collision detection helper that casts a sphere vs one or more triangles. More...

#include <CastSphereVsTriangles.h>

Public Member Functions

 CastSphereVsTriangles (const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, Vec3Arg inScale, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, CastShapeCollector &ioCollector)
 
void Cast (Vec3Arg inV0, Vec3Arg inV1, Vec3Arg inV2, uint8 inActiveEdges, const SubShapeID &inSubShapeID2)
 

Protected Attributes

Vec3 mStart
 Starting location of the sphere. More...
 
Vec3 mDirection
 Direction and length of movement of sphere. More...
 
float mRadius
 Scaled radius of sphere. More...
 
const ShapeCastSettingsmShapeCastSettings
 
const Mat44mCenterOfMassTransform2
 
Vec3 mScale
 
SubShapeIDCreator mSubShapeIDCreator1
 
CastShapeCollectormCollector
 

Detailed Description

Collision detection helper that casts a sphere vs one or more triangles.

Constructor & Destructor Documentation

◆ CastSphereVsTriangles()

JPH_NAMESPACE_BEGIN CastSphereVsTriangles::CastSphereVsTriangles ( const ShapeCast inShapeCast,
const ShapeCastSettings inShapeCastSettings,
Vec3Arg  inScale,
Mat44Arg  inCenterOfMassTransform2,
const SubShapeIDCreator inSubShapeIDCreator1,
CastShapeCollector ioCollector 
)

Constructor

Parameters
inShapeCastThe sphere to cast against the triangles and its start and direction
inShapeCastSettingsSettings for performing the cast
inScaleLocal space scale for the shape to cast against.
inCenterOfMassTransform2Is the center of mass transform of shape 2 (excluding scale), this is used to provide a transform to the shape cast result so that local quantities can be transformed into world space.
inSubShapeIDCreator1Class that tracks the current sub shape ID for the casting shape
ioCollectorThe collector that receives the results.

Member Function Documentation

◆ Cast()

void CastSphereVsTriangles::Cast ( Vec3Arg  inV0,
Vec3Arg  inV1,
Vec3Arg  inV2,
uint8  inActiveEdges,
const SubShapeID inSubShapeID2 
)

Cast sphere with a single triangle

Parameters
inV0,inV1,inV2CCW triangle vertices
inActiveEdgesbit 0 = edge v0..v1 is active, bit 1 = edge v1..v2 is active, bit 2 = edge v2..v0 is active An active edge is an edge that is not connected to another triangle in such a way that it is impossible to collide with the edge
inSubShapeID2The sub shape ID for the triangle

Member Data Documentation

◆ mCenterOfMassTransform2

const Mat44& CastSphereVsTriangles::mCenterOfMassTransform2
protected

◆ mCollector

CastShapeCollector& CastSphereVsTriangles::mCollector
protected

◆ mDirection

Vec3 CastSphereVsTriangles::mDirection
protected

Direction and length of movement of sphere.

◆ mRadius

float CastSphereVsTriangles::mRadius
protected

Scaled radius of sphere.

◆ mScale

Vec3 CastSphereVsTriangles::mScale
protected

◆ mShapeCastSettings

const ShapeCastSettings& CastSphereVsTriangles::mShapeCastSettings
protected

◆ mStart

Vec3 CastSphereVsTriangles::mStart
protected

Starting location of the sphere.

◆ mSubShapeIDCreator1

SubShapeIDCreator CastSphereVsTriangles::mSubShapeIDCreator1
protected

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