game.geom
Class CBoundingBox

java.lang.Object
  extended by game.geom.CBoundingBox

public class CBoundingBox
extends java.lang.Object

A moving bounding box. For now it can translate, but its width and height can't vary (easier updates).

Author:
sroccaserra

Field Summary
private  float m_h
           
private  float m_h_2
           
private  float m_w
           
private  float m_w_2
           
 float x
           
 float y
           
 
Constructor Summary
CBoundingBox()
           
CBoundingBox(CBoundingBox rhs)
           
CBoundingBox(float xValue, float yValue, float w, float h)
           
 
Method Summary
 void draw(java.awt.Graphics g)
           
 CVector2D getCenter()
           
 float getCenterX()
           
 float getCenterY()
           
 float getH()
           
 int getHi()
           
 float getLowY()
           
 float getRightX()
           
 float getW_2()
           
 float getW()
           
 int getWi()
           
 int getXi()
           
 int getYi()
           
 boolean intersect(float xValue, float yValue)
           
 void setH(float h)
           
 void setW(float w)
           
 void translate(float dx, float dy)
           
 void translateX(float dx)
           
 void translateY(float dy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

m_w

private float m_w

m_h

private float m_h

m_w_2

private float m_w_2

m_h_2

private float m_h_2
Constructor Detail

CBoundingBox

public CBoundingBox()

CBoundingBox

public CBoundingBox(float xValue,
                    float yValue,
                    float w,
                    float h)

CBoundingBox

public CBoundingBox(CBoundingBox rhs)
Method Detail

getW

public final float getW()

getW_2

public final float getW_2()

getH

public final float getH()

getRightX

public final float getRightX()

getLowY

public final float getLowY()

getCenterX

public final float getCenterX()

getCenterY

public final float getCenterY()

getCenter

public final CVector2D getCenter()

getXi

public final int getXi()

getYi

public final int getYi()

getWi

public final int getWi()

getHi

public final int getHi()

setW

public final void setW(float w)

setH

public final void setH(float h)

translateX

public final void translateX(float dx)

translateY

public final void translateY(float dy)

translate

public final void translate(float dx,
                            float dy)

intersect

public final boolean intersect(float xValue,
                               float yValue)

draw

public final void draw(java.awt.Graphics g)