DynamicCharacterController Class |
Namespace: DigitalRune.Physics.Specialized
The DynamicCharacterController type exposes the following members.
Name | Description | |
---|---|---|
DynamicCharacterController |
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.
| |
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.
| |
Position |
Gets or sets the position of the character.
| |
Simulation |
Gets or sets the simulation.
| |
SlopeLimit |
Gets or sets the slope limit (in radians).
| |
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 small obstacles.
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 set the velocity of the Body. The body will be moved by the simulation. 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.