org.openmali.spatial.bodies
Class Body
java.lang.Object
org.openmali.spatial.bodies.Body
- All Implemented Interfaces:
- BodyInterface
- Direct Known Subclasses:
- Box, ConvexHull, Sphere
public abstract class Body
- extends java.lang.Object
- implements BodyInterface
Base class for all geometric Bodies.
|
Constructor Summary |
Body()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
centerX
protected float centerX
centerY
protected float centerY
centerZ
protected float centerZ
maxCenterDist
protected float maxCenterDist
maxCenterDistSquared
protected float maxCenterDistSquared
distComputed
protected boolean distComputed
Body
public Body()
setCenter
public void setCenter(float x,
float y,
float z)
- Sets this Bodie's center.
- Parameters:
x - y - z -
setCenter
public final void setCenter(Tuple3f center)
- Sets this Bodie's center.
- Parameters:
x - y - z -
getCenterX
public final float getCenterX()
- Returns:
- the x-coordinate of the center.
getCenterY
public final float getCenterY()
- Returns:
- the y-coordinate of the center.
getCenterZ
public final float getCenterZ()
- Returns:
- the z-coordinate of the center.
getCenter
public final <T extends Tuple3f> T getCenter(T center)
setMaxCenterDistanceSquared
protected void setMaxCenterDistanceSquared(float maxCenterDistSquared)
- Sets the maximum distance to the Bodie's center (squared).
For a sphere this is the (squared) radius.
- Parameters:
maxCenterDistSquared -
getMaxCenterDistanceSquared
public final float getMaxCenterDistanceSquared()
- Returns:
- the maximum distance to the Bodie's center (squared).
For a sphere this is the (squared) radius.
getMaxCenterDistance
public final float getMaxCenterDistance()
- Returns:
- the maximum distance to the Bodie's center.
For a sphere this is the radius.