mako5.math.phys
Class Bounds

java.lang.Object
  extended by mako5.math.phys.Bounds
Direct Known Subclasses:
Boundary, BoundingCircle, BoundingRect

public abstract class Bounds
extends Object

Represents the bounds of an object.

Version:
17-Feb 2006, 09-Mar 2006
Author:
Paul Jarrett

Field Summary
static int BOUNDARY
           
static int CIRCLE
           
static int LINE
           
static int RECT
           
 
Constructor Summary
Bounds(int iType_)
          Creates a new Bounds object.
Bounds(R2v rLoc_, int iType_)
          Creates a new Bounds object.
 
Method Summary
 void aliasLoc(R2v rLoc_)
          Aliases the given location.
 R2v getLocation()
          Returns the location this bounds is attached to.
 int getType()
          Deprecated. 04-Apr 2006
abstract  boolean isCollision(R2v rLoc_)
          Determines if there is a collision between this and a given point
static boolean testCollision(Boundary bd, BoundingRect rc)
          Tests for collision between a boundary and a bounded rectangle.
static boolean testCollision(BoundingRect a, BoundingRect b)
          Tests for a collision between a rectangle and another rectangle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CIRCLE

public static final int CIRCLE
See Also:
Constant Field Values

LINE

public static final int LINE
See Also:
Constant Field Values

RECT

public static final int RECT
See Also:
Constant Field Values

BOUNDARY

public static final int BOUNDARY
See Also:
Constant Field Values
Constructor Detail

Bounds

public Bounds(int iType_)
Creates a new Bounds object.

Parameters:
iType_ - the ID for the type of this object
Since:
09-Mar 2006

Bounds

public Bounds(R2v rLoc_,
              int iType_)
Creates a new Bounds object.

Since:
09-Mar 2006
Method Detail

getType

@Deprecated
public int getType()
Deprecated. 04-Apr 2006

Return the type ID of this

Since:
09-Mar 2006

aliasLoc

public final void aliasLoc(R2v rLoc_)
Aliases the given location. Attaches this to the given m_rLocation.

Since:
09-Mar 2006

getLocation

public R2v getLocation()
Returns the location this bounds is attached to.

Returns:
the aliased location that this bounds is attached to.
Since:
09-Mar 2006

isCollision

public abstract boolean isCollision(R2v rLoc_)
Determines if there is a collision between this and a given point

Parameters:
rLoc_ - the point to test for collision with
Since:
09-Mar 2006

testCollision

public static boolean testCollision(Boundary bd,
                                    BoundingRect rc)
Tests for collision between a boundary and a bounded rectangle.

Parameters:
bd - the boundary
rc - the bounding rect
Since:
03-Apr 2006

testCollision

public static boolean testCollision(BoundingRect a,
                                    BoundingRect b)
Tests for a collision between a rectangle and another rectangle.

Parameters:
a - the first rectangle
b - the second rectangle