Package rosequartz.coll
Class AxisAlignedBoxCollider
java.lang.Object
rosequartz.coll.Collider
rosequartz.coll.AxisAlignedBoxCollider
- All Implemented Interfaces:
Serializable
Represents a collider in the shape of an axis-aligned box.
This means that all sides of the box are parallel to the x,y or z-axis.
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionAxisAlignedBoxCollider(float x1, float y1, float z1, float x2, float y2, float z2)Constructs an axis-aligned box-collider from two corner positions of the box (on opposite sides)AxisAlignedBoxCollider(Vec3 pos1, Vec3 pos2)Constructs an axis-aligned box-collider from two corner positions of the box (on opposite sides) -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatfloatsetPoint1(float x, float y, float z)Sets the first of the two corner positions of the box.Sets the first of the two corner positions of the box.setPoint2(float x, float y, float z)Sets the second of the two corner positions of the box.Sets the second of the two corner positions of the box.setPoints(float x1, float y1, float z1, float x2, float y2, float z2)Sets both corner positions of the box.Sets both corner positions of the box.toString()Methods inherited from class rosequartz.coll.Collider
acceptColliderType, getCenter, getColliding, getPointInside, getPointInside
-
Constructor Details
-
AxisAlignedBoxCollider
public AxisAlignedBoxCollider(float x1, float y1, float z1, float x2, float y2, float z2)Constructs an axis-aligned box-collider from two corner positions of the box (on opposite sides)- Parameters:
x1- position of the first corner on the x-axisy1- position of the first corner on the y-axisz1- position of the first corner on the z-axisx2- position of the second corner on the x-axisy2- position of the second corner on the y-axisz2- position of the second corner on the z-axis
-
AxisAlignedBoxCollider
Constructs an axis-aligned box-collider from two corner positions of the box (on opposite sides)- Parameters:
pos1- position of the first cornerpos2- position of the second corner
-
-
Method Details
-
setPoint1
Sets the first of the two corner positions of the box.- Parameters:
x- position of the corner on the x-axisy- position of the corner on the y-axisz- position of the corner on the z-axis- Returns:
- this
-
setPoint1
Sets the first of the two corner positions of the box.- Parameters:
xyz- position of the corner- Returns:
- this
-
setPoint2
Sets the second of the two corner positions of the box.- Parameters:
x- position of the corner on the x-axisy- position of the corner on the y-axisz- position of the corner on the z-axis- Returns:
- this
-
setPoint2
Sets the second of the two corner positions of the box.- Parameters:
xyz- position of the corner- Returns:
- this
-
setPoints
public AxisAlignedBoxCollider setPoints(float x1, float y1, float z1, float x2, float y2, float z2)Sets both corner positions of the box.- Parameters:
x1- position of the first corner on the x-axisy1- position of the first corner on the y-axisz1- position of the first corner on the z-axisx2- position of the second corner on the x-axisy2- position of the second corner on the y-axisz2- position of the second corner on the z-axis- Returns:
- this
-
setPoints
Sets both corner positions of the box.- Parameters:
p1- position of the first cornerp2- position of the second corner- Returns:
- this
-
getCenterX
public float getCenterX() -
getCenterY
public float getCenterY() -
getCenterZ
public float getCenterZ() -
toString
-