|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.physics.collision.CollisionEngine
public abstract class CollisionEngine
A Collision Engine. The base implementation is the JOODE one, but any engine
can be implemented... even your own one ! Put your imagination at work !
A Collision Engine is in charge of : creating every CollideableGroup or
Collideable,
Many thanks to the ODE Team for design ideas..
| Nested Class Summary | |
|---|---|
class |
CollisionEngine.NotImplementedYetError
Error thrown when the user tries to create a Collideable which type hasn't been implemented in the engine he uses. |
| Constructor Summary | |
|---|---|
CollisionEngine()
|
|
| Method Summary | |
|---|---|
void |
addCollisionCheck(CollisionCheck cc)
Adds a CollisionCheck to the list, that is handled each frame. |
java.util.ArrayList<Collision> |
checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic)
Checks two Collideables (or collideable groups) for collision (n x m collision check) |
abstract int |
checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic,
java.util.ArrayList<Collision> collisions)
Checks two Collideables (or collideable groups) for collision (n x m collision check) |
abstract int |
checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic,
CollisionListener listener)
Checks two Collideables (or collideable groups) for collision (n x m collision check) The listener is notified of any collision. |
java.util.ArrayList<Collision> |
checkCollisions(CollideableGroup group,
boolean ignoreStatic)
Does an n x n collision check for all Collideables in the Group. |
abstract int |
checkCollisions(CollideableGroup group,
boolean ignoreStatic,
java.util.ArrayList<Collision> collisions)
Does an n x n collision check for all Collideables in the Group. |
abstract int |
checkCollisions(CollideableGroup group,
boolean ignoreStatic,
CollisionListener listener)
Does an n x n collision check for all Collideables in the Group. |
CollisionListener |
getDefaultCollisionListener()
|
abstract java.util.List<CollideableGroupType> |
getGroupTypes()
|
abstract CollisionEngineVendorInformation |
getVendorInformation()
|
boolean |
isEnabled()
|
BoxCollideable |
newBox(org.openmali.spatial.bodies.Box box)
Creates a new box collideable |
BoxCollideable |
newBox(float xSize,
float ySize,
float zSize)
Creates a new box collideable |
BoxCollideable |
newBox(Shape3D shape)
Creates a new box collideable |
BoxCollideable |
newBox(org.openmali.vecmath2.Tuple3f size)
Creates a new box collideable |
BoxCollideable |
newBox(org.openmali.spatial.VertexContainer vertexContainer)
Creates a new box collideable |
CollideableGroup |
newBoxGroup(GroupNode group)
Creates a new CollideableGroup filled with Boxes derived from the contained Shape3Ds. |
CollideableGroup |
newBoxOutline(org.openmali.spatial.bodies.Box box)
Creates a new box collideable |
CollideableGroup |
newBoxOutline(Shape3D shape)
Creates a new "box outline" collideable |
CollideableGroup |
newBoxOutline(org.openmali.spatial.VertexContainer vertexContainer)
Creates a new "box outline" collideable |
CapsuleCollideable |
newCapsule(float radius,
float length)
Creates a new capsule collideable |
CylinderCollideable |
newCylinder(float radius,
float length)
Creates a new cylinder collideable |
abstract CollideableGroup |
newGroup()
Creates a new group of the "best" available type (by best we mean the best compromise between speed and memory, the one which would be fine for most situations). |
abstract CollideableGroup |
newGroup(java.lang.String type)
Creates a new group of a specified type. |
PlaneCollideable |
newPlane(float a,
float b,
float c,
float d)
Creates a new plane collideable |
PlaneCollideable |
newPlane(org.openmali.spatial.bodies.Plane plane)
Creates a new plane collideable |
PlaneCollideable |
newPlane(org.openmali.vecmath2.Vector3f normal,
float d)
Creates a new plane collideable |
PlaneCollideable |
newPlane(org.openmali.vecmath2.Vector3f normal,
org.openmali.vecmath2.Point3f point)
Creates a new plane collideable |
RayCollideable |
newRay(float originX,
float originY,
float originZ,
float directionX,
float directionY,
float directionZ)
Creates a new ray collideable |
RayCollideable |
newRay(org.openmali.vecmath2.Ray3f ray)
Creates a new ray collideable |
RayCollideable |
newRay(Shape3D shape)
Creates a new ray collideable |
RayCollideable |
newRay(org.openmali.vecmath2.Tuple3f origin,
org.openmali.vecmath2.Tuple3f direction)
Creates a new ray collideable |
RayCollideable |
newRay(org.openmali.spatial.VertexContainer vertexContainer)
Creates a new ray collideable |
SphereCollideable |
newSphere(float radius)
Creates a new sphere collideable |
SphereCollideable |
newSphere(Shape3D shape)
Creates a new sphere collideable |
SphereCollideable |
newSphere(org.openmali.spatial.bodies.Sphere sphere)
Creates a new sphere collideable |
SphereCollideable |
newSphere(org.openmali.spatial.VertexContainer vertexContainer)
Creates a new sphere collideable |
CollideableGroup |
newSphereGroup(GroupNode group)
Creates a new CollideableGroup filled with Spheres derived from the contained Shape3Ds. |
TriMeshCollideable |
newTriMesh(Geometry geometry)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(Shape3D shape)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(org.openmali.spatial.TriangleContainer triangleContainer)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(org.openmali.vecmath2.Tuple3f[] vertices)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(org.openmali.vecmath2.Tuple3f[] vertices,
int[] indices)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(org.openmali.spatial.VertexContainer vertexContainer)
Creates a new triangle mesh collideable |
TriMeshCollideable |
newTriMesh(org.openmali.spatial.VertexContainer vertexContainer,
org.openmali.spatial.IndexContainer indexContainer)
Creates a new triangle mesh collideable |
CollideableGroup |
newTriMeshGroup(GroupNode group)
Creates a new CollideableGroup filled with TriMeshes derived from the contained Shape3Ds. |
void |
removeCollisionCheck(CollisionCheck cc)
Removes a CollisionCheck from the list, that is handled each frame. |
void |
setDefaultCollisionListener(CollisionListener cl)
Sets the CollisionListener, that is being used, if a CollisionCheck
doesn't define an own CollisionListener. |
void |
setEnabled(boolean enabled)
Sets this CollisionEngine enabled/disabled. |
void |
update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
Updates this Updatable object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollisionEngine()
| Method Detail |
|---|
public abstract java.util.List<CollideableGroupType> getGroupTypes()
public abstract CollideableGroup newGroup()
To know all implemented group types,
getGroupTypes()public abstract CollideableGroup newGroup(java.lang.String type)
type -
getGroupTypes()
public RayCollideable newRay(float originX,
float originY,
float originZ,
float directionX,
float directionY,
float directionZ)
originX - originY - originZ - directionX - directionY - directionZ -
public final RayCollideable newRay(org.openmali.vecmath2.Tuple3f origin,
org.openmali.vecmath2.Tuple3f direction)
origin - direction -
public final RayCollideable newRay(org.openmali.vecmath2.Ray3f ray)
ray - the template ray to create the RayCollideable from
public final RayCollideable newRay(org.openmali.spatial.VertexContainer vertexContainer)
vertexContainer - the VertexContainer to take the vertex coordinates from
public final RayCollideable newRay(Shape3D shape)
shape - the tempalte shape
public SphereCollideable newSphere(float radius)
radius - The radius of the sphere
public final SphereCollideable newSphere(org.openmali.spatial.bodies.Sphere sphere)
sphere - the template sphere to create the SphereCollideable from
public final SphereCollideable newSphere(org.openmali.spatial.VertexContainer vertexContainer)
vertexContainer - the VertexContainer to take the vertex coordinates from
public final SphereCollideable newSphere(Shape3D shape)
shape - the tempalte shape
public final BoxCollideable newBox(org.openmali.vecmath2.Tuple3f size)
size - The size of the box
public BoxCollideable newBox(float xSize,
float ySize,
float zSize)
xSize - The size of the box along the X axisySize - The size of the box along the Y axiszSize - The size of the box along the Z axis
public final BoxCollideable newBox(org.openmali.spatial.bodies.Box box)
box - the template box to create the BoxCollideable from
public final BoxCollideable newBox(org.openmali.spatial.VertexContainer vertexContainer)
vertexContainer - the VertexContainer to take the vertex coordinates from
public final BoxCollideable newBox(Shape3D shape)
shape - the template shape
public final CollideableGroup newBoxOutline(org.openmali.spatial.bodies.Box box)
box - the template box to create the BoxCollideable from
public final CollideableGroup newBoxOutline(org.openmali.spatial.VertexContainer vertexContainer)
vertexContainer - the VertexContainer to take the vertex coordinates from
public final CollideableGroup newBoxOutline(Shape3D shape)
shape - the template shape
public CapsuleCollideable newCapsule(float radius,
float length)
radius - The radius of the capsulelength - The length of the capsule
public CylinderCollideable newCylinder(float radius,
float length)
radius - The radius of the capsulelength - The length of the capsule
public PlaneCollideable newPlane(org.openmali.vecmath2.Vector3f normal,
org.openmali.vecmath2.Point3f point)
normal - The normal of the plane to be createdpoint - A point by which this plane is defined
public PlaneCollideable newPlane(org.openmali.vecmath2.Vector3f normal,
float d)
normal - The normal of the plane to be createdd - The d-parameter by which this plane is defined
public PlaneCollideable newPlane(float a,
float b,
float c,
float d)
a - the x-component of the plane's normalb - the y-component of the plane's normalc - the z-component of the plane's normald - The d-parameter by which this plane is defined
public final PlaneCollideable newPlane(org.openmali.spatial.bodies.Plane plane)
plane - the Plane, the new PlaneCollideable is defained off.
public TriMeshCollideable newTriMesh(org.openmali.spatial.VertexContainer vertexContainer,
org.openmali.spatial.IndexContainer indexContainer)
vertexContainer - A vertex container of a Triangle-based mesh (All Geometry types implements that interface)indexContainer - An index container of a Triangle-based mesh (Indexed Geometry types implements that interface)
If your geometry is not indexed, see the newTriMesh(VertexContainer) method.
public final TriMeshCollideable newTriMesh(org.openmali.spatial.VertexContainer vertexContainer)
vertexContainer - A vertex container of a Triangle-based mesh (All Geometry types implements that interface)
public TriMeshCollideable newTriMesh(org.openmali.spatial.TriangleContainer triangleContainer)
triangleContainer - A vertex container of a Triangle-based mesh (All Geometry types implements that interface)
public final TriMeshCollideable newTriMesh(Geometry geometry)
geometry - A Xith3D geometry
public final TriMeshCollideable newTriMesh(Shape3D shape)
shape - A Xith3D Shape3D
public TriMeshCollideable newTriMesh(org.openmali.vecmath2.Tuple3f[] vertices,
int[] indices)
vertices - The vertex data which is indexedindices - The vertices to chose from the vertex data
public final TriMeshCollideable newTriMesh(org.openmali.vecmath2.Tuple3f[] vertices)
vertices - The vertices of the triangle mesh (three vertices = one triangle)
public final CollideableGroup newTriMeshGroup(GroupNode group)
group - A Xith3D GroupNode
public final CollideableGroup newSphereGroup(GroupNode group)
group - A Xith3D GroupNode
public final CollideableGroup newBoxGroup(GroupNode group)
group - A Xith3D GroupNode
public abstract int checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic,
java.util.ArrayList<Collision> collisions)
c1 - A Collideable or CollideableGroupc2 - A Collideable or CollideableGroupignoreStatic - collisions - the list to write collisions to
public final java.util.ArrayList<Collision> checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic)
c1 - A Collideable or CollideableGroupc2 - A Collideable or CollideableGroupignoreStatic -
public abstract int checkCollisions(Collideable c1,
Collideable c2,
boolean ignoreStatic,
CollisionListener listener)
c1 - A Collideable or CollideableGroupc2 - A Collideable or CollideableGroupignoreStatic - listener - The CollisionListener to be notified, when a collision is detected.
public abstract int checkCollisions(CollideableGroup group,
boolean ignoreStatic,
java.util.ArrayList<Collision> collisions)
group - ignoreStatic - collisions - the list to write collisions to
public final java.util.ArrayList<Collision> checkCollisions(CollideableGroup group,
boolean ignoreStatic)
group - ignoreStatic -
public abstract int checkCollisions(CollideableGroup group,
boolean ignoreStatic,
CollisionListener listener)
group - ignoreStatic - listener -
public abstract CollisionEngineVendorInformation getVendorInformation()
public final void addCollisionCheck(CollisionCheck cc)
CollisionCheck to the list, that is handled each frame.
cc - public final void removeCollisionCheck(CollisionCheck cc)
CollisionCheck from the list, that is handled each frame.
cc - public final void setDefaultCollisionListener(CollisionListener cl)
CollisionListener, that is being used, if a CollisionCheck
doesn't define an own CollisionListener.
cl - public final CollisionListener getDefaultCollisionListener()
CollisionListener, that is being used, if a CollisionCheck
doesn't define an own CollisionListener.public final void setEnabled(boolean enabled)
setEnabled in interface org.jagatoo.datatypes.Enableableenabled - public final boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.Enableable
public void update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
update in interface UpdatablegameTime - the gameTime in MillisecondsframeTime - the frameTime in Milliseconds (needed time for the last frame)timingMode - the TimingMode to use for frameTime.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||