public class PhysicsComponent.AABB extends PhysicsComponent.BoundingVolume
| Modifier and Type | Field and Description |
|---|---|
float |
height |
float |
width |
old_xPos, old_yPos, x_Pos, y_Pos| Constructor and Description |
|---|
AABB(float x_Pos,
float y_Pos,
float dimension)
used to initialise a new AABB with the shape of a square
|
AABB(float x_Pos,
float y_Pos,
float width,
float height)
used to initialise a new AABB with arbitrary rectangular shape
|
| Modifier and Type | Method and Description |
|---|---|
float |
getBottom()
used to get the bottom coordinate along the y axis of the bounding volume
|
float |
getLeft()
used to get the left side coordinate along the x axis of the bounding volume
|
float |
getRight()
used to get the right side coordinate along the x axis of the bounding volume
|
float |
getTop()
used to get the top coordinate along the y axis of the bounding volume
|
updatepublic AABB(float x_Pos,
float y_Pos,
float width,
float height)
x_Pos - the x position of the bounding volumey_Pos - the y position of the bounding volumewidth - half of the width of the rectangleheight - half of the height of the rectanglepublic AABB(float x_Pos,
float y_Pos,
float dimension)
x_Pos - the bounding volumes x positiony_Pos - the y position of the bounding volumedimension - the half of the width and height of the square shapepublic float getTop()
public float getBottom()
public float getLeft()
public float getRight()