Result of a shape cast test.
More...
#include <ShapeCast.h>
|
JPH_OVERRIDE_NEW_DELETE | ShapeCastResult ()=default |
| Default constructor.
|
|
| ShapeCastResult (float inFraction, Vec3Arg inContactPoint1, Vec3Arg inContactPoint2, Vec3Arg inContactNormalOrPenetrationDepth, bool inBackFaceHit, const SubShapeID &inSubShapeID1, const SubShapeID &inSubShapeID2, const BodyID &inBodyID2) |
|
float | GetEarlyOutFraction () const |
| Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'. For rays/cast shapes we can just use the collision fraction. The fraction and penetration depth are combined in such a way that deeper hits at fraction 0 go first.
|
|
ShapeCastResult | Reversed (Vec3Arg inWorldSpaceCastDirection) const |
|
JPH_OVERRIDE_NEW_DELETE | CollideShapeResult ()=default |
| Default constructor.
|
|
| CollideShapeResult (Vec3Arg inContactPointOn1, Vec3Arg inContactPointOn2, Vec3Arg inPenetrationAxis, float inPenetrationDepth, const SubShapeID &inSubShapeID1, const SubShapeID &inSubShapeID2, const BodyID &inBodyID2) |
| Constructor.
|
|
float | GetEarlyOutFraction () const |
| Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'. We use -penetration depth to get the hit with the biggest penetration depth.
|
|
CollideShapeResult | Reversed () const |
| Reverses the hit result, swapping contact point 1 with contact point 2 etc.
|
|
|
float | mFraction |
| This is the fraction where the shape hit the other shape: CenterOfMassOnHit = Start + value * (End - Start)
|
|
bool | mIsBackFaceHit |
| True if the shape was hit from the back side.
|
|
Vec3 | mContactPointOn1 |
| Contact point on the surface of shape 1 (in world space or relative to base offset)
|
|
Vec3 | mContactPointOn2 |
| Contact point on the surface of shape 2 (in world space or relative to base offset). If the penetration depth is 0, this will be the same as mContactPointOn1.
|
|
Vec3 | mPenetrationAxis |
| Direction to move shape 2 out of collision along the shortest path (magnitude is meaningless, in world space). You can use -mPenetrationAxis.Normalized() as contact normal.
|
|
float | mPenetrationDepth |
| Penetration depth (move shape 2 by this distance to resolve the collision). If CollideShapeSettings::mMaxSeparationDistance > 0 this number can be negative to indicate that the objects are separated by -mPenetrationDepth. The contact points are the closest points in that case.
|
|
SubShapeID | mSubShapeID1 |
| Sub shape ID that identifies the face on shape 1.
|
|
SubShapeID | mSubShapeID2 |
| Sub shape ID that identifies the face on shape 2.
|
|
BodyID | mBodyID2 |
| BodyID to which shape 2 belongs to.
|
|
Face | mShape1Face |
| Colliding face on shape 1 (optional result, in world space or relative to base offset)
|
|
Face | mShape2Face |
| Colliding face on shape 2 (optional result, in world space or relative to base offset)
|
|
Result of a shape cast test.
◆ ShapeCastResult() [1/2]
◆ ShapeCastResult() [2/2]
ShapeCastResult::ShapeCastResult |
( |
float |
inFraction, |
|
|
Vec3Arg |
inContactPoint1, |
|
|
Vec3Arg |
inContactPoint2, |
|
|
Vec3Arg |
inContactNormalOrPenetrationDepth, |
|
|
bool |
inBackFaceHit, |
|
|
const SubShapeID & |
inSubShapeID1, |
|
|
const SubShapeID & |
inSubShapeID2, |
|
|
const BodyID & |
inBodyID2 |
|
) |
| |
|
inline |
Constructor
- Parameters
-
inFraction | Fraction at which the cast hit |
inContactPoint1 | Contact point on shape 1 |
inContactPoint2 | Contact point on shape 2 |
inContactNormalOrPenetrationDepth | Contact normal pointing from shape 1 to 2 or penetration depth vector when the objects are penetrating (also from 1 to 2) |
inBackFaceHit | If this hit was a back face hit |
inSubShapeID1 | Sub shape id for shape 1 |
inSubShapeID2 | Sub shape id for shape 2 |
inBodyID2 | BodyID that was hit |
◆ GetEarlyOutFraction()
float ShapeCastResult::GetEarlyOutFraction |
( |
| ) |
const |
|
inline |
Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'. For rays/cast shapes we can just use the collision fraction. The fraction and penetration depth are combined in such a way that deeper hits at fraction 0 go first.
◆ Reversed()
Reverses the hit result, swapping contact point 1 with contact point 2 etc.
- Parameters
-
inWorldSpaceCastDirection | Direction of the shape cast in world space |
◆ mFraction
float ShapeCastResult::mFraction |
This is the fraction where the shape hit the other shape: CenterOfMassOnHit = Start + value * (End - Start)
◆ mIsBackFaceHit
bool ShapeCastResult::mIsBackFaceHit |
True if the shape was hit from the back side.
The documentation for this class was generated from the following file: