public struct CharacterMovementHow a character walks. The authored half.
Remarks
Beside a CharacterMovement, PhysicsScene gives an entity a CharacterController and drives it from the entity's MoveIntent — so a walking player is this component, a MoveIntent, and nothing else. What writes the intent is not this assembly's business: a player controller, an AI planner and a replay are indistinguishable from here, which is the point of the seam ([29](../../../docs/plan/29-players-and-possession.md)).
The defaults describe the same human CharacterControllerSettings does — 1.8 m in a 0.3 m capsule — walking at 4 m/s, sprinting at 7, and jumping about 1.1 m.
Fields and properties (26)
public ShapeId ShapeThe collision volume while standing.
public ShapeId CrouchShapeThe collision volume while crouching, or none to make crouching do nothing.
public PhysicsLayer LayerWhich layer the character collides against.
public Vector3 ShapeOffsetWhere the shape's centre sits relative to the entity's origin, in the entity's own frame.
public Vector3 CrouchShapeOffsetThe same, for CrouchShape.
public float MaxSlopeAngleThe steepest slope the character can stand on, in radians.
public float StepHeightHow tall a step the character can walk up without jumping, in metres.
public float WalkSpeedTop speed on the ground, in metres a second.
public float SprintSpeedTop speed while MoveButtons.Sprint is held.
public float CrouchSpeedTop speed while crouched.
public float AccelerationHow hard the character accelerates towards its wanted speed on the ground, in m/s².
public float AirAccelerationThe same, in the air. Usually much smaller.
public float GravityDownward acceleration while not walking, in m/s². Negative.
public float JumpSpeedHow fast the character leaves the ground when it jumps, in metres a second.
public float CoyoteTimeHow long after walking off a ledge a jump still works, in seconds.
public float JumpBufferTimeHow long before landing a jump press is remembered, in seconds.
public float JumpCutSpeedThe upward speed a jump is cut to when the button is released early, in metres a second.
public bool TurnWithAimWhether the character turns to face where its intent says it is looking.
public float SwimSpeedTop speed in water, in metres a second.
public float SwimAccelerationHow hard the character accelerates towards its wanted speed in water, in m/s².
public float SwimThresholdHow submerged the character has to be to start swimming, 0…1 of the capsule.
public float WadeThresholdHow far the immersion has to fall before a swimmer wades again, 0…1.
public float SwimRestImmersionHow submerged a floating character settles at, 0…1 of the capsule.
public float SwimDragHow fast the water damps a swimmer's vertical motion, per second.
public float WadeSpeedScaleHow much slower wading is at the wade threshold, 0…1 of the walk speed.
public static CharacterMovement DefaultA human: 4 m/s walking, 7 sprinting, 2 crouched, jumping about 1.1 m under doubled gravity.
Methods (3)
public static float JumpSpeedForHeight(float height, float gravity)The JumpSpeed that reaches a given apex under a given gravity.
public static float ResolveMaxSlopeAngle(float value)The steepest slope a written MaxSlopeAngle actually asks for.
public static float ResolveStepHeight(float value)The step a written StepHeight actually asks for.
Used by (17)
- PlayerRigThirdPersonShooter
- CharacterAllocationTestsVixen.Physics.Tests
- CharacterMotionVixen.Physics
- CharacterMotionTestsVixen.Physics.Tests
- CharacterMovementSystemVixen.Physics
- CharacterSceneTestsVixen.Physics.Tests
- CharacterSwimmingTestsVixen.Physics.Tests
- ComponentRegistrationVixen.Physics
- MachineVixen.Net.Physics.Tests
- PhysicsSceneVixen.Physics
- PhysicsSceneComponentTestsVixen.Physics.Tests
- PredictedPlayerMovementTestsVixen.Net.Physics.Tests
- TypeRegistrationVixen.Physics
- Vixen_Physics_Characters_CharacterMovementSerializerVixen.Physics
- WaterImmersionSystemVixen.Water.Physics
- WaterImmersionSystemTestsVixen.Water.Physics.Tests
- MaterialIconsVixen.Editor.App