net.phys2d.raw.shapes
Class AABox

java.lang.Object
  extended bynet.phys2d.raw.shapes.AABox

public class AABox
extends java.lang.Object

An axis oriented used for shape bounds


Constructor Summary
AABox(float width, float height)
          Create a new bounding box
AABox(float offsetx, float offsety, float width, float height)
          Create a new AABox
 
Method Summary
 float getHeight()
          Get the height of the box
 float getOffsetX()
          Get the x offset to the body's position of this bounds
 float getOffsetY()
          Get the y offset to the body's position of this bounds
 float getWidth()
          Get the width of the box
 java.lang.String toString()
           
 boolean touches(float x, float y, AABox other, float otherx, float othery)
          Check if this box touches another
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AABox

public AABox(float width,
             float height)
Create a new bounding box

Parameters:
width - The width of the box
height - The hieght of the box

AABox

public AABox(float offsetx,
             float offsety,
             float width,
             float height)
Create a new AABox

Parameters:
offsetx - The x offset to the body's position
offsety - The y offset to the body's position
width - The width of the box
height - The hieght of the box
Method Detail

getWidth

public float getWidth()
Get the width of the box

Returns:
The width of the box

getHeight

public float getHeight()
Get the height of the box

Returns:
The height of the box

getOffsetX

public float getOffsetX()
Get the x offset to the body's position of this bounds

Returns:
The x offset to the body's position of this bounds

getOffsetY

public float getOffsetY()
Get the y offset to the body's position of this bounds

Returns:
The y offset to this body's position of this bounds

touches

public boolean touches(float x,
                       float y,
                       AABox other,
                       float otherx,
                       float othery)
Check if this box touches another

Parameters:
x - The x position of this box
y - The y position of this box
other - The other box to check against
otherx - The other box's x position
othery - The other box's y position
Returns:
True if the boxes touches

toString

public java.lang.String toString()
See Also:
Object.toString()