Class b2GravityController

Applies simplified gravity between every pair of bodies.

Hierarchy

Index

Properties

Methods

Properties

public G: number

Specifies the strength of the gravitation force.

default

= 1

public invSqr: boolean

If true, gravity is proportional to r^-2, otherwise r^-1.

public m_bodyCount: number

Body count.

public m_bodyList: b2ControllerEdge

List of bodies.

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 Step(step: any)

see

b2Controller.Step

Parameters

  • step: any