![]() |
Jolt Physics
A multi core friendly Game Physics Engine
|
Encapsulates a collision contact. More...
#include <CharacterVirtual.h>
Public Member Functions | |
void | SaveState (StateRecorder &inStream) const |
void | RestoreState (StateRecorder &inStream) |
![]() | |
ContactKey ()=default | |
Constructor. | |
ContactKey (const ContactKey &inContact)=default | |
ContactKey (const BodyID &inBodyB, const SubShapeID &inSubShapeID) | |
ContactKey (const CharacterID &inCharacterIDB, const SubShapeID &inSubShapeID) | |
ContactKey & | operator= (const ContactKey &inContact)=default |
bool | IsSameBody (const ContactKey &inOther) const |
Checks if two contacts refer to the same body (or virtual character) | |
bool | operator== (const ContactKey &inRHS) const |
Equality operator. | |
bool | operator!= (const ContactKey &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. | |
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 CharacterVirtual * | 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. | |
uint64 | mUserData |
User data of B. | |
const PhysicsMaterial * | mMaterial |
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. | |
![]() | |
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. | |
Encapsulates a collision contact.
void CharacterVirtual::Contact::RestoreState | ( | StateRecorder & | inStream | ) |
void CharacterVirtual::Contact::SaveState | ( | StateRecorder & | inStream | ) | const |
bool CharacterVirtual::Contact::mCanPushCharacter = true |
When true, the velocity of the contact point can push the character.
const CharacterVirtual* CharacterVirtual::Contact::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.
float CharacterVirtual::Contact::mDistance |
Distance to the contact <= 0 means that it is an actual contact, > 0 means predictive.
float CharacterVirtual::Contact::mFraction |
Fraction along the path where this contact takes place.
bool CharacterVirtual::Contact::mHadCollision = false |
If the character actually collided with the contact (can be false if a predictive contact never becomes a real one)
bool CharacterVirtual::Contact::mIsSensorB |
If B is a sensor.
Vec3 CharacterVirtual::Contact::mLinearVelocity |
Velocity of the contact point.
const PhysicsMaterial* CharacterVirtual::Contact::mMaterial |
Material of B.
EMotionType CharacterVirtual::Contact::mMotionTypeB |
Motion type of B, used to determine the priority of the contact.
RVec3 CharacterVirtual::Contact::mPosition |
Position where the character makes contact.
Vec3 CharacterVirtual::Contact::mSurfaceNormal |
Surface normal of the contact.
uint64 CharacterVirtual::Contact::mUserData |
User data of B.
bool CharacterVirtual::Contact::mWasDiscarded = false |
If the contact validate callback chose to discard this contact or when the body is a sensor.