Class CharacterController3D
StaticBody 3D enables your entities to act under the control of physics as a static body.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Physics3D
Assembly: Evergine.Framework.dll
Syntax
public sealed class CharacterController3D : PhysicBody3D<IGhostBody3D, GhostBodyDef3D>, IDependencyObject
Constructors
CharacterController3D()
Initializes a new instance of the CharacterController3D class.
Declaration
public CharacterController3D()
Properties
FallSpeed
Gets or sets the falling speed.
Declaration
public float FallSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
Gravity
Gets or sets the character's gravity.
Declaration
public float Gravity { get; set; }
Property Value
Type | Description |
---|---|
float |
JumpSpeed
Gets or sets the jump speed.
Declaration
public float JumpSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
MaxSlope
Gets or sets the maximum slope.
Declaration
[RenderProperty(typeof(FloatRadianToDegreeConverter))]
public float MaxSlope { get; set; }
Property Value
Type | Description |
---|---|
float |
OnGround
Gets a value indicating whether this character is on the ground.
Declaration
public bool OnGround { get; }
Property Value
Type | Description |
---|---|
bool |
StepHeight
Gets or sets the step height.
Declaration
public float StepHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
Jump()
Makes this character jump.
Declaration
public void Jump()
Jump(Vector3)
Makes this character jump.
Declaration
public void Jump(Vector3 jumpDirection)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | jumpDirection | The direction of the jump. |
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if everything is OK. |
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
Rotate(float)
Turns the character on the Y axis with the specified angle.
Declaration
public void Rotate(float yAngle)
Parameters
Type | Name | Description |
---|---|---|
float | yAngle | The rotation angle on the Y axis. |
SetVelocity(Vector3)
Sets the character's velocity.
Declaration
public void SetVelocity(Vector3 velocity)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | velocity | The velocity vector. |
Teleport(Vector3)
Teleports the specified character.
Declaration
public void Teleport(Vector3 newPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | newPosition | The new position. |
Update(TimeSpan)
Allows this instance to execute custom logic during its Update
.
Declaration
protected override void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The game time. |