Skip to main content

AabbVector

Trait AabbVector 

Source
pub trait AabbVector:
    Copy
    + Add<Output = Self>
    + Sub<Output = Self> {
    type Scalar: Copy + PartialOrd + Add<Output = Self::Scalar> + Sub<Output = Self::Scalar> + Div<Output = Self::Scalar> + Neg<Output = Self::Scalar> + From<u8>;

    // Required methods
    fn new(x: Self::Scalar, y: Self::Scalar, z: Self::Scalar) -> Self;
    fn x(self) -> Self::Scalar;
    fn y(self) -> Self::Scalar;
    fn z(self) -> Self::Scalar;
    fn min(self, other: Self) -> Self;
    fn max(self, other: Self) -> Self;
}
Expand description

Vector operations used by generic AABB helpers.

Required Associated Types§

Source

type Scalar: Copy + PartialOrd + Add<Output = Self::Scalar> + Sub<Output = Self::Scalar> + Div<Output = Self::Scalar> + Neg<Output = Self::Scalar> + From<u8>

Scalar component type.

Required Methods§

Source

fn new(x: Self::Scalar, y: Self::Scalar, z: Self::Scalar) -> Self

Creates a vector from individual components.

Source

fn x(self) -> Self::Scalar

X component.

Source

fn y(self) -> Self::Scalar

Y component.

Source

fn z(self) -> Self::Scalar

Z component.

Source

fn min(self, other: Self) -> Self

Per-component minimum.

Source

fn max(self, other: Self) -> Self

Per-component maximum.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AabbVector for DVec3

Source§

type Scalar = f64

Source§

fn new(x: Self::Scalar, y: Self::Scalar, z: Self::Scalar) -> Self

Source§

fn x(self) -> Self::Scalar

Source§

fn y(self) -> Self::Scalar

Source§

fn z(self) -> Self::Scalar

Source§

fn min(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

impl AabbVector for IVec3

Source§

type Scalar = i32

Source§

fn new(x: Self::Scalar, y: Self::Scalar, z: Self::Scalar) -> Self

Source§

fn x(self) -> Self::Scalar

Source§

fn y(self) -> Self::Scalar

Source§

fn z(self) -> Self::Scalar

Source§

fn min(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Implementors§