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 : Controller
Inheritance
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 LimitAngularVelocity
Field Value
LimitLinearVelocity
The limit linear velocity
public bool LimitLinearVelocity
Field Value
_bodies
The body
private readonly List<Body> _bodies
Field Value
_maxAngularSqared
The max angular sqared
private float _maxAngularSqared
Field Value
_maxAngularVelocity
The max angular velocity
private float _maxAngularVelocity
Field Value
_maxLinearSqared
The max linear sqared
private float _maxLinearSqared
Field Value
_maxLinearVelocity
The max linear velocity
private float _maxLinearVelocity
Field 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
body
Body-
The body
RemoveBody(Body)
Removes the body using the specified body
public void RemoveBody(Body body)
Parameters
body
Body-
The body
Update(float)
Updates the dt
public override void Update(float dt)
Parameters
dt
float-
The dt