Struct BoundingOrientedBox
An oriented bounding box object.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.Collision
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct BoundingOrientedBox : IEquatable<BoundingOrientedBox>
Constructors
| Edit this page View SourceBoundingOrientedBox(XMFloat3, XMFloat3, XMFloat4)
Initializes a new instance of the BoundingOrientedBox struct.
Declaration
public BoundingOrientedBox(XMFloat3 center, XMFloat3 extents, XMFloat4 orientation)
Parameters
Type | Name | Description |
---|---|---|
XMFloat3 | center | The coordinates of the center. |
XMFloat3 | extents | The extents. |
XMFloat4 | orientation | The orientation. |
Fields
| Edit this page View SourceCornerCount
The number of points defining the BoundingOrientedBox.
Declaration
public const int CornerCount = 8
Field Value
Type | Description |
---|---|
int |
Properties
| Edit this page View SourceCenter
Gets or sets the center of the BoundingOrientedBox.
Declaration
public XMFloat3 Center { get; set; }
Property Value
Type | Description |
---|---|
XMFloat3 |
Extents
Gets or sets the extents of the BoundingOrientedBox.
Declaration
public XMFloat3 Extents { get; set; }
Property Value
Type | Description |
---|---|
XMFloat3 |
Orientation
Gets or sets the orientation of the BoundingOrientedBox represented as a quaternion.
Declaration
public XMFloat4 Orientation { get; set; }
Property Value
Type | Description |
---|---|
XMFloat4 |
Methods
| Edit this page View SourceContainedBy(XMVector, XMVector, XMVector, XMVector, XMVector, XMVector)
Tests whether the BoundingOrientedBox is contained by a frustum.
Declaration
public ContainmentType ContainedBy(XMVector plane0, XMVector plane1, XMVector plane2, XMVector plane3, XMVector plane4, XMVector plane5)
Parameters
Type | Name | Description |
---|---|---|
XMVector | plane0 | The first plane describing the frustum. |
XMVector | plane1 | The second plane describing the frustum. |
XMVector | plane2 | The third plane describing the frustum. |
XMVector | plane3 | The fourth plane describing the frustum. |
XMVector | plane4 | The fifth plane describing the frustum. |
XMVector | plane5 | The sixth plane describing the frustum. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the frustum contains the BoundingOrientedBox. |
ContainedBy(XMVector[])
Tests whether the BoundingOrientedBox is contained by a frustum.
Declaration
public ContainmentType ContainedBy(XMVector[] planes)
Parameters
Type | Name | Description |
---|---|---|
XMVector[] | planes | The planes describing the frustum. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the frustum contains the BoundingOrientedBox. |
Contains(BoundingBox)
Tests whether the BoundingOrientedBox contains a BoundingBox.
Declaration
public ContainmentType Contains(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to test against. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the BoundingBox is contained in the BoundingOrientedBox. |
Contains(BoundingFrustum)
Tests whether the BoundingOrientedBox contains a BoundingFrustum.
Declaration
public ContainmentType Contains(BoundingFrustum fr)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | fr | The BoundingFrustum to test against. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the BoundingFrustum is contained in the BoundingOrientedBox. |
Contains(BoundingOrientedBox)
Tests whether the BoundingOrientedBox contains a BoundingOrientedBox.
Declaration
public ContainmentType Contains(BoundingOrientedBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingOrientedBox | box | The BoundingOrientedBox to test against. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the BoundingOrientedBox is contained in the BoundingOrientedBox. |
Contains(BoundingSphere)
Tests whether the BoundingOrientedBox contains a BoundingSphere.
Declaration
public ContainmentType Contains(BoundingSphere sh)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sh | The BoundingSphere to test against. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether the BoundingSphere is contained in the BoundingOrientedBox. |
Contains(XMVector)
Tests whether the BoundingOrientedBox contains a specified point.
Declaration
public ContainmentType Contains(XMVector point)
Parameters
Type | Name | Description |
---|---|---|
XMVector | point | The point to test against. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether point is contained in the BoundingOrientedBox. |
Contains(XMVector, XMVector, XMVector)
Tests whether the BoundingOrientedBox contains a triangle.
Declaration
public ContainmentType Contains(XMVector v0, XMVector v1, XMVector v2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | v0 | The first vector describing the triangle. |
XMVector | v1 | The second vector describing the triangle. |
XMVector | v2 | The third vector describing the triangle. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType indicating whether triangle is contained in the BoundingOrientedBox. |
CreateFromBox(BoundingBox)
Creates a BoundingOrientedBox from a BoundingBox.
Declaration
public static BoundingOrientedBox CreateFromBox(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox the BoundingOrientedBox should contain. |
Returns
Type | Description |
---|---|
BoundingOrientedBox | The new BoundingOrientedBox. |
CreateFromPoints(XMFloat3[])
Creates a BoundingOrientedBox from a collection of points.
Declaration
public static BoundingOrientedBox CreateFromPoints(XMFloat3[] points)
Parameters
Type | Name | Description |
---|---|---|
XMFloat3[] | points | The points to create the BoundingOrientedBox from. |
Returns
Type | Description |
---|---|
BoundingOrientedBox | The new BoundingOrientedBox containing the specified points. |
Equals(BoundingOrientedBox)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(BoundingOrientedBox other)
Parameters
Type | Name | Description |
---|---|---|
BoundingOrientedBox | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetCorners()
Retrieves the corners of the BoundingOrientedBox.
Declaration
public XMFloat3[] GetCorners()
Returns
Type | Description |
---|---|
XMFloat3[] | The corners. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceIntersects(BoundingBox)
Tests the BoundingOrientedBox for intersection with a BoundingBox.
Declaration
public bool Intersects(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to test for intersection. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the BoundingBox. |
Intersects(BoundingFrustum)
Tests the BoundingOrientedBox for intersection with a BoundingFrustum.
Declaration
public bool Intersects(BoundingFrustum fr)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | fr | The BoundingFrustum to test for intersection. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the BoundingFrustum. |
Intersects(BoundingOrientedBox)
Tests the BoundingOrientedBox for intersection with a BoundingOrientedBox.
Declaration
public bool Intersects(BoundingOrientedBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingOrientedBox | box | The BoundingOrientedBox to test for intersection. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the BoundingOrientedBox. |
Intersects(BoundingSphere)
Tests the BoundingOrientedBox for intersection with a BoundingSphere.
Declaration
public bool Intersects(BoundingSphere sh)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sh | The BoundingSphere to test for intersection. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the BoundingSphere. |
Intersects(XMVector)
Tests the BoundingOrientedBox for intersection with a plane.
Declaration
public PlaneIntersectionType Intersects(XMVector plane)
Parameters
Type | Name | Description |
---|---|---|
XMVector | plane | A vector describing the plane. |
Returns
Type | Description |
---|---|
PlaneIntersectionType | A PlaneIntersectionType value indicating the intersection status. |
Intersects(XMVector, XMVector)
Tests the BoundingOrientedBox for intersection with a ray.
Declaration
public bool Intersects(XMVector origin, XMVector direction)
Parameters
Type | Name | Description |
---|---|---|
XMVector | origin | The origin of the ray. |
XMVector | direction | The direction of the ray. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the ray. |
Intersects(XMVector, XMVector, XMVector)
Tests the BoundingOrientedBox for intersection with a triangle.
Declaration
public bool Intersects(XMVector v0, XMVector v1, XMVector v2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | v0 | The first vector describing the triangle. |
XMVector | v1 | The second vector describing the triangle. |
XMVector | v2 | The third vector describing the triangle. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the triangle. |
Intersects(XMVector, XMVector, out float)
Tests the BoundingOrientedBox for intersection with a ray.
Declaration
public bool Intersects(XMVector origin, XMVector direction, out float distance)
Parameters
Type | Name | Description |
---|---|---|
XMVector | origin | The origin of the ray. |
XMVector | direction | The direction of the ray. |
float | distance | The length of the ray. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the BoundingOrientedBox intersects the ray. |
Transform(XMMatrix)
Transforms the BoundingOrientedBox.
Declaration
public BoundingOrientedBox Transform(XMMatrix m)
Parameters
Type | Name | Description |
---|---|---|
XMMatrix | m | The matrix to transform the BoundingOrientedBox with. |
Returns
Type | Description |
---|---|
BoundingOrientedBox | The transformed BoundingOrientedBox. |
Transform(float, XMVector, XMVector)
Transforms the BoundingOrientedBox.
Declaration
public BoundingOrientedBox Transform(float scale, XMVector rotation, XMVector translation)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The value to scale the BoundingOrientedBox by. |
XMVector | rotation | The value to rotate the BoundingOrientedBox by. |
XMVector | translation | The value to translate the BoundingOrientedBox by. |
Returns
Type | Description |
---|---|
BoundingOrientedBox | The transformed BoundingOrientedBox. |
Operators
| Edit this page View Sourceoperator ==(BoundingOrientedBox, BoundingOrientedBox)
Compares two BoundingOrientedBox objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(BoundingOrientedBox left, BoundingOrientedBox right)
Parameters
Type | Name | Description |
---|---|---|
BoundingOrientedBox | left | The left BoundingOrientedBox to compare. |
BoundingOrientedBox | right | The right BoundingOrientedBox to compare. |
Returns
Type | Description |
---|---|
bool |
operator !=(BoundingOrientedBox, BoundingOrientedBox)
Compares two BoundingOrientedBox objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(BoundingOrientedBox left, BoundingOrientedBox right)
Parameters
Type | Name | Description |
---|---|---|
BoundingOrientedBox | left | The left BoundingOrientedBox to compare. |
BoundingOrientedBox | right | The right BoundingOrientedBox to compare. |
Returns
Type | Description |
---|---|
bool |