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

Contains the configuration of a character. More...

#include <CharacterVirtual.h>

Inheritance diagram for CharacterVirtualSettings:
CharacterBaseSettings RefTarget< CharacterBaseSettings >

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.
 
float mMaxStrength = 100.0f
 Maximum force with which the character can push other bodies (N).
 
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.
 
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.
 
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.
 
uint mMaxCollisionIterations = 5
 Max amount of collision loops.
 
uint mMaxConstraintIterations = 15
 How often to try stepping in the constraint solving.
 
float mMinTimeRemaining = 1.0e-4f
 Early out condition: If this much time is left to simulate we are done.
 
float mCollisionTolerance = 1.0e-3f
 How far we're willing to penetrate geometry.
 
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.
 
uint mMaxNumHits = 256
 Max num hits to collect in order to avoid excess of contact points collection.
 
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.
 
float mPenetrationRecoverySpeed = 1.0f
 This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update.
 
- Public Attributes inherited from CharacterBaseSettings
Vec3 mUp = Vec3::sAxisY()
 Vector indicating the up direction of the character.
 
Plane mSupportingVolume { Vec3::sAxisY(), -1.0e10f }
 
float mMaxSlopeAngle = DegreesToRadians(50.0f)
 Maximum angle of slope that character can still walk on (radians).
 
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.
 
RefConst< ShapemShape
 

Additional Inherited Members

- Public Member Functions inherited from CharacterBaseSettings
JPH_OVERRIDE_NEW_DELETE CharacterBaseSettings ()=default
 Constructor.
 
 CharacterBaseSettings (const CharacterBaseSettings &inSettings)=default
 
CharacterBaseSettingsoperator= (const CharacterBaseSettings &inSettings)=default
 
virtual ~CharacterBaseSettings ()=default
 Virtual destructor.
 
- Public Member Functions inherited from RefTarget< CharacterBaseSettings >
 RefTarget ()=default
 Constructor.
 
 RefTarget (const RefTarget &)
 
 ~RefTarget ()
 assert no one is referencing us
 
void SetEmbedded () const
 
RefTargetoperator= (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
 
- Static Public Member Functions inherited from RefTarget< CharacterBaseSettings >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION.
 
- Protected Attributes inherited from RefTarget< CharacterBaseSettings >
atomic< uint32mRefCount
 Current reference count.
 
- 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.
 

Detailed Description

Contains the configuration of a character.

Member Data Documentation

◆ mBackFaceMode

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.

◆ mCharacterPadding

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.

◆ mCollisionTolerance

float CharacterVirtualSettings::mCollisionTolerance = 1.0e-3f

How far we're willing to penetrate geometry.

◆ mHitReductionCosMaxAngle

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.

◆ mMass

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.

◆ mMaxCollisionIterations

uint CharacterVirtualSettings::mMaxCollisionIterations = 5

Max amount of collision loops.

◆ mMaxConstraintIterations

uint CharacterVirtualSettings::mMaxConstraintIterations = 15

How often to try stepping in the constraint solving.

◆ mMaxNumHits

uint CharacterVirtualSettings::mMaxNumHits = 256

Max num hits to collect in order to avoid excess of contact points collection.

◆ mMaxStrength

float CharacterVirtualSettings::mMaxStrength = 100.0f

Maximum force with which the character can push other bodies (N).

◆ mMinTimeRemaining

float CharacterVirtualSettings::mMinTimeRemaining = 1.0e-4f

Early out condition: If this much time is left to simulate we are done.

◆ mPenetrationRecoverySpeed

float CharacterVirtualSettings::mPenetrationRecoverySpeed = 1.0f

This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update.

◆ mPredictiveContactDistance

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.

◆ mShapeOffset

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.


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