Packagecom.boristhebrave.Box2DWith.Flint
Classpublic class BodyInit
InheritanceBodyInit Inheritance org.flintparticles.common.initializers.InitializerBase

This initializer creates bodies with the given body and shape def, and then attaches them to particles for later use with BodyRenderer. The particles velocity and position are copied over, allowing you to use Flint's usual suite of initializers as well as rigid bodies.

If you wish to do further initialization, create a new initializer, and ensure it has lower default priority than BodyInitializer.



Public Properties
 PropertyDefined by
  bodyDef : b2BodyDef
The body definition used to create bodies.
BodyInit
  scale : Number
The scaling factor to use when initialzing body properties from particle properties.
BodyInit
  shapeDefs : Array
An array of b2ShapeDef used to fill the body with shapes.
BodyInit
  world : b2World
The world which bodies will be created for.
BodyInit
Public Methods
 MethodDefined by
  
BodyInit(world:b2World, bodyDef:b2BodyDef, shapeDefs:Array, scale:Number)
Creates a new initializer, attached to the given world.
BodyInit
Property detail
bodyDefproperty
public var bodyDef:b2BodyDef

The body definition used to create bodies. SetMassFromShapes is always used to define the body mass.

scaleproperty 
public var scale:Number

The scaling factor to use when initialzing body properties from particle properties.

shapeDefsproperty 
public var shapeDefs:Array

An array of b2ShapeDef used to fill the body with shapes.

worldproperty 
public var world:b2World

The world which bodies will be created for.

Constructor detail
BodyInit()constructor
public function BodyInit(world:b2World, bodyDef:b2BodyDef, shapeDefs:Array, scale:Number)

Creates a new initializer, attached to the given world.

Parameters
world:b2World — The world attached to.
 
bodyDef:b2BodyDef — The definition used to create bodies for each particle
 
shapeDefs:Array — An array of b2ShapeDef to create inside the body.
 
scale:Number — The scaling factor to use in pixels/unit for initializing the position and velocity of the body given the particle properties.