Package | Box2D.Collision.Shapes |
Class | public class b2CircleShape |
Inheritance | b2CircleShape b2Shape |
Source | b2CircleShape.as |
See also
Method | Defined by | ||
---|---|---|---|
Given a transform, compute the associated axis aligned bounding box for this shape.
| b2CircleShape | ||
ComputeMass(massData:b2MassData):void
Compute the mass properties of this shape using its dimensions and density.
| b2CircleShape | ||
Given two transforms, compute the associated swept axis aligned bounding box for this shape.
| b2CircleShape | ||
Get the parent body of this shape.
| b2Shape | ||
Get the contact filtering data.
| b2Shape | ||
GetFriction():Number
Get the coefficient of friction.
| b2Shape | ||
Get the local position of this circle in its parent body.
| b2CircleShape | ||
Get the next shape in the parent body's shape list.
| b2Shape | ||
GetRadius():Number
Get the radius of this circle.
| b2CircleShape | ||
GetRestitution():Number
Get the coefficient of restitution.
| b2Shape | ||
GetSweepRadius():Number
Get the maximum radius about the parent body's center of mass.
| b2Shape | ||
GetType():int
Get the type of this shape.
| b2Shape | ||
GetUserData():*
Get the user data that was assigned in the shape definition.
| b2Shape | ||
IsSensor():Boolean
Is this shape a sensor (non-solid)?
| b2Shape | ||
SetFilterData(filter:b2FilterData):void
Set the contact filtering data.
| b2Shape | ||
SetFriction(friction:Number):void
Set the coefficient of friction.
| b2Shape | ||
SetRestitution(restitution:Number):void
Set the coefficient of restitution.
| b2Shape | ||
SetUserData(data:*):void
Set the user data.
| b2Shape | ||
Test a point for containment in this shape.
| b2CircleShape | ||
TestSegment(transform:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):int
Perform a ray cast against this shape.
| b2CircleShape |
ComputeAABB | () | method |
public override function ComputeAABB(aabb:b2AABB, transform:b2XForm):void
Given a transform, compute the associated axis aligned bounding box for this shape.
Parametersaabb:b2AABB — returns the axis aligned box.
|
|
transform:b2XForm — the world transform of the shape.
|
ComputeMass | () | method |
public override function ComputeMass(massData:b2MassData):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.
ParametersmassData:b2MassData — returns the mass data for this shape.
|
ComputeSweptAABB | () | method |
public override function ComputeSweptAABB(aabb:b2AABB, transform1:b2XForm, transform2:b2XForm):void
Given two transforms, compute the associated swept axis aligned bounding box for this shape.
Parametersaabb:b2AABB — returns the axis aligned box.
|
|
transform1:b2XForm — the starting shape world transform.
|
|
transform2:b2XForm — the ending shape world transform.
|
GetLocalPosition | () | method |
public function GetLocalPosition():b2Vec2
Get the local position of this circle in its parent body.
Returnsb2Vec2 |
GetRadius | () | method |
public function GetRadius():Number
Get the radius of this circle.
ReturnsNumber |
TestPoint | () | method |
public override function TestPoint(transform:b2XForm, p:b2Vec2):Boolean
Test a point for containment in this shape. This only works for convex shapes.
Parameterstransform:b2XForm — the shape world transform.
|
|
p:b2Vec2 — a point in world coordinates.
|
Boolean |
TestSegment | () | method |
public override function TestSegment(transform:b2XForm, lambda:Array, normal:b2Vec2, segment:b2Segment, maxLambda:Number):int
Perform a ray cast against this shape.
Parameterstransform:b2XForm — the shape world transform.
|
|
lambda:Array — returns the hit fraction. You can use this to compute the contact point:
p = (1 - lambda) segment.p1 + lambda segment.p2.
lambda should be an array with one member. After calling TestSegment, you can retrieve the output value with
lambda[0].
|
|
normal:b2Vec2 — returns the normal at the contact point. If there is no intersection, the normal
is not set.
|
|
segment:b2Segment — defines the begin and end point of the ray cast.
|
|
maxLambda:Number — a number typically in the range [0,1].
|
int — b2Shape.e_hitCollide if there was an intersection, b2Shape.e_startsInsideCollide if the point is inside and b2Shape.e_missCollide otherwise.
|