unc.cdva.utils
Class BoundingBox

java.lang.Object
  extended by unc.cdva.utils.BoundingBox

public class BoundingBox
extends java.lang.Object

Implement a simple planar bounding box. Specific to the RA project, this box surrounds the targets, when a projectile lands inside the box it is considered a hit.

Author:
Guillaume Conte

Constructor Summary
BoundingBox(javax.vecmath.Vector3f center, javax.vecmath.Vector3f scaling, float length, float width, float error)
          Create a bounding box using the center of an object, its scaling vector, its standard length, its standard width, and an error factor that increase the size of the box
 
Method Summary
 boolean inside(javax.vecmath.Vector3f point)
          Let you know if a point is inside the box
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundingBox

public BoundingBox(javax.vecmath.Vector3f center,
                   javax.vecmath.Vector3f scaling,
                   float length,
                   float width,
                   float error)
Create a bounding box using the center of an object, its scaling vector, its standard length, its standard width, and an error factor that increase the size of the box

Parameters:
center - coordinates of the center of the object
scaling - scaling vector of the object
length - standard length
width - standard width
error - error factor
Method Detail

inside

public boolean inside(javax.vecmath.Vector3f point)
Let you know if a point is inside the box

Parameters:
point - coordinates of the point
Returns:
true if the point is inside the box, else false