TrinityCore
|
An arbitrary (oriented) 3D box, useful as a bounding box. More...
#include <Box.h>
Static Public Member Functions | |
static Box | inf () |
Private Member Functions | |
void | init (const Vector3 &min, const Vector3 &max) |
Private Attributes | |
Vector3 | _edgeVector [3] |
Point3 | _center |
float | _area |
float | _volume |
Static Private Attributes | |
static int32 | dummy = 0 |
Friends | |
class | CoordinateFrame |
An arbitrary (oriented) 3D box, useful as a bounding box.
To construct a box from a coordinate frame, center and extent, use the idiom: Box box = cframe.toObjectSpace(Box(center - extent/2, center + extent/2));
G3D::Box::Box | ( | ) |
Constructs a box from two opposite corners.
G3D::Box::Box | ( | class BinaryInput & | b | ) |
float G3D::Box::area | ( | ) | const |
|
inline |
|
inline |
Returns the centroid of the box.
Vector3 G3D::Box::corner | ( | int | i | ) | const |
bool G3D::Box::culledBy | ( | const Array< Plane > & | plane, |
int32 & | cullingPlaneIndex, | ||
const uint32 | testMask, | ||
uint32 & | childMask | ||
) | const |
See AABox::culledBy
bool G3D::Box::culledBy | ( | const Array< Plane > & | plane, |
int32 & | cullingPlaneIndex = dummy , |
||
const uint32 | testMask = -1 |
||
) | const |
Conservative culling test that does not produce a mask for children.
void G3D::Box::deserialize | ( | class BinaryInput & | b | ) |
|
inline |
Distance from corner(0) to the next corner along the box's local axis a.
|
inline |
void G3D::Box::getBounds | ( | class AABox & | aabb | ) | const |
void G3D::Box::getFaceCorners | ( | int | f, |
Vector3 & | v0, | ||
Vector3 & | v1, | ||
Vector3 & | v2, | ||
Vector3 & | v3 | ||
) | const |
Returns the four corners of a face (0 <= f < 6). The corners are returned to form a clockwise quad facing outwards.
+--------+ / : /| / : / |
+-----—+ | | : | | | +....|..+ | / | / |/ |/ +-----—+
y ^ | |–>x z/ Faces are in the following order: 0: -Z 1: X 2: Z 3: Y 4: -X 5: -Y
void G3D::Box::getLocalFrame | ( | CoordinateFrame & | frame | ) | const |
void G3D::Box::getRandomSurfacePoint | ( | Vector3 & | P, |
Vector3 & | N = Vector3::ignore() |
||
) | const |
|
static |
|
inline |
CoordinateFrame G3D::Box::localFrame | ( | ) | const |
Returns the object to world transformation for this box, where the origin is the center of the box. localFrame().worldToObject(...) takes objects into the space where the box axes are (1,0,0), (0,1,0), (0,0,1). Note that there is no scaling in this transformation.
Box G3D::Box::operator* | ( | float | f | ) | const |
Vector3 G3D::Box::randomInteriorPoint | ( | ) | const |
Uniformly distributed on the interior (includes surface)
void G3D::Box::serialize | ( | class BinaryOutput & | b | ) | const |
Any G3D::Box::toAny | ( | ) | const |
float G3D::Box::volume | ( | ) | const |
|
friend |
|
private |
|
private |
|
private |
Axes with length equal to the 4 edges that run along each of them
|
private |
|
staticprivate |