PackageBox2D.Dynamics.Controllers
Classpublic class b2BuoyancyController
Inheritanceb2BuoyancyController Inheritance b2Controller
Sourceb2BuoyancyController.as

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



Public Properties
 PropertyDefined by
  angularDrag : Number = 1
Linear drag co-efficient
b2BuoyancyController
  density : Number = 0
The fluid density
b2BuoyancyController
  gravity : b2Vec2 = null
Gravity vector, if the world's gravity is not used
b2BuoyancyController
  linearDrag : Number = 2
Linear drag co-efficient
b2BuoyancyController
  normal : b2Vec2
The outer surface normal
b2BuoyancyController
  offset : Number = 0
The height of the fluid surface along the normal
b2BuoyancyController
  useDensity : Boolean = false
If false, bodies are assumed to be uniformly dense, otherwise use the shapes densities
b2BuoyancyController
  useWorldGravity : Boolean = true
If true, gravity is taken from the world instead of the gravity parameter.
b2BuoyancyController
  velocity : b2Vec2
Fluid velocity, for drag calculations
b2BuoyancyController
Protected Properties
 PropertyDefined by
 Inheritedm_bodyCount : int
b2Controller
 Inheritedm_bodyList : b2ControllerEdge
b2Controller
Public Methods
 MethodDefined by
 Inherited
AddBody(body:b2Body):void
b2Controller
 Inherited
Clear():void
b2Controller
  
Draw(debugDraw:b2DebugDraw):void
b2BuoyancyController
 Inherited
b2Controller
 Inherited
b2Controller
 Inherited
b2Controller
 Inherited
RemoveBody(body:b2Body):void
b2Controller
  
Step(step:b2TimeStep):void
b2BuoyancyController
Property detail
angularDragproperty
public var angularDrag:Number = 1

Linear drag co-efficient

densityproperty 
public var density:Number = 0

The fluid density

gravityproperty 
public var gravity:b2Vec2 = null

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

linearDragproperty 
public var linearDrag:Number = 2

Linear drag co-efficient

normalproperty 
public var normal:b2Vec2

The outer surface normal

offsetproperty 
public var offset:Number = 0

The height of the fluid surface along the normal

useDensityproperty 
public var useDensity:Boolean = false

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

useWorldGravityproperty 
public var useWorldGravity:Boolean = true

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

velocityproperty 
public var velocity:b2Vec2

Fluid velocity, for drag calculations

Method detail
Draw()method
public override function Draw(debugDraw:b2DebugDraw):voidParameters
debugDraw:b2DebugDraw
Step()method 
public override function Step(step:b2TimeStep):voidParameters
step:b2TimeStep