KinematicCharacterController Class |
Namespace: DigitalRune.Physics.Specialized
The KinematicCharacterController type exposes the following members.
Name | Description | |
---|---|---|
KinematicCharacterController(Simulation) |
Initializes a new instance of the KinematicCharacterController class.
| |
KinematicCharacterController(Simulation, Vector3F) |
Initializes a new instance of the KinematicCharacterController class.
|
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Move |
Moves the character to a new position while avoiding penetrations and sliding along
obstacles.
| |
ResolvePenetrations |
Tries to move the character to the nearest position where it does not penetrate other
objects.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Body |
Gets or sets the body.
| |
CollisionGroup |
Gets or sets the collision group.
| |
Enabled |
Gets or sets a value indicating whether this character controller is enabled.
| |
Gravity |
Gets or sets the gravity.
| |
HasGroundContact |
Gets a value indicating whether this character has ground contact.
| |
Height |
Gets or sets the height.
| |
IsClimbing |
Gets or sets a value indicating whether this instance is climbing.
| |
JumpManeuverability |
Gets or sets the jump maneuverability.
| |
MaxVelocity |
Gets or sets the maximum velocity of the character.
| |
NumberOfSlideIterations |
Gets or sets the number of slide iterations.
| |
NumberOfSolverIterations |
Gets or sets the number of solver iterations.
| |
Position |
Gets or sets the position of the character.
| |
PushForce |
Gets or sets the maximal push force with which the character pushes other objects.
| |
Simulation |
Gets or sets the simulation.
| |
SlopeLimit |
Gets or sets the slope limit (in radians).
| |
StepHeight |
Gets or sets the height of the step.
| |
UpVector |
Gets the vector that points into the "up" direction.
| |
Velocity |
Gets the current velocity of the character controller.
| |
Width |
Gets or sets the width.
|
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.