org.jbox2d.collision.shapes
Class PointShape

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

public class PointShape
extends Shape

Point shape. Like a circle shape of zero radius, except that it has a finite mass.


Field Summary
 Vec2 m_localPosition
           
 float m_mass
           
 
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
PointShape(ShapeDef def)
           
 
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()
           
 float getMass()
           
 Vec2 getMemberLocalPosition()
          This is the member variable for the local position.
 boolean testPoint(XForm xf, Vec2 p)
          Test a point for containment 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_localPosition

public final Vec2 m_localPosition

m_mass

public float m_mass
Constructor Detail

PointShape

public PointShape(ShapeDef def)
Method Detail

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)

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)

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)

testPoint

public boolean testPoint(XForm xf,
                         Vec2 p)
Description copied from class: Shape
Test a point for containment in this shape. This only works for convex shapes.

Specified by:
testPoint in class Shape
Parameters:
xf - 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)

updateSweepRadius

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

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

getLocalPosition

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

getMemberLocalPosition

public Vec2 getMemberLocalPosition()
This is the member variable for the local position. Don't change this.

Returns:

getMass

public float getMass()