Class b2TensorDampingController

Applies top down linear damping to the controlled bodies The damping is calculated by multiplying velocity by a matrix in local co-ordinates.

Hierarchy

Index

Properties

Methods

Properties

public T: b2Mat22

Tensor to use in damping model.

public m_bodyCount: number

Body count.

public m_bodyList: b2ControllerEdge

List of bodies.

public maxTimeStep: number

Set this to a positive number to clamp the maximum amount of damping done.

default

= 0

Methods

public AddBody(body: b2Body)

Adds a body to the controller.

Parameters

public Clear()

Removes all bodies from the controller.

public Draw(debugDraw: b2DebugDraw)

Debug drawing.

Parameters

public GetBodyList(): b2ControllerEdge

Gets the body list.

Returns

b2ControllerEdge

Body list.

public GetNext(): b2Controller

Gets the next controller.

Returns

b2Controller

Next controller.

public GetWorld(): b2World

Gets the world.

Returns

b2World

World.

public RemoveBody(body: b2Body)

Removes a body from the controller.

Parameters

  • body: b2Body

    Body to remove from this controller.

public SetAxisAligned(xDamping: number, yDamping: number)

Helper function to set T in a common case.

Parameters

  • xDamping: number

    x

  • yDamping: number

    y

public Step(step: any)

see

b2Controller.Step

Parameters

  • step: any