Class RigidBody3D
RigidBody3D enable your entities to act under the control of physics. The Rigidbody can receive forces and torque to make your objects move in a realistic way. Any entity must contain a Rigidbody to be influenced by gravity, act under added forces or interact with other objects through physics engine.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Physics3D
Assembly: Evergine.Framework.dll
Syntax
public sealed class RigidBody3D : PhysicBody3D<IRigidBody3D, RigidBodyDef3D>, IDependencyObject
Constructors
RigidBody3D()
Initializes a new instance of the RigidBody3D class.
Declaration
public RigidBody3D()
Properties
AngularDamping
Gets or sets the angular Damping.
Declaration
[RenderProperty(Tooltip = "Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.")]
public float AngularDamping { get; set; }
Property Value
Type | Description |
---|---|
float | The angular damping. |
Remarks
The Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.
AngularFactor
Gets or sets a value indicating whether [fixed rotation].
Declaration
[RenderProperty(Tooltip = "Should this body be prevented from rotating? Useful for characters.")]
public Vector3 AngularFactor { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
|
AngularVelocity
Gets or sets the angular velocity of the physics entity.
Declaration
[RenderProperty(Tooltip = "The angular velocity of the body.")]
public Vector3 AngularVelocity { get; set; }
Property Value
Type | Description |
---|---|
Vector3 | The angular velocity. |
Gravity
Gets or sets the gravity applied to this body.
Declaration
[RenderProperty(AttachToTag = 1, AttachToValue = true, Tooltip = "Scale the gravity applied to this body.")]
public Vector3 Gravity { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
LinearDamping
Gets or sets the linear damping.
Declaration
[RenderProperty(Tooltip = "Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.")]
public float LinearDamping { get; set; }
Property Value
Type | Description |
---|---|
float | The linear damping. |
Remarks
Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large.
LinearFactor
Gets or sets a value indicating whether [fixed rotation].
Declaration
[RenderProperty(Tooltip = "Should this body be prevented from rotating? Useful for characters.")]
public Vector3 LinearFactor { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
|
LinearVelocity
Gets or sets the linear velocity of the physics entity.
Declaration
[RenderProperty(Tooltip = "The linear velocity of the body's origin in world co-ordinates.")]
public Vector3 LinearVelocity { get; set; }
Property Value
Type | Description |
---|---|
Vector3 | The linear velocity. |
LocalInertia
Gets the rotational inertia of the body about the local origin.
Declaration
public Vector3 LocalInertia { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Mass
Gets or sets the total mass of the body.
Declaration
public float Mass { get; set; }
Property Value
Type | Description |
---|---|
float |
OverrideGravity
Gets or sets a value indicating whether the gravity is overrided.
Declaration
[RenderProperty(Tag = 1, Tooltip = "Scale the gravity applied to this body.")]
public bool OverrideGravity { get; set; }
Property Value
Type | Description |
---|---|
bool |
PhysicBodyType
Gets or sets the type of the physic body.
Declaration
[RenderProperty(Tooltip = "The body type: static, kinematic, or dynamic. Note: if a dynamic body would have zero mass, the mass is set to one.")]
public RigidBodyType3D PhysicBodyType { get; set; }
Property Value
Type | Description |
---|---|
RigidBodyType3D | The type of the physic body. |
Methods
ApplyForce(Vector3)
Apply a central force to the rigid body.
Declaration
public void ApplyForce(Vector3 force)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | force | The force. |
ApplyForceAtPosition(Vector3, Vector3)
Apply a force to the rigid body.
Declaration
public void ApplyForceAtPosition(Vector3 force, Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | force | The force vector in world coordinates. |
Vector3 | position | Position in world coordinates. |
ApplyImpulse(Vector3)
Apply an impulse to the center of the rigid body.
Declaration
public void ApplyImpulse(Vector3 impulse)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | impulse | The impulse in world coordinates. |
ApplyImpulseAtPosition(Vector3, Vector3)
Apply an impulse to the rigid body.
Declaration
public void ApplyImpulseAtPosition(Vector3 impulse, Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | impulse | The impulse in world coordinates. |
Vector3 | position | Position in world coordinates. |
ApplyTorque(Vector3)
Apply a torque force to the rigid body.
Declaration
public void ApplyTorque(Vector3 torque)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | torque | The torque. |
ApplyTorqueImpulse(Vector3)
Apply torque impulse to the rigid body.
Declaration
public void ApplyTorqueImpulse(Vector3 torque)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | torque | The torque impulse. |
ClearForces()
Clear all forces applied to the rigid body.
Declaration
public void ClearForces()
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. |
Overrides
Remarks
WakeUp()
Wake up the rigid body.
Declaration
public void WakeUp()