Table of Contents

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

maxLinearVelocity float

The max linear velocity.

maxAngularVelocity float

The max angular velocity.

Fields

LimitAngularVelocity

The limit angular velocity

public bool LimitAngularVelocity

Field Value

bool

LimitLinearVelocity

The limit linear velocity

public bool LimitLinearVelocity

Field Value

bool

_bodies

The body

private readonly List<Body> _bodies

Field Value

List<Body>

_maxAngularSqared

The max angular sqared

private float _maxAngularSqared

Field Value

float

_maxAngularVelocity

The max angular velocity

private float _maxAngularVelocity

Field Value

float

_maxLinearSqared

The max linear sqared

private float _maxLinearSqared

Field Value

float

_maxLinearVelocity

The max linear velocity

private float _maxLinearVelocity

Field Value

float

Properties

MaxAngularVelocity

Gets or sets the max angular velocity.

public float MaxAngularVelocity { get; set; }

Property Value

float

MaxLinearVelocity

Gets or sets the max linear velocity.

public float MaxLinearVelocity { get; set; }

Property Value

float

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