org.xith3d.physics.collision
Interface Collideable

All Superinterfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, Placeable
All Known Subinterfaces:
CollideableGroup
All Known Implementing Classes:
BoxCollideable, CapsuleCollideable, CollideableBase, CollideableGroupBase, CylinderCollideable, PlaneCollideable, RayCollideable, SphereCollideable, TriMeshCollideable

public interface Collideable
extends Placeable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.Enableable

A Collideable is an object, which can collide with others objects.

See Also:
CollisionEngine

Method Summary
 Node getBaseGFX()
           
 Body getBody()
           
 Node getDebugGFX()
           
 CollisionEngine getEngine()
           
 java.lang.String getInfo()
           
 CollideableGroup getParent()
          Gets the parent of this Collideable, or null if it has no parent.
 org.openmali.vecmath2.Point3f getPosition()
           
 void getPosition(org.openmali.vecmath2.Tuple3f pos)
          Writes the position of this Placeable object to the given Tuple3f, in Local coordinates (e.g. without pos/rot of parents taken into account).
 org.openmali.vecmath2.Tuple3f getRotation()
           
 void getRotation(org.openmali.vecmath2.Tuple3f rot)
          Writes the rotation (local coordinates), in Euler angles (degrees) of this Placeable object in the given Tuple3f.
 org.openmali.vecmath2.Matrix3f getRotationMatrix()
           
 void getRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
          Writes the rotation, as a 3x3 rotation Matrix, of this Placeable object in the given Matrix3f.
 java.lang.String getType()
           
 java.lang.Object getUserObject()
           
 org.openmali.vecmath2.Point3f getWorldPos()
          Gets position, in world coordinates, which means, taking into account all transformations from parents, and all.
 void getWorldPos(org.openmali.vecmath2.Tuple3f pos)
          Writes position to pos, in world coordinates, which means, taking into account all transformations from parents, and all.
 org.openmali.vecmath2.Tuple3f getWorldRot()
          Gets rotation, in world coordinates, which means, taking into account all transformations from parents, and all.
 void getWorldRot(org.openmali.vecmath2.Tuple3f rot)
          Writes rotation to rot, in world coordinates, which means, taking into account all transformations from parents, and all.
 org.openmali.vecmath2.Matrix3f getWorldRotMat()
          Gets rotation, in world coordinates, which means, taking into account all transformations from parents, and all.
 void getWorldRotMat(org.openmali.vecmath2.Matrix3f rot)
          Writes rotation to rot, in world coordinates, which means, taking into account all transformations from parents, and all.
 boolean isEnabled()
           
 void recomputeChildrenWorldCoords(boolean applyToImplementation)
          Recompute the world coordinates of all children, if and only if this JoodeCollideable is a space.
 void recomputeWorldCoords(boolean childrenToo, boolean applyToImplementation)
          Recompute world coordinates, e.g. world position and rotation.
 void setBody(Body body)
          Sets the Body, this Collideable is attached to.
 void setEnabled(boolean enabled)
          Enables or disables this Collideable.
 void setPosition(float posX, float posY, float posZ)
          Sets the position, in local coordinates of this Placeable object.
 void setPosition(org.openmali.vecmath2.Tuple3f pos)
          Sets the position, in local coordinates of this Placeable object To get world coordinates, getWorldPos().
 void setPositionX(float x)
          Sets the X position (in local coordinates) of this Collideable
 void setPositionY(float y)
          Sets the Y position (in local coordinates) of this Collideable
 void setPositionZ(float z)
          Sets the Z position (in local coordinates) of this Collideable
 void setRotation(float rotX, float rotY, float rotZ)
          Sets the rotation (in local coordinates) of this Collideable, local coordinates.
 void setRotation(org.openmali.vecmath2.Tuple3f rot)
          Sets the rotation of this object, in Euler angles (degrees), local coordinates.
 void setRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
          Sets the rotation Matrix of this object, local coordinates.
 void setRotationX(float x)
          Sets the X rotation (in local coordinates) of this Collideable
 void setRotationY(float y)
          Sets the Y rotation (in local coordinates) of this Collideable
 void setRotationZ(float z)
          Sets the Z rotation (in local coordinates) of this Collideable
 void setUserObject(java.lang.Object userObject)
          Sets this Collideable's user-object.
 
