Convex polygon. The vertices must be in CCW order for a right-handed
coordinate system with the z-axis coming out of the screen.
b2PolygonDef
public static function AsArray(vertices:Array, vertexCount:Number):b2PolygonShape
Parameters
| vertices:Array |
|
| vertexCount:Number |
Returns
public static function AsBox(hx:Number, hy:Number):b2PolygonShape
Parameters
Returns
public static function AsEdge(v1:b2Vec2, v2:b2Vec2):b2PolygonShape
Set this as a single edge.
Parameters
Returns
public static function AsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):b2PolygonShape
Parameters
| hx:Number |
|
| hy:Number |
|
| center:b2Vec2 (default = null )
|
|
| angle:Number (default = 0.0 )
|
Returns
public static function AsVector(vertices:Vector, vertexCount:Number):b2PolygonShape
Parameters
| vertices:Vector |
|
| vertexCount:Number |
Returns
public override function ComputeAABB(aabb:b2AABB, xf:b2Transform):void
Given a transform, compute the associated axis aligned bounding box for this shape.
Parameters
| aabb:b2AABB — returns the axis aligned box.
|
|
| xf:b2Transform — the world transform of the shape.
|
public static function ComputeCentroid(vs:Vector, count:uint):b2Vec2
Computes the centroid of the given polygon
Parameters
| vs:Vector — vector of b2Vec specifying a polygon
|
|
| count:uint — length of vs
|
Returns
public override function ComputeMass(massData:b2MassData, density:Number):void
Compute the mass properties of this shape using its dimensions and density.
The inertia tensor is computed about the local origin, not the centroid.
Parameters
| massData:b2MassData — returns the mass data for this shape.
|
|
| density:Number |
public override function ComputeSubmergedArea(normal:b2Vec2, offset:Number, xf:b2Transform, c:b2Vec2):Number
Compute the volume and centroid of this shape intersected with a half plane
Parameters
| normal:b2Vec2 — the surface normal
|
|
| offset:Number — the surface offset along normal
|
|
| xf:b2Transform — the shape transform
|
|
| c:b2Vec2 — returns the centroid
|
Returns
| Number — the total volume less than offset along normal
|
public override function Copy():b2Shape
Returns
public function GetNormals():Vector
Get the edge normal vectors. There is one for each vertex.
Returns
public function GetSupport(d:b2Vec2):int
Get the supporting vertex index in the given direction.
Parameters
Returns
public function GetSupportVertex(d:b2Vec2):b2Vec2
Parameters
Returns
public function GetVertexCount():int
Get the vertex count.
Returns
public function GetVertices():Vector
Get the vertices in local coordinates.
Returns
public override function RayCast(output:b2RayCastOutput, input:b2RayCastInput, transform:b2Transform):Boolean
Cast a ray against this shape.
Parameters
Returns
public override function Set(other:b2Shape):void
Parameters
public function SetAsArray(vertices:Array, vertexCount:Number = 0):void
Copy vertices. This assumes the vertices define a convex polygon.
It is assumed that the exterior is the the right of each edge.
Parameters
| vertices:Array |
|
| vertexCount:Number (default = 0 )
|
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.
|
public function SetAsEdge(v1:b2Vec2, v2:b2Vec2):void
Set this as a single edge.
Parameters
public function SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):void
Parameters
| hx:Number |
|
| hy:Number |
|
| center:b2Vec2 (default = null )
|
|
| angle:Number (default = 0.0 )
|
public function SetAsVector(vertices:Vector, vertexCount:Number = 0):void
Copy vertices. This assumes the vertices define a convex polygon.
It is assumed that the exterior is the the right of each edge.
Parameters
| vertices:Vector |
|
| vertexCount:Number (default = 0 )
|
public override function TestPoint(xf:b2Transform, p:b2Vec2):Boolean
Test a point for containment in this shape. This only works for convex shapes.
Parameters
Returns
Box2DFlash 2.1a