Struct OrientedBoundingBox
Oriented Bounding Box (OBB) is a rectangular block, much like an AABB (Bounding Box) but with an arbitrary orientation in 3D space.
Assembly: FlaxEngine.dll
File: Engine/Core/Math/OrientedBoundingBox.h
Syntax
public struct OrientedBoundingBox
Constructors
OrientedBoundingBox()
Empty constructor.
Declaration
public OrientedBoundingBox()
OrientedBoundingBox(const BoundingBox& bb)
OrientedBoundingBox(const Vector3& extents, const Matrix& transformation)
Declaration
public OrientedBoundingBox(const Vector3& extents, const Matrix& transformation)
Parameters
Vector3
extents
|
Matrix
transformation
|
OrientedBoundingBox(const Vector3& extents, const Matrix3x3& rotationScale, const Vector3& translation)
Declaration
public OrientedBoundingBox(const Vector3& extents, const Matrix3x3& rotationScale, const Vector3& translation)
Parameters
Vector3
extents
|
Matrix3x3
rotationScale
|
Vector3
translation
|
OrientedBoundingBox(const Vector3& extents, const Transform& transformation)
Declaration
public OrientedBoundingBox(const Vector3& extents, const Transform& transformation)
Parameters
Vector3
extents
|
Transform
transformation
|
OrientedBoundingBox(const Vector3& minimum, const Vector3& maximum)
Declaration
public OrientedBoundingBox(const Vector3& minimum, const Vector3& maximum)
Parameters
Vector3
minimum
|
Vector3
maximum
|
OrientedBoundingBox(Vector3 points[], int32 pointCount)
Declaration
public OrientedBoundingBox(Vector3 points[], int32 pointCount)
Parameters
Vector3
points
|
int32
pointCount
|
Fields
Extents
Half lengths of the box along each axis.
Declaration
public Vector3 Extents
Field Value
Vector3
|
Transformation
The transformation which aligns and scales the box, and its translation vector represents the center of the box.
Declaration
public Transform Transformation
Field Value
Transform
|
Methods
Contains(const BoundingSphere& sphere, bool ignoreScale=false)
Determines whether a OBB contains a sphere.
Declaration
public ContainmentType Contains(const BoundingSphere& sphere, bool ignoreScale=false) const
Parameters
BoundingSphere
sphere
The sphere to test. |
bool
ignoreScale
Optimize the check operation by assuming that OBB has no scaling applied. |
Returns
ContainmentType
The type of containment the two objects have. |
Contains(const Vector3& point, Real* distance=nullptr)
Declaration
public ContainmentType Contains(const Vector3& point, Real* distance=nullptr) const
Parameters
Vector3
point
|
Real
distance
|
Returns
ContainmentType
|
CreateCentered(const Vector3& center, const Vector3& size)
Creates the centered box (axis-aligned).
Declaration
public static OrientedBoundingBox CreateCentered(const Vector3& center, const Vector3& size)
Parameters
Vector3
center
The center. |
Vector3
size
The size. |
Returns
OrientedBoundingBox
The result. |
CreateCentered(const Vector3& center, const Vector3& size, OrientedBoundingBox& result)
Creates the centered box (axis aligned).
Declaration
public static void CreateCentered(const Vector3& center, const Vector3& size, OrientedBoundingBox& result)
Parameters
Vector3
center
The center. |
Vector3
size
The size. |
OrientedBoundingBox
result
The result. |
GetBoundingBox()
Gets the AABB which contains all OBB corners.
Declaration
public BoundingBox GetBoundingBox() const
Returns
BoundingBox
The result |
GetBoundingBox(BoundingBox& result)
Gets the AABB which contains all OBB corners.
Declaration
public void GetBoundingBox(BoundingBox& result) const
Parameters
BoundingBox
result
The result. |
GetCenter()
Declaration
public Vector3 GetCenter() const
Returns
Vector3
|
GetCorners(Double3 corners[8])
Declaration
public void GetCorners(Double3 corners[8]) const
Parameters
Double3
corners
|
GetCorners(Float3 corners[8])
Declaration
public void GetCorners(Float3 corners[8]) const
Parameters
Float3
corners
|
GetSize()
Declaration
public Vector3 GetSize() const
Returns
Vector3
|
GetSizeSquared()
Declaration
public Vector3 GetSizeSquared() const
Returns
Vector3
|
GetSizeUnscaled()
Declaration
public Vector3 GetSizeUnscaled() const
Returns
Vector3
|
Intersects(const Ray& ray)
Intersects(const Ray& ray, Real& distance)
Declaration
public bool Intersects(const Ray& ray, Real& distance) const
Parameters
Ray
ray
|
Real
distance
|
Returns
bool
|
Intersects(const Ray& ray, Real& distance, Vector3& normal)
Declaration
public bool Intersects(const Ray& ray, Real& distance, Vector3& normal) const
Parameters
Ray
ray
|
Real
distance
|
Vector3
normal
|
Returns
bool
|
Intersects(const Ray& ray, Vector3& point)
Declaration
public bool Intersects(const Ray& ray, Vector3& point) const
Parameters
Ray
ray
|
Vector3
point
|
Returns
bool
|
operator!=(const OrientedBoundingBox& other)
Declaration
public bool operator!=(const OrientedBoundingBox& other) const
Parameters
OrientedBoundingBox
other
|
Returns
bool
|
operator*(const ::Transform& matrix)
Declaration
public OrientedBoundingBox operator*(const ::Transform& matrix) const
Parameters
::Transform
matrix
|
Returns
OrientedBoundingBox
|
operator*(const Matrix& matrix)
Declaration
public OrientedBoundingBox operator*(const Matrix& matrix) const
Parameters
Matrix
matrix
|
Returns
OrientedBoundingBox
|
operator==(const OrientedBoundingBox& other)
Declaration
public bool operator==(const OrientedBoundingBox& other) const
Parameters
OrientedBoundingBox
other
|
Returns
bool
|
Scale(const Vector3& scaling)
Declaration
public void Scale(const Vector3& scaling)
Parameters
Vector3
scaling
|
Scale(Real scaling)
Declaration
public void Scale(Real scaling)
Parameters
Real
scaling
|
ToString()
Transform(const ::Transform& transform)
Declaration
public void Transform(const ::Transform& transform)
Parameters
::Transform
transform
|
Transform(const Matrix& matrix)
Translate(const Vector3& translation)
Declaration
public void Translate(const Vector3& translation)
Parameters
Vector3
translation
|