Options
All
  • Public
  • Public/Protected
  • All
Menu

Class b2BuoyancyController

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

Hierarchy

Index

Properties

angularDrag

angularDrag: number = 0

Angular drag co-efficient

density

density: number = 0

The fluid density

Readonly gravity

gravity: b2Vec2 = new b2Vec2(0, 0)

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

linearDrag

linearDrag: number = 0

Linear drag co-efficient

m_bodyCount

m_bodyCount: number = 0

m_bodyList

m_bodyList: b2ControllerEdge | null = null

m_next

m_next: b2Controller | null = null

m_prev

m_prev: b2Controller | null = null

Readonly normal

normal: b2Vec2 = new b2Vec2(0, 1)

The outer surface normal

offset

offset: number = 0

The height of the fluid surface along the normal

useDensity

useDensity: boolean = false

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

useWorldGravity

useWorldGravity: boolean = true

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

Readonly velocity

velocity: b2Vec2 = new b2Vec2(0, 0)

Fluid velocity, for drag calculations

Methods

AddBody

  • Adds a body to the controller list.

    Parameters

    Returns void

Clear

  • Clear(): void
  • Removes all bodies from the controller list.

    Returns void

Draw

  • Draw(debugDraw: b2Draw): void
  • Parameters

    Returns void

GetBodyList

GetNext

  • Get the next controller in the world's body list.

    Returns b2Controller | null

GetPrev

  • Get the previous controller in the world's body list.

    Returns b2Controller | null

RemoveBody

  • RemoveBody(body: b2Body): void
  • Removes a body from the controller list.

    Parameters

    Returns void

Step

  • Parameters

    Returns void

Generated using TypeDoc