org.jbox2d.collision.shapes
Class CircleShape

java.lang.Object
  extended by org.jbox2d.collision.shapes.Shape
      extended by org.jbox2d.collision.shapes.CircleShape

public class CircleShape
extends Shape

A circle shape. Create using Body.createShape(ShapeDef) with a CircleDef, not the constructor here.

See Also:
Body.createShape(ShapeDef), CircleDef

Field Summary
 Vec2 m_localPosition
           
 float m_radius
           
 
Fields inherited from class org.jbox2d.collision.shapes.Shape
m_body, m_density, m_filter, m_friction, m_isSensor, m_next, m_proxyId, m_restitution, m_sweepRadius, m_type, m_userData, uid
 
Constructor Summary
CircleShape(ShapeDef def)
          this is used internally, instead use Body.createShape(ShapeDef) with a CircleDef
 
Method Summary
 void computeAABB(AABB aabb, XForm transform)
          Given a transform, compute the associated axis aligned bounding box for this shape.
 void computeMass(MassData massData)
          Compute the mass properties of this shape using its dimensions and density.
 void computeSweptAABB(AABB aabb, XForm transform1, XForm transform2)
          Given two transforms, compute the associated swept axis aligned bounding box for this shape.
 Vec2 getLocalPosition()
          Returns a copy of the local position
 Vec2 getMemberLocalPosition()
          Returns the member variable of the local position.
 float getRadius()
           
 boolean testPoint(XForm transform, Vec2 p)
          checks to see if the point is in this shape.
 void updateSweepRadius(Vec2 center)
          Internal
 
Methods inherited from class org.jbox2d.collision.shapes.Shape
create, createProxy, destroy, destroyProxy, destructor, getBody, getFilterData, getFriction, getNext, getRestitution, getSweepRadius, getType, getUserData, isSensor, refilterProxy, setFilterData, setFriction, setRestitution, setUserData, synchronize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_radius

public float m_radius

m_localPosition

public final Vec2 m_localPosition
Constructor Detail

CircleShape

public CircleShape(ShapeDef def)
this is used internally, instead use Body.createShape(ShapeDef) with a CircleDef

Parameters:
def -
See Also:
Body.createShape(ShapeDef), CircleDef
Method Detail

updateSweepRadius

public void updateSweepRadius(Vec2 center)
Description copied from class: Shape
Internal

Specified by:
updateSweepRadius in class Shape
See Also:
Shape.updateSweepRadius(Vec2)

testPoint

public boolean testPoint(XForm transform,
                         Vec2 p)
checks to see if the point is in this shape.

Specified by:
testPoint in class Shape
Parameters:
transform - the shape world transform.
p - a point in world coordinates.
Returns:
true if the point is within the shape
See Also:
Shape.testPoint(XForm, Vec2)

computeAABB

public void computeAABB(AABB aabb,
                        XForm transform)
Description copied from class: Shape
Given a transform, compute the associated axis aligned bounding box for this shape.

Specified by:
computeAABB in class Shape
Parameters:
aabb - returns the axis aligned box.
transform - the world transform of the shape.
See Also:
Shape.computeAABB(AABB, XForm)

computeSweptAABB

public void computeSweptAABB(AABB aabb,
                             XForm transform1,
                             XForm transform2)
Description copied from class: Shape
Given two transforms, compute the associated swept axis aligned bounding box for this shape.

Specified by:
computeSweptAABB in class Shape
Parameters:
aabb - returns the axis aligned box. (return parameter)
transform1 - the starting shape world transform.
transform2 - the ending shape world transform.
See Also:
Shape.computeSweptAABB(AABB, XForm, XForm)

computeMass

public void computeMass(MassData massData)
Description copied from class: Shape
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.

Specified by:
computeMass in class Shape
Parameters:
massData - returns the mass data for this shape. (return parameter)
See Also:
Shape.computeMass(MassData)

getRadius

public float getRadius()

getLocalPosition

public Vec2 getLocalPosition()
Returns a copy of the local position

Returns:

getMemberLocalPosition

public Vec2 getMemberLocalPosition()
Returns the member variable of the local position. Don't change this.

Returns: