|
JPH_OVERRIDE_NEW_DELETE | CharacterVirtual (const CharacterVirtualSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, uint64 inUserData, PhysicsSystem *inSystem) |
|
| CharacterVirtual (const CharacterVirtualSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, PhysicsSystem *inSystem) |
| Constructor without user data.
|
|
void | SetListener (CharacterContactListener *inListener) |
| Set the contact listener.
|
|
CharacterContactListener * | GetListener () const |
| Get the current contact listener.
|
|
Vec3 | GetLinearVelocity () const |
| Get the linear velocity of the character (m / s)
|
|
void | SetLinearVelocity (Vec3Arg inLinearVelocity) |
| Set the linear velocity of the character (m / s)
|
|
RVec3 | GetPosition () const |
| Get the position of the character.
|
|
void | SetPosition (RVec3Arg inPosition) |
| Set the position of the character.
|
|
Quat | GetRotation () const |
| Get the rotation of the character.
|
|
void | SetRotation (QuatArg inRotation) |
| Set the rotation of the character.
|
|
RMat44 | GetWorldTransform () const |
| Calculate the world transform of the character.
|
|
RMat44 | GetCenterOfMassTransform () const |
| Calculates the transform for this character's center of mass.
|
|
float | GetMass () const |
| Character mass (kg)
|
|
void | SetMass (float inMass) |
|
float | GetMaxStrength () const |
| Maximum force with which the character can push other bodies (N)
|
|
void | SetMaxStrength (float inMaxStrength) |
|
float | GetPenetrationRecoverySpeed () const |
| This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update.
|
|
void | SetPenetrationRecoverySpeed (float inSpeed) |
|
float | GetCharacterPadding () const |
| Character padding.
|
|
uint | GetMaxNumHits () const |
| Max num hits to collect in order to avoid excess of contact points collection.
|
|
void | SetMaxNumHits (uint inMaxHits) |
|
float | GetHitReductionCosMaxAngle () const |
| Cos(angle) where angle is the maximum angle between two hits contact normals that are allowed to be merged during hit reduction. Default is around 2.5 degrees. Set to -1 to turn off.
|
|
void | SetHitReductionCosMaxAngle (float inCosMaxAngle) |
|
bool | GetMaxHitsExceeded () const |
|
Vec3 | GetShapeOffset () const |
| An extra offset applied to the shape in local space. This allows applying an extra offset to the shape in local space. Note that setting it on the fly can cause the shape to teleport into collision.
|
|
void | SetShapeOffset (Vec3Arg inShapeOffset) |
|
uint64 | GetUserData () const |
| Access to the user data, can be used for anything by the application.
|
|
void | SetUserData (uint64 inUserData) |
|
Vec3 | CancelVelocityTowardsSteepSlopes (Vec3Arg inDesiredVelocity) const |
|
void | Update (float inDeltaTime, Vec3Arg inGravity, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
|
bool | CanWalkStairs (Vec3Arg inLinearVelocity) const |
|
bool | WalkStairs (float inDeltaTime, Vec3Arg inStepUp, Vec3Arg inStepForward, Vec3Arg inStepForwardTest, Vec3Arg inStepDownExtra, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
|
bool | StickToFloor (Vec3Arg inStepDown, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
|
void | ExtendedUpdate (float inDeltaTime, Vec3Arg inGravity, const ExtendedUpdateSettings &inSettings, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
|
void | RefreshContacts (const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
| This function can be used after a character has teleported to determine the new contacts with the world.
|
|
void | UpdateGroundVelocity () |
|
bool | SetShape (const Shape *inShape, float inMaxPenetrationDepth, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter, TempAllocator &inAllocator) |
|
void | CheckCollision (RVec3Arg inPosition, QuatArg inRotation, Vec3Arg inMovementDirection, float inMaxSeparationDistance, const Shape *inShape, RVec3Arg inBaseOffset, CollideShapeCollector &ioCollector, const BroadPhaseLayerFilter &inBroadPhaseLayerFilter, const ObjectLayerFilter &inObjectLayerFilter, const BodyFilter &inBodyFilter, const ShapeFilter &inShapeFilter) const |
| Get all contacts for the character at a particular location.
|
|
virtual void | SaveState (StateRecorder &inStream) const override |
|
virtual void | RestoreState (StateRecorder &inStream) override |
|
const ContactList & | GetActiveContacts () const |
| Access to the internal list of contacts that the character has found.
|
|
JPH_OVERRIDE_NEW_DELETE | CharacterBase (const CharacterBaseSettings *inSettings, PhysicsSystem *inSystem) |
| Constructor.
|
|
virtual | ~CharacterBase ()=default |
| Destructor.
|
|
void | SetMaxSlopeAngle (float inMaxSlopeAngle) |
| Set the maximum angle of slope that character can still walk on (radians)
|
|
float | GetCosMaxSlopeAngle () const |
|
void | SetUp (Vec3Arg inUp) |
| Set the up vector for the character.
|
|
Vec3 | GetUp () const |
|
bool | IsSlopeTooSteep (Vec3Arg inNormal) const |
| Check if the normal of the ground surface is too steep to walk on.
|
|
const Shape * | GetShape () const |
| Get the current shape that the character is using.
|
|
EGroundState | GetGroundState () const |
| Current ground state.
|
|
bool | IsSupported () const |
| Returns true if the player is supported by normal or steep ground.
|
|
RVec3 | GetGroundPosition () const |
| Get the contact point with the ground.
|
|
Vec3 | GetGroundNormal () const |
| Get the contact normal with the ground.
|
|
Vec3 | GetGroundVelocity () const |
| Velocity in world space of ground.
|
|
const PhysicsMaterial * | GetGroundMaterial () const |
| Material that the character is standing on.
|
|
BodyID | GetGroundBodyID () const |
| BodyID of the object the character is standing on. Note may have been removed!
|
|
SubShapeID | GetGroundSubShapeID () const |
| Sub part of the body that we're standing on.
|
|
uint64 | GetGroundUserData () const |
| User data value of the body that we're standing on.
|
|
| RefTarget ()=default |
| Constructor.
|
|
| RefTarget (const RefTarget &) |
|
| ~RefTarget () |
| assert no one is referencing us
|
|
void | SetEmbedded () const |
|
RefTarget & | operator= (const RefTarget &) |
| Assignment operator.
|
|
uint32 | GetRefCount () const |
| Get current refcount of this object.
|
|
void | AddRef () const |
| Add or release a reference to this object.
|
|
void | Release () const |
|
| NonCopyable ()=default |
|
| NonCopyable (const NonCopyable &)=delete |
|
void | operator= (const NonCopyable &)=delete |
|
Runtime character object. This object usually represents the player. Contrary to the Character class it doesn't use a rigid body but moves doing collision checks only (hence the name virtual). The advantage of this is that you can determine when the character moves in the frame (usually this has to happen at a very particular point in the frame) but the downside is that other objects don't see this virtual character. In order to make this work it is recommended to pair a CharacterVirtual with a Character that moves along. This Character should be keyframed (or at least have no gravity) and move along with the CharacterVirtual so that other rigid bodies can collide with it.