Methods inherited from interface org.jagatoo.datatypes.NamableObject
setName
 
Methods inherited from interface org.jagatoo.datatypes.NamedObject
getName
 

Method Detail

getType

java.lang.String getType()
Returns:
the name of the Geom, that is, the one which is used to refer to it in CollisionEngine. All camel-case, please ! (e.g. : "Sphere")

getInfo

java.lang.String getInfo()
Returns:
a small description of how is this geom, its exact shape, a brief human-readable description of what can be adjusted

getEngine

CollisionEngine getEngine()
Returns:
the collision engine of this Collideable

getBaseGFX

Node getBaseGFX()
Returns:
a "base" GFX (can be used as a start, then the users adjusts himself e.g. the Material or even apply a deformation to the Shape) The only *rule* for this object is that it should extend org.xith3d.scenegraph.Node so that it can be added to the scenegraph. So it can be e.g. a Shape3D, a Group
See Also:
getDebugGFX()

getDebugGFX

Node getDebugGFX()
Returns:
a "debug" GFX (probably wireframe, and maybe bounds displayed, and so on) The only *rule* for this object is that it should extend org.xith3d.scenegraph.Node so that it can be added to the scenegraph. So it can be e.g. a Shape3D, a Group
See Also:
getBaseGFX()

getParent

CollideableGroup getParent()
Gets the parent of this Collideable, or null if it has no parent.

Returns:
The parent, or null

setBody

void setBody(Body body)
Sets the Body, this Collideable is attached to.

Parameters:
body -

getBody

Body getBody()
Returns:
the Body, this Collideable is attached to.

setUserObject

void setUserObject(java.lang.Object userObject)
Sets this Collideable's user-object.

Parameters:
userObject -

getUserObject

java.lang.Object getUserObject()
Returns:
this Collideable's user-object.

setEnabled

void setEnabled(boolean enabled)
Enables or disables this Collideable.

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable
Parameters:
enabled -

isEnabled

boolean isEnabled()
Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable
Returns:
true, if this Collideable is enabled.

getPosition

org.openmali.vecmath2.Point3f getPosition()
Specified by:
getPosition in interface Placeable
Returns:
The position of this Collideable, in Local coordinates, (e.g. without pos/rot of parents taken into account). To get World coordinates,
See Also:
getWorldPos()

getPosition

void getPosition(org.openmali.vecmath2.Tuple3f pos)
Writes the position of this Placeable object to the given Tuple3f, in Local coordinates (e.g. without pos/rot of parents taken into account). To get World coordinates, getWorldPos().

Specified by:
getPosition in interface Placeable
Parameters:
pos - The Tuple3f to put the pos into

setPosition

void setPosition(org.openmali.vecmath2.Tuple3f pos)
Sets the position, in local coordinates of this Placeable object To get world coordinates, getWorldPos().

Specified by:
setPosition in interface Placeable
Parameters:
pos -

setPosition

void setPosition(float posX,
                 float posY,
                 float posZ)
Sets the position, in local coordinates of this Placeable object. to get world coordinates getWorldPos().

Specified by:
setPosition in interface Placeable

getRotation

org.openmali.vecmath2.Tuple3f getRotation()
Specified by:
getRotation in interface Placeable
Returns:
The rotation (local coordinates), in Euler angles (degrees) of this Placeable object To get rotation in World coordinates, getWorldRot().

getRotation

void getRotation(org.openmali.vecmath2.Tuple3f rot)
Writes the rotation (local coordinates), in Euler angles (degrees) of this Placeable object in the given Tuple3f. To get rotation in World coordinates, getWorldRot()

