espresso3d.engine.collision
Class E3DCollision

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.collision.E3DCollision

public class E3DCollision
extends E3DRenderable

Author:
espresso3d This is the object that is returned when a collision is detected that contains information about the collision.

Field Summary
 
Fields inherited from class espresso3d.engine.renderer.base.E3DRenderable
RENDERMODE_SOLID, RENDERMODE_TEXTURED, RENDERMODE_WIREFRAME
 
Constructor Summary
E3DCollision(E3DCollision toCopy)
           
E3DCollision(E3DEngine engine)
           
 
Method Summary
 E3DVector3F getCollidedActorCollisionNormal()
          This is only applicable for new collision detectors.
 java.lang.Object getCollisionBoundingObject()
           
 E3DVector3F getCollisionNormal()
          Get the normal at the point of collision if available
 E3DCollisionDetectableObject getCollisionObject()
          Returns the object that was collided with This can be a E3DSector, E3DActor, E3DSprite, ...
 E3DSector getCollisionSector()
           
 E3DWorld getCollisionWorld()
           
 E3DVector3F getIntersectionPt()
           
 void renderAtPosition(E3DVector3F position)
          To see a collision graphically, a collision object can be placed on the externalrenderable list of the engine.
 void setCollidedActorCollisionNormal(E3DVector3F collidedActorCollisionNormal)
          This is only applicable for new collision detectors.
 void setCollisionBoundingObject(java.lang.Object collisionBoundingObject)
           
 void setCollisionNormal(E3DVector3F collisionNormal)
          Set the normal at the point of the collision
 void setCollisionObject(E3DCollisionDetectableObject collisionObject)
          Set the object that was collided with
 void setCollisionSector(E3DSector collisionSector)
           
 void setCollisionWorld(E3DWorld collisionWorld)
           
 void setIntersectionPt(E3DVector3F intersectionPt)
           
 java.lang.String toString()
          Print out basic information regarding a collision
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getRenderableOptionsKey, getRenderMode, initCorrectGeometryRenderer, render, setRenderMode
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

E3DCollision

public E3DCollision(E3DEngine engine)

E3DCollision

public E3DCollision(E3DCollision toCopy)
Method Detail

renderAtPosition

public void renderAtPosition(E3DVector3F position)
To see a collision graphically, a collision object can be placed on the externalrenderable list of the engine. When rendered will this indicate collision area with red marker at the intersection point

Specified by:
renderAtPosition in class E3DRenderable
Parameters:
position -

getIntersectionPt

public E3DVector3F getIntersectionPt()
Returns:
Returns the collisionPt.

setIntersectionPt

public void setIntersectionPt(E3DVector3F intersectionPt)

getCollisionSector

public E3DSector getCollisionSector()
Returns:
Returns the collisionSector.

setCollisionSector

public void setCollisionSector(E3DSector collisionSector)
Parameters:
collisionSector - The collisionSector to set.

getCollisionBoundingObject

public java.lang.Object getCollisionBoundingObject()
Returns:
Returns the type of object the sourceActor collided with. This will either be a Trangle, or it will be one of the bounding object types (use instanceof to determine which)

setCollisionBoundingObject

public void setCollisionBoundingObject(java.lang.Object collisionBoundingObject)

getCollisionWorld

public E3DWorld getCollisionWorld()
Returns:
Returns the collisionWorld.

setCollisionWorld

public void setCollisionWorld(E3DWorld collisionWorld)
Parameters:
collisionWorld - The collisionWorld to set.

toString

public java.lang.String toString()
Print out basic information regarding a collision


getCollisionNormal

public E3DVector3F getCollisionNormal()
Get the normal at the point of collision if available

Returns:

setCollisionNormal

public void setCollisionNormal(E3DVector3F collisionNormal)
Set the normal at the point of the collision

Parameters:
collisionNormal -

getCollidedActorCollisionNormal

public E3DVector3F getCollidedActorCollisionNormal()
This is only applicable for new collision detectors. If another actor was collided into, we put what its collision normal should be here. If we then notify the collided actor, we replace the collision normal with this so it has the correct collision normal. So, this is the collision normal of the actor that was collided into

Returns:

setCollidedActorCollisionNormal

public void setCollidedActorCollisionNormal(E3DVector3F collidedActorCollisionNormal)
This is only applicable for new collision detectors. If another actor was collided into, we put what its collision normal should be here. If we then notify the collided actor, we replace the collision normal with this so it has the correct collision normal

Parameters:
collidedActorCollisionNormal -

getCollisionObject

public E3DCollisionDetectableObject getCollisionObject()
Returns the object that was collided with This can be a E3DSector, E3DActor, E3DSprite, ...

Returns:

setCollisionObject

public void setCollisionObject(E3DCollisionDetectableObject collisionObject)
Set the object that was collided with

Parameters:
collisionObject -