espresso3d.engine.collision.bounding
Class E3DBoundingBox

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.collision.bounding.E3DBoundingBox
All Implemented Interfaces:
E3DBoundingObject

public class E3DBoundingBox
extends E3DRenderable
implements E3DBoundingObject

Author:
espresso3d A bounding box bounding object. Bounding boxes are currently unsupported bounding objects

Constructor Summary
E3DBoundingBox(E3DBoundingBox toCopyBoundingBox)
           
E3DBoundingBox(E3DEngine engine)
           
E3DBoundingBox(E3DEngine engine, double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
           
E3DBoundingBox(E3DEngine engine, E3DVector3F min, E3DVector3F max)
           
 
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
 E3DVector3F getMax()
           
 E3DVector3F getMin()
           
 E3DOrientation getOrientation()
          Every bounding object has an orientation (position/rotation).
 E3DCollisionDetectableObject getParentObject()
          Bounding objects need to have an actor that they are bounding
 E3DQuad[] getQuads()
          Return the 6 faces of the bounding box as quads
 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 setMax(E3DVector3F max)
           
 void setMin(E3DVector3F min)
           
 void setParentObject(E3DCollisionDetectableObject parentObject)
          Set the parent object of the bounding object.
 void setSize(double size)
          Set the size of hte bounding object.
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getBlendMode, getKey, getRenderMode, initCorrectGeometryRenderer, isKeyChanged, setBlendMode, setKeyChanged, setRenderMode
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

E3DBoundingBox

public E3DBoundingBox(E3DEngine engine)

E3DBoundingBox

public E3DBoundingBox(E3DEngine engine,
                      E3DVector3F min,
                      E3DVector3F max)

E3DBoundingBox

public E3DBoundingBox(E3DEngine engine,
                      double minX,
                      double minY,
                      double minZ,
                      double maxX,
                      double maxY,
                      double maxZ)

E3DBoundingBox

public E3DBoundingBox(E3DBoundingBox toCopyBoundingBox)
Method Detail

render

public void render()
Specified by:
render in interface E3DBoundingObject
Specified by:
render in class E3DRenderable

checkLineIntersectionCollision

public E3DCollision checkLineIntersectionCollision(E3DVector3F startPos,
                                                   E3DVector3F endPos)
Specified by:
checkLineIntersectionCollision in interface E3DBoundingObject
Parameters:
startPos - World coordinate start position
endPos - World coordinate end position
Returns:

getCollisionDetector

public E3DCollisionDetector getCollisionDetector()
Description copied from interface: E3DBoundingObject
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

Specified by:
getCollisionDetector in interface E3DBoundingObject
Returns:

getMax

public E3DVector3F getMax()
Returns:
Returns the max.

setMax

public void setMax(E3DVector3F max)
Parameters:
max - The max to set.

getMin

public E3DVector3F getMin()
Returns:
Returns the min.

setMin

public void setMin(E3DVector3F min)
Parameters:
min - The min to set.

getQuads

public E3DQuad[] getQuads()
Return the 6 faces of the bounding box as quads

Returns:

onGetClone

public E3DBoundingObject onGetClone()
Description copied from interface: E3DBoundingObject
Returns a clone of the bounding object

Specified by:
onGetClone in interface E3DBoundingObject
Returns:

getParentObject

public E3DCollisionDetectableObject getParentObject()
Description copied from interface: E3DBoundingObject
Bounding objects need to have an actor that they are bounding

Specified by:
getParentObject in interface E3DBoundingObject
Returns:

setParentObject

public void setParentObject(E3DCollisionDetectableObject parentObject)
Description copied from interface: E3DBoundingObject
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).

Specified by:
setParentObject in interface E3DBoundingObject
Parameters:
parentObject -

centerAroundParentObject

public void centerAroundParentObject()
Description copied from interface: E3DBoundingObject
This will automatically set the position of the bounding object to be that of its parent object

Specified by:
centerAroundParentObject in interface E3DBoundingObject

scale

public void scale(double scaleAmt)
Description copied from interface: E3DBoundingObject
Scale the bounding object around its position

Specified by:
scale in interface E3DBoundingObject
Parameters:
scaleAmt -

setSize

public void setSize(double size)
Description copied from interface: E3DBoundingObject
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.

Specified by:
setSize in interface E3DBoundingObject
Parameters:
size - Total size of the bounding object

getSize

public double getSize()
Description copied from interface: E3DBoundingObject
Get the size of the object. This will only be completely accurate for spheres.

Specified by:
getSize in interface E3DBoundingObject
Returns:

getOrientation

public E3DOrientation getOrientation()
Description copied from interface: E3DBoundingObject
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.

Specified by:
getOrientation in interface E3DBoundingObject
Returns: