Skip to main content

BBox

Struct BBox 

Source
pub struct BBox<P: Copy + Debug + 'static> {
    pub min: P,
    pub max: P,
}
Expand description

An axis-aligned bounding box; the point type carries the dimension.

This is a scalar type; for large batches (e.g. detection anchors) consider an SoA layout so bulk operations vectorize (see cu29_soa_derive).

Fields§

§min: P§max: P

Implementations§

Source§

impl<P: Copy + Debug + 'static> BBox<P>

Source

pub const fn new(min: P, max: P) -> Self

Source§

impl<L: Copy + Debug + PartialOrd + 'static> BBox<Point2<L>>

Source

pub fn contains(&self, p: Point2<L>) -> bool

True when p lies inside the box, boundary included.

Source

pub fn contains_points<const N: usize>( &self, points: &Point2Soa<L, N>, out: &mut [bool], )

contains for every point in the set, written to out[..len].

§Panics

If out is shorter than points.len().

Source§

impl<L: Copy + Debug + PartialOrd + 'static> BBox<Point3<L>>

Source

pub fn contains(&self, p: Point3<L>) -> bool

True when p lies inside the box, boundary included.

Source

pub fn contains_points<const N: usize>( &self, points: &Point3Soa<L, N>, out: &mut [bool], )

contains for every point in the set, written to out[..len].

§Panics

If out is shorter than points.len().

Trait Implementations§

Source§

impl<'__de, P, __Context> BorrowDecode<'__de, __Context> for BBox<P>
where P: BorrowDecode<'__de, __Context> + Copy + Debug + 'static,

Source§

fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
Source§

impl<P: Clone + Copy + Debug + 'static> Clone for BBox<P>

Source§

fn clone(&self) -> BBox<P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<P: Copy + Copy + Debug + 'static> Copy for BBox<P>

Source§

impl<P: Debug + Copy + Debug + 'static> Debug for BBox<P>

Source§

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

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

impl<P, __Context> Decode<__Context> for BBox<P>
where P: Decode<__Context> + Copy + Debug + 'static,

Source§

fn decode<__D: Decoder<Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl<P: Default + Copy + Debug + 'static> Default for BBox<P>

Source§

fn default() -> BBox<P>

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

impl<'de, P> Deserialize<'de> for BBox<P>
where P: Deserialize<'de> + Copy + Debug + 'static,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<P> Encode for BBox<P>
where P: Encode + Copy + Debug + 'static,

Source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
Source§

impl<P: PartialEq + Copy + Debug + 'static> PartialEq for BBox<P>

Source§

fn eq(&self, other: &BBox<P>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<P> Serialize for BBox<P>
where P: Serialize + Copy + Debug + 'static,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<P: PartialEq + Copy + Debug + 'static> StructuralPartialEq for BBox<P>

Source§

impl<P: Copy + Debug + 'static> TypePath for BBox<P>

Source§

fn type_path() -> &'static str

Source§

fn short_type_path() -> &'static str

Source§

fn type_ident() -> Option<&'static str>

Source§

fn crate_name() -> Option<&'static str>

Source§

fn module_path() -> Option<&'static str>

Auto Trait Implementations§

§

impl<P> Freeze for BBox<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for BBox<P>
where P: RefUnwindSafe,

§

impl<P> Send for BBox<P>
where P: Send,

§

impl<P> Sync for BBox<P>
where P: Sync,

§

impl<P> Unpin for BBox<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for BBox<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for BBox<P>
where P: UnwindSafe,

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> CuMsgPayload for T

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetTypeRegistration for T

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> Reflect for T
where T: 'static,

Source§

impl<T> ReflectTypePath for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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.