espresso3d.engine.collision.bounding
Interface E3DBoundingObject

All Known Implementing Classes:
E3DBoundingBox, E3DBoundingSphere

public interface E3DBoundingObject

Author:
Curt The base bounding object class which other bounding objects extend

Method Summary
 void centerAroundParentObject()
          This will automatically set the position of the bounding object to be that of its parent object
 E3DCollision checkLineIntersectionCollision(E3DVector3F startPos, E3DVector3F endPos)
           
 E3DCollisionDetector getCollisionDetector()
          Every bounding object must implement this method that takes a list of E3DLine's and returns the closest collision between any of the lines and the bounding object itself, therefore, it must have a collision detector
 E3DOrientation getOrientation()
          Every bounding object has an orientation (position/rotation).
 E3DCollisionDetectableObject getParentObject()
          Bounding objects need to have an actor that they are bounding
 double getSize()
          Get the size of the object.
 E3DBoundingObject onGetClone()
          Returns a clone of the bounding object
 void render()
           
 void scale(double scaleAmt)
          Scale the bounding object around its position
 void setParentObject(E3DCollisionDetectableObject actor)
          Set the parent object of the bounding object.
 void setSize(double size)
          Set the size of hte bounding object.
 

Method Detail

getCollisionDetector

public E3DCollisionDetector getCollisionDetector()
Every bounding object must implement this method that takes a list of E3DLine's and returns the closest collision between any of the lines and the bounding object itself, therefore, it must have a collision detector

Returns:

getParentObject

public E3DCollisionDetectableObject getParentObject()
Bounding objects need to have an actor that they are bounding

Returns:

setParentObject

public void setParentObject(E3DCollisionDetectableObject actor)
Set the parent object of the bounding object. This is normally handled by the engine itself when a bounding object is added to an object (like an actor).

Parameters:
actor -

centerAroundParentObject

public void centerAroundParentObject()
This will automatically set the position of the bounding object to be that of its parent object


onGetClone

public E3DBoundingObject onGetClone()
Returns a clone of the bounding object

Returns:

checkLineIntersectionCollision

public E3DCollision checkLineIntersectionCollision(E3DVector3F startPos,
                                                   E3DVector3F endPos)
Parameters:
startPos - World coordinate start position
endPos - World coordinate end position
Returns:

getOrientation

public E3DOrientation getOrientation()
Every bounding object has an orientation (position/rotation). This is NOT directly related to its parent objects orientation. IE: its not cumulative, this orientation is the actual orientation of the bounding object in the world.

Returns:

scale

public void scale(double scaleAmt)
Scale the bounding object around its position

Parameters:
scaleAmt -

setSize

public void setSize(double size)
Set the size of hte bounding object. If a boundingsphere, the radius will be set to .5(size). If a boundingbox, width, height, and depth will be size.

Parameters:
size - Total size of the bounding object

getSize

public double getSize()
Get the size of the object. This will only be completely accurate for spheres.

Returns:

render

public void render()