A shape is used for collision detection. Shapes are created in b2Body.
You can use shape for collision detection before they are attached to the world.
Warning: you cannot reuse shapes.
public 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 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 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 function Copy():b2Shape
Clone the shape
Returns
public function GetType():int
Get the type of this shape. You can use this to down cast to the concrete shape.
Returns
public function RayCast(output:b2RayCastOutput, input:b2RayCastInput, transform:b2Transform):Boolean
Cast a ray against this shape.
Parameters
Returns
public function Set(other:b2Shape):void
Assign the properties of anther shape to this
Parameters
public static function TestOverlap(shape1:b2Shape, transform1:b2Transform, shape2:b2Shape, transform2:b2Transform):BooleanParameters
Returns
public function TestPoint(xf:b2Transform, p:b2Vec2):Boolean
Test a point for containment in this shape. This only works for convex shapes.
Parameters
Returns
public static const e_hitCollide:int = 1
Possible return values for TestSegment
public static const e_missCollide:int = 0 Return value for TestSegment indicating a miss.
public static const e_startsInsideCollide:int = -1 Return value for TestSegment indicating that the segment starting point, p1, is already inside the shape.
Box2DFlash 2.1a