Specified by:
getRotation in interface Placeable

getRotationMatrix

org.openmali.vecmath2.Matrix3f getRotationMatrix()
Specified by:
getRotationMatrix in interface Placeable
Returns:
The rotation (local coordinates), as a 3x3 rotation Matrix, of this Placeable object. To get rotation matrix in World coordinates, getWorldRotMat().

getRotationMatrix

void getRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
Writes the rotation, as a 3x3 rotation Matrix, of this Placeable object in the given Matrix3f. To get rotation matrix in World coordinates, getWorldRotMat().

Specified by:
getRotationMatrix in interface Placeable

setRotation

void setRotation(org.openmali.vecmath2.Tuple3f rot)
Sets the rotation of this object, in Euler angles (degrees), local coordinates.

Specified by:
setRotation in interface Placeable
Parameters:
rot - The rotation, in Euler angles (degrees) of this Placeable object

setRotationMatrix

void setRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
Sets the rotation Matrix of this object, local coordinates.

Specified by:
setRotationMatrix in interface Placeable
Parameters:
rot - The rotation, as a 3x3 rotation Matrix, of this Placeable object

setRotation

void setRotation(float rotX,
                 float rotY,
                 float rotZ)
Sets the rotation (in local coordinates) of this Collideable, local coordinates.

Specified by:
setRotation in interface Placeable
Parameters:
rotX - The x-rotation of the Collideable
rotY - The y-rotation of the Collideable
rotZ - The z-rotation of the Collideable

setPositionX

void setPositionX(float x)
Sets the X position (in local coordinates) of this Collideable

Parameters:
x -

setPositionY

void setPositionY(float y)
Sets the Y position (in local coordinates) of this Collideable

Parameters:
y -

setPositionZ

void setPositionZ(float z)
Sets the Z position (in local coordinates) of this Collideable

Parameters:
z -

setRotationX

void setRotationX(float x)
Sets the X rotation (in local coordinates) of this Collideable

Parameters:
x -

setRotationY

void setRotationY(float y)
Sets the Y rotation (in local coordinates) of this Collideable

Parameters:
y -

setRotationZ

void setRotationZ(float z)
Sets the Z rotation (in local coordinates) of this Collideable

Parameters:
z -

getWorldPos

org.openmali.vecmath2.Point3f getWorldPos()
Gets position, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Returns:
The world coordinates position.

getWorldPos

void getWorldPos(org.openmali.vecmath2.Tuple3f pos)
Writes position to pos, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Parameters:
pos - The Tuple3f to write in.

getWorldRot

org.openmali.vecmath2.Tuple3f getWorldRot()
Gets rotation, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Returns:
The world coordinates position.

getWorldRot

void getWorldRot(org.openmali.vecmath2.Tuple3f rot)
Writes rotation to rot, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Parameters:
rot -

getWorldRotMat

org.openmali.vecmath2.Matrix3f getWorldRotMat()
Gets rotation, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Returns:
The world coordinates position.

getWorldRotMat

void getWorldRotMat(org.openmali.vecmath2.Matrix3f rot)
Writes rotation to rot, in world coordinates, which means, taking into account all transformations from parents, and all. Correct implementation of this method is up to the Physic Engine's developers, but it should be pretty easy anyway. Order of transformation is Translate, then Rotate. There is no scale.

Parameters:
rot -

recomputeChildrenWorldCoords

void recomputeChildrenWorldCoords(boolean applyToImplementation)
Recompute the world coordinates of all children, if and only if this JoodeCollideable is a space.

Parameters:
applyToImplementation -

recomputeWorldCoords

void recomputeWorldCoords(boolean childrenToo,
                          boolean applyToImplementation)
Recompute world coordinates, e.g. world position and rotation. This method should be called whenever a parent changes its local position/rotation on all its children.

Parameters:
childrenToo -
applyToImplementation -