Class b2BuoyancyController

Calculates buoyancy forces for fluids in the form of a half plane.

Hierarchy

Index

Properties

Methods

Properties

public angularDrag: number

Linear drag co-efficient.

default

= 1

public density: number

The fluid density.

default

= 0

public gravity: b2Vec2

Gravity vector, if the world's gravity is not used.

default

= null

public linearDrag: number

Linear drag co-efficient.

default

= 2

public m_bodyCount: number

Body count.

public m_bodyList: b2ControllerEdge

List of bodies.

public normal: b2Vec2

The outer surface normal.

public offset: number

The height of the fluid surface along the normal.

default

= 0

public useDensity: boolean

If false, bodies are assumed to be uniformly dense, otherwise use the shapes densities.

default

= false.

public useWorldGravity: boolean

If true, gravity is taken from the world instead of the gravity parameter.

default

= true.

public velocity: b2Vec2

Fluid velocity, for drag calculations.

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)

Step

Parameters

  • step: any

    b2TimeStep -> Private internal class. Not sure why this is exposed.