AI-generated Key Takeaways
-
Boxis a mathematical representation used for intersection and collision tests with oriented boxes. -
It provides constructors to create boxes with specified centers and sizes, defaulting to (0,0,0) and (1,1,1) respectively.
-
Public methods allow access and modification of the box's center, rotation, and size.
-
getExtents()calculates and returns a vector representing half the size of the box. -
makeCopy()creates a copy of the currentBoxobject.
Mathematical representation of a box. Used to perform intersection and collision tests against oriented boxes.
Public Constructors
|
Box()
Create a box with a center of (0,0,0) and a size of (1,1,1).
|
|
Public Methods
| Vector3 |
getCenter()
Get a copy of the box's center.
|
| Vector3 |
getExtents()
Calculate the extents (half the size) of the box.
|
| Quaternion |
getRotation()
Get a copy of the box's rotation.
|
| Vector3 |
getSize()
Get a copy of the box's size.
|
| Box |
makeCopy()
|
| void | |
| void | |
| void |
Inherited Methods
Public Constructors
public Box ()
Create a box with a center of (0,0,0) and a size of (1,1,1).
public Box (Vector3 size)
Create a box with a center of (0,0,0) and a specified size.
Parameters
| size | the size of the box. |
|---|
Public Methods
public Vector3 getCenter ()
Get a copy of the box's center.
Returns
- a new vector that represents the box's center
See Also
public Vector3 getExtents ()
Calculate the extents (half the size) of the box.
Returns
- a new vector that represents the box's extents
public Quaternion getRotation ()
Get a copy of the box's rotation.
Returns
- a new quaternion that represents the box's rotation
See Also
public Vector3 getSize ()
Get a copy of the box's size.
Returns
- a new vector that represents the box's size
See Also
public void setCenter (Vector3 center)
public void setRotation (Quaternion rotation)
Set the rotation of this box.
Parameters
| rotation | the new rotation of the box |
|---|