|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbox2d.collision.shapes.Shape
public abstract class Shape
A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in World are created automatically when a Fixture is created. Shapes may encapsulate a one or more child shapes.
| Field Summary | |
|---|---|
float |
m_radius
|
ShapeType |
m_type
|
| Constructor Summary | |
|---|---|
Shape()
|
|
| Method Summary | |
|---|---|
abstract Shape |
clone()
|
abstract void |
computeAABB(AABB argAabb,
Transform argXf)
Given a transform, compute the associated axis aligned bounding box for a child shape. |
abstract void |
computeMass(MassData massData,
float density)
Compute the mass properties of this shape using its dimensions and density. |
ShapeType |
getType()
Get the type of this shape. |
abstract boolean |
raycast(RayCastOutput argOutput,
RayCastInput argInput,
Transform argTransform)
Cast a ray against a child shape. |
abstract boolean |
testPoint(Transform xf,
Vec2 p)
Test a point for containment in this shape. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public ShapeType m_type
public float m_radius
| Constructor Detail |
|---|
public Shape()
| Method Detail |
|---|
public ShapeType getType()
public abstract boolean testPoint(Transform xf,
Vec2 p)
xf - the shape world transform.p - a point in world coordinates.
public abstract boolean raycast(RayCastOutput argOutput,
RayCastInput argInput,
Transform argTransform)
argOutput - the ray-cast results.argInput - the ray-cast input parameters.argTransform - the transform to be applied to the shape.argChildIndex - the child shape index
public abstract void computeAABB(AABB argAabb,
Transform argXf)
argAabb - returns the axis aligned box.argXf - the world transform of the shape.
public abstract void computeMass(MassData massData,
float density)
massData - returns the mass data for this shape.density - the density in kilograms per meter squared.public abstract Shape clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||