Assembly: DigitalRune.Physics.Specialized (in DigitalRune.Physics.Specialized.dll) Version: 1.5.0.0 (1.5.0.0)
Syntax
| C# |
|---|
public class KinematicCharacterController |
| Visual Basic |
|---|
Public Class KinematicCharacterController |
| Visual C++ |
|---|
public ref class KinematicCharacterController |
Remarks
The character is represented by an upright capsule. When the character moves, it will slide along obstacles to create a smooth movement. The character can move on light slopes, but will be stopped by steep slopes (see SlopeLimit). The character will automatically step over obstacles and climb onto steps up to a certain height limit (see StepHeight).
A single RigidBody (see property Body) is created for the character capsule and added to a Simulation, which is specified when the character controller is created. The RigidBody can be used to set the collision group and collision filtering. The RigidBody is automatically added to the Simulation when the character controller is created and removed from the Simulation when the character controller is disabled.
To teleport the character to a new position, simply set the property Position directly.
The character controller applies gravity itself and the Body should be excluded from global force effects like gravity and damping.
To move the character Move(Vector3F, Single, Single) must be called. This will immediately compute a new position. But the Simulation can also move the character, for example, when it is pushed by kinematic objects. Therefore, the position is only final after the simulation was updated.
General notes: In first person shooters character speeds up to 10 m/s are used. This is about twice as fast as normal human movement. For this high speed, the gravity is often set to a higher than normal value, like 16 m/s², to account for this unnatural speed.