Click or drag to resize
DigitalRuneDynamicCharacterController Class
Controls the movement of a game character.
Inheritance Hierarchy
SystemObject
  DigitalRune.Physics.SpecializedDynamicCharacterController

Namespace: DigitalRune.Physics.Specialized
Assembly: DigitalRune.Physics.Specialized (in DigitalRune.Physics.Specialized.dll) Version: 1.10.0.0 (1.10.0.0)
Syntax
public class DynamicCharacterController

The DynamicCharacterController type exposes the following members.

Constructors
  NameDescription
Public methodDynamicCharacterController
Initializes a new instance of the KinematicCharacterController class.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMove
Moves the character to a new position while avoiding penetrations and sliding along obstacles.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyBody
Gets or sets the body.
Public propertyCollisionGroup
Gets or sets the collision group.
Public propertyEnabled
Gets or sets a value indicating whether this character controller is enabled.
Public propertyGravity
Gets or sets the gravity.
Public propertyHasGroundContact
Gets a value indicating whether this character has ground contact.
Public propertyHeight
Gets or sets the height.
Public propertyIsClimbing
Gets or sets a value indicating whether this instance is climbing.
Public propertyPosition
Gets or sets the position of the character.
Public propertySimulation
Gets or sets the simulation.
Public propertySlopeLimit
Gets or sets the slope limit (in radians).
Public propertyWidth
Gets or sets the width.
Top
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 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.

See Also