PackageBox2D.Collision.Shapes
Classpublic class b2PolygonShape
Inheritanceb2PolygonShape Inheritance b2Shape

Convex polygon. The vertices must be in CCW order for a right-handed coordinate system with the z-axis coming out of the screen.



Public Methods
 MethodDefined by
  
b2PolygonShape
  
Get the centroid and apply the supplied transform.
b2PolygonShape
  
ComputeAABB(aabb:b2AABB, xf:b2XForm):void
b2PolygonShape
  
ComputeCentroid(vs:Array, count:int):b2Vec2
[static]
b2PolygonShape
  
ComputeMass(massData:b2MassData):void
b2PolygonShape
  
ComputeOBB(obb:b2OBB, vs:Array, count:int):void
[static] http://www.geometrictools.com/Documentation/MinimumAreaRectangle.pdf
b2PolygonShape
  
ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void
b2PolygonShape
 Inherited
Create(def:b2ShapeDef, allocator:*):b2Shape
[static]
b2Shape
 Inherited
CreateProxy(broadPhase:b2BroadPhase, transform:b2XForm):void
b2Shape
 Inherited
Destroy(shape:b2Shape, allocator:*):void
[static]
b2Shape
 Inherited
DestroyProxy(broadPhase:b2BroadPhase):void
b2Shape
 Inherited
Get the parent body of this shape.
b2Shape
  
Get local centroid relative to the parent body.
b2PolygonShape
  
Get the core vertices in local coordinates.
b2PolygonShape
 Inherited
Get the contact filtering data.
b2Shape
  
Get the first vertex and apply the supplied transform.
b2PolygonShape
 Inherited
GetFriction():Number
Get the coefficient of friction.
b2Shape
 Inherited
Get the next shape in the parent body's shape list.
b2Shape
  
GetNormals():Array
Get the edge normal vectors.
b2PolygonShape
  
Get the oriented bounding box relative to the parent body.
b2PolygonShape
 Inherited
GetRestitution():Number
Get the coefficient of restitution.
b2Shape
 Inherited
GetSweepRadius():Number
Get the maximum radius about the parent body's center of mass.
b2Shape
 Inherited
GetType():int
Get the type of this shape.
b2Shape
 Inherited
Get the user data that was assigned in the shape definition.
b2Shape
  
Get the vertex count.
b2PolygonShape
  
GetVertices():Array
Get the vertices in local coordinates.
b2PolygonShape
 Inherited
IsSensor():Boolean
Is this shape a sensor (non-solid)?
b2Shape
 Inherited
RefilterProxy(broadPhase:b2BroadPhase, transform:b2XForm):void
b2Shape
 Inherited
Set the contact filtering data.
b2Shape
 Inherited
SetUserData(data:*):void
Set the user data.
b2Shape
  
Support(xf:b2XForm, dX:Number, dY:Number):b2Vec2
b2PolygonShape
 Inherited
Synchronize(broadPhase:b2BroadPhase, transform1:b2XForm, transform2:b2XForm):Boolean
b2Shape
  
TestPoint(xf:b2XForm, p:b2Vec2):Boolean
b2PolygonShape
  
TestSegment(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean
b2PolygonShape
  
b2PolygonShape
Public Constants
 ConstantDefined by
 Inheritede_circleShape : int = 0
[static]
b2Shape
 Inheritede_polygonShape : int = 1
[static]
b2Shape
 Inheritede_shapeTypeCount : int = 2
[static]
b2Shape
 Inheritede_unknownShape : int = -1
[static]
b2Shape
Property detail
m_centroidproperty
b2internal var m_centroid:b2Vec2
m_normalsproperty 
b2internal var m_normals:Array
m_vertexCountproperty 
b2internal var m_vertexCount:int
m_verticesproperty 
b2internal var m_vertices:Array
Constructor detail
b2PolygonShape()constructor
public function b2PolygonShape(def:b2ShapeDef)Parameters
def:b2ShapeDef
Method detail
Centroid()method
public function Centroid(xf:b2XForm):b2Vec2

Get the centroid and apply the supplied transform.

Parameters
xf:b2XForm

Returns
b2Vec2
ComputeAABB()method 
public override function ComputeAABB(aabb:b2AABB, xf:b2XForm):voidParameters
aabb:b2AABB
 
xf:b2XForm
ComputeCentroid()method 
public static function ComputeCentroid(vs:Array, count:int):b2Vec2Parameters
vs:Array
 
count:int

Returns
b2Vec2
ComputeMass()method 
public override function ComputeMass(massData:b2MassData):void

Parameters
massData:b2MassData

See also

b2Shape::ComputeMass
ComputeOBB()method 
public static function ComputeOBB(obb:b2OBB, vs:Array, count:int):void

http://www.geometrictools.com/Documentation/MinimumAreaRectangle.pdf

Parameters
obb:b2OBB
 
vs:Array
 
count:int
ComputeSweptAABB()method 
public override function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):voidParameters
aabb:b2AABB
 
transform1:b2XForm
 
transform2:b2XForm
GetCentroid()method 
public function GetCentroid():b2Vec2

Get local centroid relative to the parent body.

Returns
b2Vec2
GetCoreVertices()method 
public function GetCoreVertices():Array

Get the core vertices in local coordinates. These vertices represent a smaller polygon that is used for time of impact computations.

Returns
Array
GetFirstVertex()method 
public function GetFirstVertex(xf:b2XForm):b2Vec2

Get the first vertex and apply the supplied transform.

Parameters
xf:b2XForm

Returns
b2Vec2
GetNormals()method 
public function GetNormals():Array

Get the edge normal vectors. There is one for each vertex.

Returns
Array
GetOBB()method 
public function GetOBB():b2OBB

Get the oriented bounding box relative to the parent body.

Returns
b2OBB
GetVertexCount()method 
public function GetVertexCount():int

Get the vertex count.

Returns
int
GetVertices()method 
public function GetVertices():Array

Get the vertices in local coordinates.

Returns
Array
Support()method 
public function Support(xf:b2XForm, dX:Number, dY:Number):b2Vec2Parameters
xf:b2XForm
 
dX:Number
 
dY:Number

Returns
b2Vec2
TestPoint()method 
public override function TestPoint(xf:b2XForm, p:b2Vec2):Boolean

Parameters
xf:b2XForm
 
p:b2Vec2

Returns
Boolean

See also

b2Shape::TestPoint
TestSegment()method 
public override function TestSegment(xf:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):Boolean

Parameters
xf:b2XForm
 
lambda:Array
 
normal:b2Vec2
 
segment:b2Segment
 
maxLambda:Number

Returns
Boolean

See also

b2Shape::TestSegment
UpdateSweepRadius()method 
public override function UpdateSweepRadius(center:b2Vec2):voidParameters
center:b2Vec2