Character Virtual Settings
Contains the configuration of a character
C++ JPH::CharacterVirtualSettings.
Properties
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.
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
How far we're willing to penetrate geometry
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.
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.
ID to give to this character. This is used for deterministically sorting and as an identifier to represent the character in the contact removal callback.
For a deterministic simulation, it is important to have a deterministic body ID. When set and when mInnerBodyShape is specified, the inner body will be created with this specified ID instead of a generated ID.
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:
Max amount of collision loops
How often to try stepping in the constraint solving
Max num hits to collect in order to avoid excess of contact points collection
Maximum angle of slope that character can still walk on (radians).
Maximum force with which the character can push other bodies (N).
Early out condition: If this much time is left to simulate we are done
This value governs how fast a penetration will be resolved, 0 = nothing is resolved, 1 = everything in one update
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.
An extra offset applied to the shape in local space. This allows applying an extra offset to the shape in local space.
Plane, defined in local space relative to the character. Every contact behind this plane can support the character, every contact in front of this plane is treated as only colliding with the player. Default: Accept any contact.