PackageBox2D.Collision.Shapes
Classpublic class b2PolygonDef
Inheritanceb2PolygonDef Inheritance b2ShapeDef
Sourceb2PolygonDef.as

This structure is used to build polygon shapes.

See also

b2PolygonShape


Public Properties
 PropertyDefined by
 Inheriteddensity : Number = 0.0
The shape's density, usually in kg/m^2.
b2ShapeDef
 Inheritedfilter : b2FilterData
Contact filtering data.
b2ShapeDef
 Inheritedfriction : Number = 0.2
The shape's friction coefficient, usually in the range [0,1].
b2ShapeDef
 InheritedisSensor : Boolean = false
A sensor shape collects contact information but never generates a collision response.
b2ShapeDef
 Inheritedrestitution : Number = 0.0
The shape's restitution (elasticity) usually in the range [0,1].
b2ShapeDef
 Inheritedtype : int
Holds the shape type for down-casting.
b2ShapeDef
 InheriteduserData : * = null
Use this to store application specify shape data.
b2ShapeDef
  vertexCount : int
The number of polygon vertices.
b2PolygonDef
  vertices : Array
The polygon vertices in local coordinates.
b2PolygonDef
Public Methods
 MethodDefined by
  
b2PolygonDef
  
SetAsBox(hx:Number, hy:Number):void
Build vertices to represent an axis-aligned box.
b2PolygonDef
  
SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):void
b2PolygonDef
Property detail
vertexCountproperty
public var vertexCount:int

The number of polygon vertices.

verticesproperty 
public var vertices:Array

The polygon vertices in local coordinates.

Constructor detail
b2PolygonDef()constructor
public function b2PolygonDef()
Method detail
SetAsBox()method
public function SetAsBox(hx:Number, hy:Number):void

Build vertices to represent an axis-aligned box.

Parameters
hx:Number — the half-width.
 
hy:Number — the half-height.
SetAsOrientedBox()method 
public function SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):voidParameters
hx:Number
 
hy:Number
 
center:b2Vec2 (default = null)
 
angle:Number (default = 0.0)