47 return std::array<Vector3, 8>
50 aOffset + mCenter + mRadii,
51 aOffset + mCenter - mRadii,
52 aOffset + mCenter +
Vector3 ( -mRadii[0], mRadii[1], mRadii[2] ),
53 aOffset + mCenter -
Vector3 ( -mRadii[0], mRadii[1], mRadii[2] ),
54 aOffset + mCenter +
Vector3 ( mRadii[0], -mRadii[1], mRadii[2] ),
55 aOffset + mCenter -
Vector3 ( mRadii[0], -mRadii[1], mRadii[2] ),
56 aOffset + mCenter +
Vector3 ( mRadii[0], mRadii[1], -mRadii[2] ),
57 aOffset + mCenter -
Vector3 ( mRadii[0], mRadii[1], -mRadii[2] )
73 ( aPlane.GetNormal() [0] < 0 ) ? mRadii[0] : -mRadii[0],
74 ( aPlane.GetNormal() [1] < 0 ) ? mRadii[1] : -mRadii[1],
75 ( aPlane.GetNormal() [2] < 0 ) ? mRadii[2] : -mRadii[2]
82 std::min ( mCenter[0] - mRadii[0], lhs.mCenter[0] - lhs.mRadii[0] ),
83 std::min ( mCenter[1] - mRadii[1], lhs.mCenter[1] - lhs.mRadii[1] ),
84 std::min ( mCenter[2] - mRadii[2], lhs.mCenter[2] - lhs.mRadii[2] )
88 std::max ( mCenter[0] + mRadii[0], lhs.mCenter[0] + lhs.mRadii[0] ),
89 std::max ( mCenter[1] + mRadii[1], lhs.mCenter[1] + lhs.mRadii[1] ),
90 std::max ( mCenter[2] + mRadii[2], lhs.mCenter[2] + lhs.mRadii[2] )
92 mCenter = ( min + max ) / 2.0f;
93 mRadii = max - mCenter;
Inline functions related to 3D Math.
Header for the axis aligned bounding box class.
Header for the plane class.
DLL AABB & operator+=(const AABB &lhs)
Expand this AABB to enclose another AABB.
DLL void SetRadii(const Vector3 &aRadii)
Set the radii (half-extents) of the AABB.
DLL AABB()
Default constructor.
DLL Transform GetTransform() const
Get the AABB as a transform, the AABB center becomes translation and the radii becomes scale.
DLL float GetDistanceToPlane(const Plane &aPlane) const
Returns the shortest distance from any point in the plane's surface to the support point of the AABB ...
DLL std::array< Vector3, 8 > GetPoints(const Vector3 &aOffset={ 0.0f, 0.0f, 0.0f, }) const
Get the eight corner points of the AABB.
DLL const Vector3 & GetRadii() const
Get the radii (half-extents) of the AABB.
DLL const Vector3 & GetCenter() const
Get the center position of the AABB.
DLL void SetCenter(const Vector3 &aCenter)
Set the center position of the AABB.
DLL const float & GetDistance() const
Get the distance from the origin to the plane.
DLL const Vector3 & GetNormal() const
Get the plane normal vector.
<- This is here just for the literals
DLL const float Dot(const Vector3 &aLhs, const Vector3 &aRhs)
Compute the dot product of two vectors.