Jolt Physics
A multi core friendly Game Physics Engine
|
Contains the configuration of a character. More...
#include <CharacterVirtual.h>
Public Attributes | |
JPH_OVERRIDE_NEW_DELETE float | mMass = 70.0f |
Character mass (kg). Used to push down objects with gravity when the character is standing on top. More... | |
float | mMaxStrength = 100.0f |
Maximum force with which the character can push other bodies (N). More... | |
Vec3 | mShapeOffset = Vec3::sZero() |
An extra offset applied to the shape in local space. This allows applying an extra offset to the shape in local space. More... | |
Movement settings | |
EBackFaceMode | mBackFaceMode = EBackFaceMode::CollideWithBackFaces |
When colliding with back faces, the character will not be able to move through back facing triangles. Use this if you have triangles that need to collide on both sides. More... | |
float | mPredictiveContactDistance = 0.1f |
How far to scan outside of the shape for predictive contacts. A value of 0 will most likely cause the character to get stuck as it cannot properly calculate a sliding direction anymore. A value that's too high will cause ghost collisions. More... | |
uint | mMaxCollisionIterations = 5 |
Max amount of collision loops. More... | |
uint | mMaxConstraintIterations = 15 |
How often to try stepping in the constraint solving. More... | |
float | mMinTimeRemaining = 1.0e-4f |
Early out condition: If this much time is left to simulate we are done. More... | |
float | mCollisionTolerance = 1.0e-3f |
How far we're willing to penetrate geometry. More... | |
float | mCharacterPadding = 0.02f |
How far we try to stay away from the geometry, this ensures that the sweep will hit as little as possible lowering the collision cost and reducing the risk of getting stuck. More... | |
uint | mMaxNumHits = 256 |
Max num hits to collect in order to avoid excess of contact points collection. More... | |
float | mHitReductionCosMaxAngle = 0.999f |
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. More... | |
float | mPenetrationRecoverySpeed = 1.0f |
This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update. More... | |
RefConst< Shape > | mInnerBodyShape |
ObjectLayer | mInnerBodyLayer = 0 |
Layer that the inner rigid body will be added to. More... | |
Public Attributes inherited from CharacterBaseSettings | |
Vec3 | mUp = Vec3::sAxisY() |
Vector indicating the up direction of the character. More... | |
Plane | mSupportingVolume { Vec3::sAxisY(), -1.0e10f } |
float | mMaxSlopeAngle = DegreesToRadians(50.0f) |
Maximum angle of slope that character can still walk on (radians). More... | |
bool | mEnhancedInternalEdgeRemoval = false |
Set to indicate that extra effort should be made to try to remove ghost contacts (collisions with internal edges of a mesh). This is more expensive but makes bodies move smoother over a mesh with convex edges. More... | |
RefConst< Shape > | mShape |
Additional Inherited Members | |
Public Member Functions inherited from CharacterBaseSettings | |
JPH_OVERRIDE_NEW_DELETE | CharacterBaseSettings ()=default |
Constructor. More... | |
CharacterBaseSettings (const CharacterBaseSettings &inSettings)=default | |
CharacterBaseSettings & | operator= (const CharacterBaseSettings &inSettings)=default |
virtual | ~CharacterBaseSettings ()=default |
Virtual destructor. More... | |
Public Member Functions inherited from RefTarget< CharacterBaseSettings > | |
RefTarget ()=default | |
Constructor. More... | |
RefTarget (const RefTarget &) | |
~RefTarget () | |
assert no one is referencing us More... | |
void | SetEmbedded () const |
RefTarget & | operator= (const RefTarget &) |
Assignment operator. More... | |
uint32 | GetRefCount () const |
Get current refcount of this object. More... | |
void | AddRef () const |
Add or release a reference to this object. More... | |
void | Release () const |
Static Public Member Functions inherited from RefTarget< CharacterBaseSettings > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. More... | |
Protected Attributes inherited from RefTarget< CharacterBaseSettings > | |
atomic< uint32 > | mRefCount |
Current reference count. More... | |
Static Protected Attributes inherited from RefTarget< CharacterBaseSettings > | |
static constexpr uint32 | cEmbedded |
A large value that gets added to the refcount to mark the object as embedded. More... | |
Contains the configuration of a character.
EBackFaceMode CharacterVirtualSettings::mBackFaceMode = EBackFaceMode::CollideWithBackFaces |
When colliding with back faces, the character will not be able to move through back facing triangles. Use this if you have triangles that need to collide on both sides.
float CharacterVirtualSettings::mCharacterPadding = 0.02f |
How far we try to stay away from the geometry, this ensures that the sweep will hit as little as possible lowering the collision cost and reducing the risk of getting stuck.
float CharacterVirtualSettings::mCollisionTolerance = 1.0e-3f |
How far we're willing to penetrate geometry.
float CharacterVirtualSettings::mHitReductionCosMaxAngle = 0.999f |
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.
ObjectLayer CharacterVirtualSettings::mInnerBodyLayer = 0 |
Layer that the inner rigid body will be added to.
This character can optionally have an inner rigid body. This rigid body can be used to give the character presence in the world. When set it means that:
JPH_OVERRIDE_NEW_DELETE float CharacterVirtualSettings::mMass = 70.0f |
Character mass (kg). Used to push down objects with gravity when the character is standing on top.
uint CharacterVirtualSettings::mMaxCollisionIterations = 5 |
Max amount of collision loops.
uint CharacterVirtualSettings::mMaxConstraintIterations = 15 |
How often to try stepping in the constraint solving.
uint CharacterVirtualSettings::mMaxNumHits = 256 |
Max num hits to collect in order to avoid excess of contact points collection.
float CharacterVirtualSettings::mMaxStrength = 100.0f |
Maximum force with which the character can push other bodies (N).
float CharacterVirtualSettings::mMinTimeRemaining = 1.0e-4f |
Early out condition: If this much time is left to simulate we are done.
float CharacterVirtualSettings::mPenetrationRecoverySpeed = 1.0f |
This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update.
float CharacterVirtualSettings::mPredictiveContactDistance = 0.1f |
How far to scan outside of the shape for predictive contacts. A value of 0 will most likely cause the character to get stuck as it cannot properly calculate a sliding direction anymore. A value that's too high will cause ghost collisions.
Vec3 CharacterVirtualSettings::mShapeOffset = Vec3::sZero() |
An extra offset applied to the shape in local space. This allows applying an extra offset to the shape in local space.