Struct BoundingBox

Source
#[repr(C)]
pub struct BoundingBox { pub Center: XMFLOAT3, pub Extents: XMFLOAT3, }
Expand description

Fields§

§Center: XMFLOAT3§Extents: XMFLOAT3

Implementations§

Source§

impl BoundingBox

Source

pub const CORNER_COUNT: usize = 8usize

Source

pub fn GetCorners(&self, Corners: &mut [XMFLOAT3; 8])

Source

pub fn TransformMatrix(&self, Out: &mut Self, M: FXMMATRIX)

Transforms the BoundingBox by the specified transformation matrix..

§Parameters

Out The transformed BoundingBox.

M The matrix to transform the BoundingBox by.

§Return value

None

§Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-transform

Source

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

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-transform(BoundingBox__float_fxmvector_fxmvector)

Source

pub fn ContainsPoint(&self, Point: FXMVECTOR) -> ContainmentType

Tests the whether the BoundingBox contains a specified point.

§Parameters

Point The point to test against.

§Return value

A ContainmentType value indicating whether the point is contained in the BoundingBox.

§Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-contains

Source

pub fn ContainsTriangle( &self, V0: FXMVECTOR, V1: FXMVECTOR, V2: FXMVECTOR, ) -> ContainmentType

Test whether the BoundingBox contains a specified triangle.

§Parameters

V0 A corner of the triangle.

V1 A corner of the triangle.

V2 A corner of the triangle.

§Return value

A ContainmentType value indicating whether the BoundingBox contains the specified triangle.

§Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-contains(fxmvector_fxmvector_fxmvector)

Source

pub fn ContainsSphere(&self, sh: &BoundingSphere) -> ContainmentType

Source

pub fn ContainsBox(&self, box_: &BoundingBox) -> ContainmentType

Source

pub fn ContainsOrientedBox(&self, box_: &BoundingOrientedBox) -> ContainmentType

Source

pub fn ContainsFrustum(&self, fr: &BoundingFrustum) -> ContainmentType

Source

pub fn IntersectsSphere(&self, sh: &BoundingSphere) -> bool

Source

pub fn IntersectsBox(&self, box_: &BoundingBox) -> bool

Source

pub fn IntersectsOrientedBox(&self, box_: &BoundingOrientedBox) -> bool

Source

pub fn IntersectsFrustum(&self, fr: &BoundingFrustum) -> bool

Source

pub fn IntersectsTriangle( &self, V0: FXMVECTOR, V1: FXMVECTOR, V2: FXMVECTOR, ) -> bool

Tests the BoundingSphere for intersection with a triangle.

§Parameters

V0 A vector describing the triangle.

V1 A vector describing the triangle.

V2 A vector describing the triangle.

§Return value

A bool value indicating whether the BoundingBox intersects the triangle.

§Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-intersects(fxmvector_fxmvector_fxmvector)

Source

pub fn IntersectsPlane(&self, Plane: FXMVECTOR) -> PlaneIntersectionType

Tests the BoundingBox for intersection with a Plane.

§Parameters

Plane A vector describing the plane coefficients (A, B, C, D) for the plane equation Ax+By+Cz+D=0.

§Return value

A PlaneIntersectionType value indicating whether the BoundingSphere intersects the specified plane.

§Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-intersects(fxmvector)

Source

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

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-intersects(fxmvector_fxmvector_float_)

Source

pub fn ContainedBy( &self, Plane0: FXMVECTOR, Plane1: FXMVECTOR, Plane2: GXMVECTOR, Plane3: HXMVECTOR, Plane4: HXMVECTOR, Plane5: HXMVECTOR, ) -> ContainmentType

Source

pub fn CreateMerged(Out: &mut Self, b1: &Self, b2: &Self)

Creates a BoundingBox that contains the two specified BoundingBox objects.

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-BoundingBox-createmerged

Source

pub fn CreateFromSphere(Out: &mut Self, sh: &BoundingSphere)

Creates a BoundingBox large enough to contain the a specified BoundingSphere.

https://docs.microsoft.com/en-us/windows/win32/api/directxcollision/nf-directxcollision-boundingbox-createfromsphere

Source

pub fn CreateFromPoints<'a>( Out: &mut Self, pPoints: impl Iterator<Item = &'a XMFLOAT3>, )

Trait Implementations§

Source§

impl Clone for BoundingBox

Source§

fn clone(&self) -> BoundingBox

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BoundingBox

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BoundingBox

Source§

fn default() -> BoundingBox

Returns the “default value” for a type. Read more
Source§

impl Copy for BoundingBox

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.