org.xith3d.physics.collision.collideable
Class TriMeshCollideable

java.lang.Object
  extended by org.xith3d.physics.collision.CollideableBase
      extended by org.xith3d.physics.collision.collideable.TriMeshCollideable
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, Collideable, Placeable

public abstract class TriMeshCollideable
extends CollideableBase

A triangle mesh collideable.


Constructor Summary
TriMeshCollideable(CollisionEngine eng)
          Creates a new TriMesh from vertex data.
 
Method Summary
 Shape3D getBaseGFX()
          
 Shape3D getDebugGFX()
          
static Appearance getDefaultAppearance()
           
abstract  int getIndex(int i)
           
abstract  int getIndexCount()
           
abstract  int[] getIndices()
           
 java.lang.String getInfo()
          
 java.lang.String getType()
          
abstract  void getVertex(int i, org.openmali.vecmath2.Tuple3f coord)
           
abstract  int getVertexCount()
           
abstract  org.openmali.vecmath2.Point3f[] getVertices()
           
abstract  float[] getVerticesFloats()
           
static void setDefaultAppearance(Appearance app)
           
static void setDefaultAppearance(java.lang.String texture)
           
static void setDefaultAppearance(Texture texture)
           
 
Methods inherited from class org.xith3d.physics.collision.CollideableBase
applyWorldPosition, applyWorldRotation, getBody, getEngine, getName, getParent, getPosition, getPosition, getRotation, getRotation, getRotationMatrix, getRotationMatrix, getUserObject, getWorldPos, getWorldPos, getWorldRot, getWorldRot, getWorldRotMat, getWorldRotMat, recomputeChildrenWorldCoords, recomputeWorldCoords, recomputeWorldPos, recomputeWorldRotMat, setBody, setName, setParent, setPosition, setPosition, setPosition, setPositionX, setPositionY, setPositionZ, setRotation, setRotation, setRotation, setRotationMatrix, setRotationMatrix, setRotationX, setRotationY, setRotationZ, setUserObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xith3d.physics.collision.Collideable
isEnabled, setEnabled
 

Constructor Detail

TriMeshCollideable

public TriMeshCollideable(CollisionEngine eng)
Creates a new TriMesh from vertex data. Three points (referenced by their indices) make a triangle.

Parameters:
eng -
Method Detail

setDefaultAppearance

public static void setDefaultAppearance(Appearance app)

setDefaultAppearance

public static void setDefaultAppearance(Texture texture)

setDefaultAppearance

public static void setDefaultAppearance(java.lang.String texture)

getDefaultAppearance

public static Appearance getDefaultAppearance()

getInfo

public final 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

getType

public final 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")

getBaseGFX

public Shape3D 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:
Collideable.getDebugGFX()

getDebugGFX

public Shape3D 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:
Collideable.getBaseGFX()

getVerticesFloats

public abstract float[] getVerticesFloats()
Returns:
the vertex data with which this TriMesh has been initialized, or null if the init() method hasn't been called yet.

getVertexCount

public abstract int getVertexCount()

getVertex

public abstract void getVertex(int i,
                               org.openmali.vecmath2.Tuple3f coord)

getVertices

public abstract org.openmali.vecmath2.Point3f[] getVertices()
Returns:
the vertex data with which this TriMesh has been initialized, or null if the init() method hasn't been called yet. Note that these vertices are just like a "library of vertices" that are referred by indices. If you wanted the list of vertices that are really detected for collision, you need to loop through the indices array and take the referred vertices.

getIndexCount

public abstract int getIndexCount()
Returns:
the number of vertices

getIndex

public abstract int getIndex(int i)

getIndices

public abstract int[] getIndices()
Returns:
the index data with which this TriMesh has been initialized, or null if the init() method hasn't been called yet.