#[repr(C)]pub struct BoundingBox {
pub Center: XMFLOAT3,
pub Extents: XMFLOAT3,
}Expand description
A bounding axis-aligned object (AABB).
https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/ns-directxcollision-boundingbox
Fields§
§Center: XMFLOAT3§Extents: XMFLOAT3Implementations§
Source§impl BoundingBox
impl BoundingBox
pub const CORNER_COUNT: usize = 8usize
pub fn GetCorners(&self, Corners: &mut [XMFLOAT3; 8])
Sourcepub fn TransformMatrix(&self, Out: &mut Self, M: FXMMATRIX)
pub fn TransformMatrix(&self, Out: &mut Self, M: FXMMATRIX)
Sourcepub fn TransformDecomposed(
&self,
Out: &mut Self,
Scale: f32,
Rotation: FXMVECTOR,
Translation: FXMVECTOR,
)
pub fn TransformDecomposed( &self, Out: &mut Self, Scale: f32, Rotation: FXMVECTOR, Translation: FXMVECTOR, )
Transforms the BoundingBox using the specified scale, rotation and translation vectors.
§Parameters
Out The transformed BoundingBox.
Scale The value to scale the BoundingBox by.
Rotation The value to rotate the BoundingBox by.
Translation The value to translate the BoundingBox by.
§Return value
This method does not return a value.
§Reference
Sourcepub fn ContainsPoint(&self, Point: FXMVECTOR) -> ContainmentType
pub fn ContainsPoint(&self, Point: FXMVECTOR) -> ContainmentType
Sourcepub fn ContainsTriangle(
&self,
V0: FXMVECTOR,
V1: FXMVECTOR,
V2: FXMVECTOR,
) -> ContainmentType
pub fn ContainsTriangle( &self, V0: FXMVECTOR, V1: FXMVECTOR, V2: FXMVECTOR, ) -> ContainmentType
Sourcepub fn ContainsSphere(&self, sh: &BoundingSphere) -> ContainmentType
pub fn ContainsSphere(&self, sh: &BoundingSphere) -> ContainmentType
Tests whether the BoundingBox contains a specified BoundingSphere.
Sourcepub fn ContainsBox(&self, box_: &BoundingBox) -> ContainmentType
pub fn ContainsBox(&self, box_: &BoundingBox) -> ContainmentType
Tests whether the BoundingBox contains a specified BoundingBox.
Sourcepub fn ContainsOrientedBox(&self, box_: &BoundingOrientedBox) -> ContainmentType
pub fn ContainsOrientedBox(&self, box_: &BoundingOrientedBox) -> ContainmentType
Tests whether the BoundingBox contains the specified BoundingOrientedBox.
Sourcepub fn ContainsFrustum(&self, fr: &BoundingFrustum) -> ContainmentType
pub fn ContainsFrustum(&self, fr: &BoundingFrustum) -> ContainmentType
Tests whether the BoundingBox contains the specified BoundingFrustum.
Sourcepub fn IntersectsSphere(&self, sh: &BoundingSphere) -> bool
pub fn IntersectsSphere(&self, sh: &BoundingSphere) -> bool
Tests the BoundingBox for intersection with a BoundingSphere.
Sourcepub fn IntersectsBox(&self, box_: &BoundingBox) -> bool
pub fn IntersectsBox(&self, box_: &BoundingBox) -> bool
Tests the BoundingBox for intersection with a BoundingBox.
Sourcepub fn IntersectsOrientedBox(&self, box_: &BoundingOrientedBox) -> bool
pub fn IntersectsOrientedBox(&self, box_: &BoundingOrientedBox) -> bool
Test the BoundingBox for intersection with a BoundingOrientedBox.
Sourcepub fn IntersectsFrustum(&self, fr: &BoundingFrustum) -> bool
pub fn IntersectsFrustum(&self, fr: &BoundingFrustum) -> bool
Test the BoundingBox for intersection with a BoundingFrustum.
Sourcepub fn IntersectsTriangle(
&self,
V0: FXMVECTOR,
V1: FXMVECTOR,
V2: FXMVECTOR,
) -> bool
pub fn IntersectsTriangle( &self, V0: FXMVECTOR, V1: FXMVECTOR, V2: FXMVECTOR, ) -> bool
Sourcepub fn IntersectsPlane(&self, Plane: FXMVECTOR) -> PlaneIntersectionType
pub fn IntersectsPlane(&self, Plane: FXMVECTOR) -> PlaneIntersectionType
Sourcepub fn IntersectsRay(
&self,
Origin: FXMVECTOR,
Direction: FXMVECTOR,
Dist: &mut f32,
) -> bool
pub fn IntersectsRay( &self, Origin: FXMVECTOR, Direction: FXMVECTOR, Dist: &mut f32, ) -> bool
Tests the BoundingBox for intersection with a ray.
§Parameters
Origin The origin of the ray.
Direction The direction of the ray.
Dist The length of the ray.
§Return value
A bool value indicating whether the BoundingBox intersects the ray.
§Remarks
The distance from the Origin to the nearest intersection point is returned
in Dist when the method returns true. Otherwise, Dist is set to 0.0.
§Reference
Sourcepub fn ContainedBy(
&self,
Plane0: FXMVECTOR,
Plane1: FXMVECTOR,
Plane2: GXMVECTOR,
Plane3: HXMVECTOR,
Plane4: HXMVECTOR,
Plane5: HXMVECTOR,
) -> ContainmentType
pub fn ContainedBy( &self, Plane0: FXMVECTOR, Plane1: FXMVECTOR, Plane2: GXMVECTOR, Plane3: HXMVECTOR, Plane4: HXMVECTOR, Plane5: HXMVECTOR, ) -> ContainmentType
Tests whether the BoundingBox is contained by the specified frustum.
Sourcepub fn CreateMerged(Out: &mut Self, b1: &Self, b2: &Self)
pub fn CreateMerged(Out: &mut Self, b1: &Self, b2: &Self)
Creates a BoundingBox that contains the two specified BoundingBox objects.
Sourcepub fn CreateFromSphere(Out: &mut Self, sh: &BoundingSphere)
pub fn CreateFromSphere(Out: &mut Self, sh: &BoundingSphere)
Creates a BoundingBox large enough to contain the a specified BoundingSphere.
Sourcepub fn CreateFromPoints<'a>(
Out: &mut Self,
pPoints: impl Iterator<Item = &'a XMFLOAT3>,
)
pub fn CreateFromPoints<'a>( Out: &mut Self, pPoints: impl Iterator<Item = &'a XMFLOAT3>, )
Creates a new BoundingBox from a list of points.
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more