CharacterVirtualSettings

Contains the configuration of a character

C++ JPH::CharacterVirtualSettings.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

How far we're willing to penetrate geometry

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Layer that the inner rigid body will be added to

Link copied to clipboard

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:

Link copied to clipboard
var mass: Float

Character mass (kg). Used to push down objects with gravity when the character is standing on top.

Link copied to clipboard

Max amount of collision loops

Link copied to clipboard

How often to try stepping in the constraint solving

Link copied to clipboard

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

Link copied to clipboard

Maximum angle of slope that character can still walk on (radians).

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard
var shape: Shape?

Initial shape that represents the character's volume. Usually this is a capsule, make sure the shape is made so that the bottom of the shape is at (0, 0, 0).

Link copied to clipboard

An extra offset applied to the shape in local space. This allows applying an extra offset to the shape in local space.

Link copied to clipboard

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.

Link copied to clipboard
var up: Vec3

Vector indicating the up direction of the character

Functions

Link copied to clipboard
open override fun addRef()
Link copied to clipboard
open override fun close()