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

Encapsulates a collision contact between a character and another rigid body / character. More...

#include <CharacterVirtual.h>

Inheritance diagram for CharacterContact:
CharacterContactKey

Public Member Functions

void SaveState (StateRecorder &inStream) const
 
void RestoreState (StateRecorder &inStream)
 
- Public Member Functions inherited from CharacterContactKey
 CharacterContactKey ()=default
 Constructor.
 
 CharacterContactKey (const CharacterContactKey &inContact)=default
 
 CharacterContactKey (const BodyID &inBodyB, const SubShapeID &inSubShapeID)
 
 CharacterContactKey (const CharacterID &inCharacterIDB, const SubShapeID &inSubShapeID)
 
CharacterContactKeyoperator= (const CharacterContactKey &inContact)=default
 
bool IsSameBody (const CharacterContactKey &inOther) const
 Checks if two contacts refer to the same body (or virtual character)
 
bool operator== (const CharacterContactKey &inRHS) const
 Equality operator.
 
bool operator!= (const CharacterContactKey &inRHS) const
 
uint64 GetHash () const
 Hash of this structure.
 
void SaveState (StateRecorder &inStream) const
 
void RestoreState (StateRecorder &inStream)
 

Public Attributes

RVec3 mPosition
 Position where the character makes contact.
 
Vec3 mLinearVelocity
 Velocity of the contact point.
 
Vec3 mContactNormal
 Contact normal, pointing towards the character.
 
Vec3 mSurfaceNormal
 Surface normal of the contact. Has been flipped if the contact is back facing (mIsBackFacingContact) and is equal to the contact normal if the contact normal is pointing up more.
 
float mDistance
 Distance to the contact <= 0 means that it is an actual contact, > 0 means predictive.
 
float mFraction
 Fraction along the path where this contact takes place.
 
EMotionType mMotionTypeB
 Motion type of B, used to determine the priority of the contact.
 
bool mIsSensorB
 If B is a sensor.
 
const CharacterVirtualmCharacterB = nullptr
 Character we're colliding with (if not nullptr). Note that this may be a dangling pointer when accessed through GetActiveContacts(), use mCharacterIDB instead.
 
uint64 mUserData
 User data of B.
 
const PhysicsMaterialmMaterial
 Material of B.
 
bool mHadCollision = false
 If the character actually collided with the contact (can be false if a predictive contact never becomes a real one)
 
bool mWasDiscarded = false
 If the contact validate callback chose to discard this contact or when the body is a sensor.
 
bool mCanPushCharacter = true
 When true, the velocity of the contact point can push the character.
 
bool mIsBackFacingContact = false
 If this contact came from a back facing triangle / collision shape.
 
- Public Attributes inherited from CharacterContactKey
BodyID mBodyB
 ID of body we're colliding with (if not invalid)
 
CharacterID mCharacterIDB
 Character we're colliding with (if not invalid)
 
SubShapeID mSubShapeIDB
 Sub shape ID of body or character we're colliding with.
 

Detailed Description

Encapsulates a collision contact between a character and another rigid body / character.

Member Function Documentation

◆ RestoreState()

void CharacterContact::RestoreState ( StateRecorder & inStream)

◆ SaveState()

void CharacterContact::SaveState ( StateRecorder & inStream) const

Member Data Documentation

◆ mCanPushCharacter

bool CharacterContact::mCanPushCharacter = true

When true, the velocity of the contact point can push the character.

◆ mCharacterB

const CharacterVirtual* CharacterContact::mCharacterB = nullptr

Character we're colliding with (if not nullptr). Note that this may be a dangling pointer when accessed through GetActiveContacts(), use mCharacterIDB instead.

◆ mContactNormal

Vec3 CharacterContact::mContactNormal

Contact normal, pointing towards the character.

◆ mDistance

float CharacterContact::mDistance

Distance to the contact <= 0 means that it is an actual contact, > 0 means predictive.

◆ mFraction

float CharacterContact::mFraction

Fraction along the path where this contact takes place.

◆ mHadCollision

bool CharacterContact::mHadCollision = false

If the character actually collided with the contact (can be false if a predictive contact never becomes a real one)

◆ mIsBackFacingContact

bool CharacterContact::mIsBackFacingContact = false

If this contact came from a back facing triangle / collision shape.

◆ mIsSensorB

bool CharacterContact::mIsSensorB

If B is a sensor.

◆ mLinearVelocity

Vec3 CharacterContact::mLinearVelocity

Velocity of the contact point.

◆ mMaterial

const PhysicsMaterial* CharacterContact::mMaterial

Material of B.

◆ mMotionTypeB

EMotionType CharacterContact::mMotionTypeB

Motion type of B, used to determine the priority of the contact.

◆ mPosition

RVec3 CharacterContact::mPosition

Position where the character makes contact.

◆ mSurfaceNormal

Vec3 CharacterContact::mSurfaceNormal

Surface normal of the contact. Has been flipped if the contact is back facing (mIsBackFacingContact) and is equal to the contact normal if the contact normal is pointing up more.

◆ mUserData

uint64 CharacterContact::mUserData

User data of B.

◆ mWasDiscarded

bool CharacterContact::mWasDiscarded = false

If the contact validate callback chose to discard this contact or when the body is a sensor.


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