Class VelocityLimitController
- Namespace
- Alis.Core.Physic.Controllers
- Assembly
- Alis.dll
Put a limit on the linear (translation - the movespeed) and angular (rotation) velocity of bodies added to this controller.
public class VelocityLimitController : ControllerInheritance
Inherited Members
Constructors
VelocityLimitController()
Initializes a new instance of the Alis.Core.Physic.Controllers.VelocityLimitController class. Sets the max linear velocity to Settings.MaxTranslation Sets the max angular velocity to Settings.MaxRotation
public VelocityLimitController()VelocityLimitController(float, float)
Initializes a new instance of the Alis.Core.Physic.Controllers.VelocityLimitController class. Pass in 0 or float.MaxValue to disable the limit. maxAngularVelocity = 0 will disable the angular velocity limit.
public VelocityLimitController(float maxLinearVelocity, float maxAngularVelocity)Parameters
Fields
LimitAngularVelocity
The limit angular velocity
public bool LimitAngularVelocityField Value
LimitLinearVelocity
The limit linear velocity
public bool LimitLinearVelocityField Value
_bodies
The body
private readonly List<Body> _bodiesField Value
_maxAngularSqared
The max angular sqared
private float _maxAngularSqaredField Value
_maxAngularVelocity
The max angular velocity
private float _maxAngularVelocityField Value
_maxLinearSqared
The max linear sqared
private float _maxLinearSqaredField Value
_maxLinearVelocity
The max linear velocity
private float _maxLinearVelocityField Value
Properties
MaxAngularVelocity
Gets or sets the max angular velocity.
public float MaxAngularVelocity { get; set; }Property Value
MaxLinearVelocity
Gets or sets the max linear velocity.
public float MaxLinearVelocity { get; set; }Property Value
Methods
AddBody(Body)
Adds the body using the specified body
public void AddBody(Body body)Parameters
bodyBody-
The body
RemoveBody(Body)
Removes the body using the specified body
public void RemoveBody(Body body)Parameters
bodyBody-
The body
Update(float)
Updates the dt
public override void Update(float dt)Parameters
dtfloat-
The dt