PackageBox2D.Collision.Shapes
Classpublic class b2CircleShape
Inheritanceb2CircleShape Inheritance b2Shape
Sourceb2CircleShape.as

A circle shape.

See also

b2CircleDef


Public Methods
 MethodDefined by
  
b2CircleShape(radius:Number = 0)
b2CircleShape
  
ComputeAABB(aabb:b2AABB, transform:b2Transform):void
Given a transform, compute the associated axis aligned bounding box for this shape.
b2CircleShape
  
ComputeMass(massData:b2MassData, density:Number):void
Compute the mass properties of this shape using its dimensions and density.
b2CircleShape
  
ComputeSubmergedArea(normal:b2Vec2, offset:Number, xf:b2Transform, c:b2Vec2):Number
Compute the volume and centroid of this shape intersected with a half plane
b2CircleShape
  
b2CircleShape
  
Get the local position of this circle in its parent body.
b2CircleShape
  
GetRadius():Number
Get the radius of the circle
b2CircleShape
 Inherited
GetType():int
Get the type of this shape.
b2Shape
  
RayCast(output:b2RayCastOutput, input:b2RayCastInput, transform:b2Transform):Boolean
Cast a ray against this shape.
b2CircleShape
  
Set(other:b2Shape):void
b2CircleShape
  
SetLocalPosition(position:b2Vec2):void
Set the local position of this circle in its parent body.
b2CircleShape
  
SetRadius(radius:Number):void
Set the radius of the circle
b2CircleShape
 Inherited
TestOverlap(shape1:b2Shape, transform1:b2Transform, shape2:b2Shape, transform2:b2Transform):Boolean
[static]
b2Shape
  
TestPoint(transform:b2Transform, p:b2Vec2):Boolean
Test a point for containment in this shape.
b2CircleShape
Public Constants
 ConstantDefined by
 Inheritede_hitCollide : int = 1
[static] Possible return values for TestSegment
b2Shape
 Inheritede_missCollide : int = 0
[static] Return value for TestSegment indicating a miss.
b2Shape
 Inheritede_startsInsideCollide : int = -1
[static] Return value for TestSegment indicating that the segment starting point, p1, is already inside the shape.
b2Shape
Constructor detail
b2CircleShape()constructor
public function b2CircleShape(radius:Number = 0)Parameters
radius:Number (default = 0)
Method detail
ComputeAABB()method
public override function ComputeAABB(aabb:b2AABB, transform:b2Transform):void

Given a transform, compute the associated axis aligned bounding box for this shape.

Parameters
aabb:b2AABB — returns the axis aligned box.
 
transform:b2Transform — the world transform of the shape.
ComputeMass()method 
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
ComputeSubmergedArea()method 
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
Copy()method 
public override function Copy():b2Shape

Returns
b2Shape
GetLocalPosition()method 
public function GetLocalPosition():b2Vec2

Get the local position of this circle in its parent body.

Returns
b2Vec2
GetRadius()method 
public function GetRadius():Number

Get the radius of the circle

Returns
Number
RayCast()method 
public override function RayCast(output:b2RayCastOutput, input:b2RayCastInput, transform:b2Transform):Boolean

Cast a ray against this shape.

Parameters
output:b2RayCastOutput — the ray-cast results.
 
input:b2RayCastInput — the ray-cast input parameters.
 
transform:b2Transform — the transform to be applied to the shape.

Returns
Boolean
Set()method 
public override function Set(other:b2Shape):voidParameters
other:b2Shape
SetLocalPosition()method 
public function SetLocalPosition(position:b2Vec2):void

Set the local position of this circle in its parent body.

Parameters
position:b2Vec2
SetRadius()method 
public function SetRadius(radius:Number):void

Set the radius of the circle

Parameters
radius:Number
TestPoint()method 
public override function TestPoint(transform:b2Transform, p:b2Vec2):Boolean

Test a point for containment in this shape. This only works for convex shapes.

Parameters
transform:b2Transform — the shape world transform.
 
p:b2Vec2 — a point in world coordinates.

Returns
Boolean