Jolt Physics
A multi core friendly Game Physics Engine
|
This class receives callbacks when a virtual character hits something. More...
#include <CharacterVirtual.h>
Public Member Functions | |
virtual | ~CharacterContactListener ()=default |
Destructor. | |
virtual void | OnAdjustBodyVelocity (const CharacterVirtual *inCharacter, const Body &inBody2, Vec3 &ioLinearVelocity, Vec3 &ioAngularVelocity) |
virtual bool | OnContactValidate (const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2) |
Checks if a character can collide with specified body. Return true if the contact is valid. | |
virtual bool | OnCharacterContactValidate (const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2) |
Same as OnContactValidate but when colliding with a CharacterVirtual. | |
virtual void | OnContactAdded (const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, CharacterContactSettings &ioSettings) |
virtual void | OnCharacterContactAdded (const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, CharacterContactSettings &ioSettings) |
Same as OnContactAdded but when colliding with a CharacterVirtual. | |
virtual void | OnContactSolve (const CharacterVirtual *inCharacter, const BodyID &inBodyID2, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, Vec3Arg inContactVelocity, const PhysicsMaterial *inContactMaterial, Vec3Arg inCharacterVelocity, Vec3 &ioNewCharacterVelocity) |
virtual void | OnCharacterContactSolve (const CharacterVirtual *inCharacter, const CharacterVirtual *inOtherCharacter, const SubShapeID &inSubShapeID2, RVec3Arg inContactPosition, Vec3Arg inContactNormal, Vec3Arg inContactVelocity, const PhysicsMaterial *inContactMaterial, Vec3Arg inCharacterVelocity, Vec3 &ioNewCharacterVelocity) |
Same as OnContactSolve but when colliding with a CharacterVirtual. | |
This class receives callbacks when a virtual character hits something.
|
virtualdefault |
Destructor.
|
inlinevirtual |
Callback to adjust the velocity of a body as seen by the character. Can be adjusted to e.g. implement a conveyor belt or an inertial dampener system of a sci-fi space ship. Note that inBody2 is locked during the callback so you can read its properties freely.
|
inlinevirtual |
Same as OnContactAdded but when colliding with a CharacterVirtual.
|
inlinevirtual |
Same as OnContactSolve but when colliding with a CharacterVirtual.
|
inlinevirtual |
Same as OnContactValidate but when colliding with a CharacterVirtual.
|
inlinevirtual |
Called whenever the character collides with a body.
inCharacter | Character that is being solved |
inBodyID2 | Body ID of body that is being hit |
inSubShapeID2 | Sub shape ID of shape that is being hit |
inContactPosition | World space contact position |
inContactNormal | World space contact normal |
ioSettings | Settings returned by the contact callback to indicate how the character should behave |
|
inlinevirtual |
Called whenever a contact is being used by the solver. Allows the listener to override the resulting character velocity (e.g. by preventing sliding along certain surfaces).
inCharacter | Character that is being solved |
inBodyID2 | Body ID of body that is being hit |
inSubShapeID2 | Sub shape ID of shape that is being hit |
inContactPosition | World space contact position |
inContactNormal | World space contact normal |
inContactVelocity | World space velocity of contact point (e.g. for a moving platform) |
inContactMaterial | Material of contact point |
inCharacterVelocity | World space velocity of the character prior to hitting this contact |
ioNewCharacterVelocity | Contains the calculated world space velocity of the character after hitting this contact, this velocity slides along the surface of the contact. Can be modified by the listener to provide an alternative velocity. |
|
inlinevirtual |
Checks if a character can collide with specified body. Return true if the contact is valid.