PackageBox2DAS.Collision.Shapes
Classpublic class b2PolygonShape
Inheritanceb2PolygonShape Inheritance b2Shape Inheritance b2Base Inheritance Object



Public Properties
 PropertyDefined By
 Inheritedbytes : ByteArray
[static]
b2Base
 Inheritedinitialized : Boolean = false
[static]
b2Base
 Inheritedlib : Object
[static]
b2Base
 Inheritedloader : CLibInit
[static]
b2Base
 Inheritedm_area : Number
b2Shape
  m_centroid : b2Vec2
b2PolygonShape
 Inheritedmem : MemUser
[static]
b2Base
  m_normals : Vector.<V2>
b2PolygonShape
 Inheritedm_radius : Number
b2Shape
 Inheritedm_type : int
b2Shape
  m_vertexCount : int
b2PolygonShape
  m_vertices : Vector.<V2>
b2PolygonShape
 Inherited_ptr : Number
b2Base
 Inheritedvalid : Boolean
[read-only] Does the object point to a C++ equivalent (i.e.
b2Base
Public Methods
 MethodDefined By
  
b2PolygonShape(p:int = 0)
b2PolygonShape
  
CheckVertexDirection(v:Vector.<V2>):Boolean
[static]
b2PolygonShape
  
ComputeAABB(aabb:AABB, xf:XF):void
[override]
b2PolygonShape
  
ComputeCentroid(vs:Vector.<V2>):V2
[static]
b2PolygonShape
  
ComputeMass(massData:b2MassData, density:Number):void
[override]
b2PolygonShape
  
ComputeSubmergedArea(normal:V2, offset:Number, xf:XF, c:V2):Number
[override]
b2PolygonShape
 Inherited
b2Shape
  
Decompose(v:Vector.<Number>):Vector.<b2PolygonShape>
[static]
b2PolygonShape
 Inherited
deref(adr:int):*
[static] dereference a C++ pointer or AS3_Val that is pointing to an AS3 object.
b2Base
  
destroy():void
[override]
b2PolygonShape
  
Draw(g:Graphics, xf:XF, scale:Number = 1, options:Object = null):void
[override]
b2PolygonShape
  
EnsureCorrectVertexDirection(v:Vector.<V2>):Boolean
[static]
b2PolygonShape
 Inherited
getArr():Array
[static]
b2Base
  
b2PolygonShape
  
b2PolygonShape
 Inherited
GetType():int
b2Shape
  
GetVertex(i:uint):V2
b2PolygonShape
  
b2PolygonShape
 Inherited
initialize(defs:Boolean = true):void
[static] Initialize the C++ module.
b2Base
  
RayCast(output:*, input:*, transform:XF):Boolean
[override]
b2PolygonShape
 Inherited
readVertices(adr:int, num:int):Vector.<V2>
Read C++ memory and convert it into a vertex array.
b2Base
  
ReverseVertices(v:Vector.<V2>):void
[static]
b2PolygonShape
  
Set(v:Vector.<V2>):void
b2PolygonShape
  
SetAsBox(hx:Number, hy:Number, center:V2 = null, angle:Number = 0):void
b2PolygonShape
  
SetAsEdge(v1:V2, v2:V2):void
b2PolygonShape
  
TestPoint(xf:XF, p:V2):Boolean
[override]
b2PolygonShape
 Inherited
writeVertices(adr:int, v:Vector.<V2>):void
Write a vertex array of the format [new V2(x,y), new V2(x,y), ...] to C++ memory.
b2Base
Public Constants
 ConstantDefined By
 Inheritede_circle : int = 0
[static]
b2Shape
 Inheritede_polygon : int = 1
[static]
b2Shape
 Inheritede_typeCount : int = 2
[static]
b2Shape
 Inheritede_unknown : int = -1
[static]
b2Shape
Property Detail
m_centroidproperty
public var m_centroid:b2Vec2

m_normalsproperty 
m_normals:Vector.<V2>


Implementation
    public function get m_normals():Vector.<V2>
    public function set m_normals(value:Vector.<V2>):void
m_vertexCountproperty 
m_vertexCount:int


Implementation
    public function get m_vertexCount():int
    public function set m_vertexCount(value:int):void
m_verticesproperty 
m_vertices:Vector.<V2>


Implementation
    public function get m_vertices():Vector.<V2>
    public function set m_vertices(value:Vector.<V2>):void
Constructor Detail
b2PolygonShape()Constructor
public function b2PolygonShape(p:int = 0)



Parameters
p:int (default = 0)
Method Detail
CheckVertexDirection()method
public static function CheckVertexDirection(v:Vector.<V2>):Boolean

Parameters

v:Vector.<V2>

Returns
Boolean
ComputeAABB()method 
override public function ComputeAABB(aabb:AABB, xf:XF):void

Parameters

aabb:AABB
 
xf:XF

ComputeCentroid()method 
public static function ComputeCentroid(vs:Vector.<V2>):V2

Parameters

vs:Vector.<V2>

Returns
V2
ComputeMass()method 
override public function ComputeMass(massData:b2MassData, density:Number):void

Parameters

massData:b2MassData
 
density:Number

ComputeSubmergedArea()method 
override public function ComputeSubmergedArea(normal:V2, offset:Number, xf:XF, c:V2):Number

Parameters

normal:V2
 
offset:Number
 
xf:XF
 
c:V2

Returns
Number
Decompose()method 
public static function Decompose(v:Vector.<Number>):Vector.<b2PolygonShape>

Parameters

v:Vector.<Number>

Returns
Vector.<b2PolygonShape>
destroy()method 
override public function destroy():void

Draw()method 
override public function Draw(g:Graphics, xf:XF, scale:Number = 1, options:Object = null):void

Parameters

g:Graphics
 
xf:XF
 
scale:Number (default = 1)
 
options:Object (default = null)

EnsureCorrectVertexDirection()method 
public static function EnsureCorrectVertexDirection(v:Vector.<V2>):Boolean

Parameters

v:Vector.<V2>

Returns
Boolean
GetSupport()method 
public function GetSupport():int

Returns
int
GetSupportVertex()method 
public function GetSupportVertex():int

Returns
int
GetVertex()method 
public function GetVertex(i:uint):V2

Parameters

i:uint

Returns
V2
GetVertexCount()method 
public function GetVertexCount():uint

Returns
uint
RayCast()method 
override public function RayCast(output:*, input:*, transform:XF):Boolean

Parameters

output:*
 
input:*
 
transform:XF

Returns
Boolean
ReverseVertices()method 
public static function ReverseVertices(v:Vector.<V2>):void

Parameters

v:Vector.<V2>

Set()method 
public function Set(v:Vector.<V2>):void

Parameters

v:Vector.<V2>

SetAsBox()method 
public function SetAsBox(hx:Number, hy:Number, center:V2 = null, angle:Number = 0):void

Parameters

hx:Number
 
hy:Number
 
center:V2 (default = null)
 
angle:Number (default = 0)

SetAsEdge()method 
public function SetAsEdge(v1:V2, v2:V2):void

Parameters

v1:V2
 
v2:V2

TestPoint()method 
override public function TestPoint(xf:XF, p:V2):Boolean

Parameters

xf:XF
 
p:V2

Returns
Boolean