NavVec3

Struct NavVec3 

Source
#[repr(C)]
pub struct NavVec3 { pub x: f32, pub y: f32, pub z: f32, }

Fields§

§x: f32§y: f32§z: f32

Implementations§

Source§

impl NavVec3

Source

pub fn new(x: f32, y: f32, z: f32) -> NavVec3

Source

pub fn sqr_magnitude(self) -> f32

Source

pub fn magnitude(self) -> f32

Source

pub fn same_as(self, other: NavVec3) -> bool

Source

pub fn cross(self, other: NavVec3) -> NavVec3

Source

pub fn dot(self, other: NavVec3) -> f32

Source

pub fn normalize(self) -> NavVec3

Source

pub fn abs(self) -> NavVec3

Source

pub fn lerp(self, other: NavVec3, factor: f32) -> NavVec3

Source

pub fn project(self, from: NavVec3, to: NavVec3) -> f32

Source

pub fn unproject(from: NavVec3, to: NavVec3, t: f32) -> NavVec3

Source

pub fn min(self, other: NavVec3) -> NavVec3

Source

pub fn max(self, other: NavVec3) -> NavVec3

Source

pub fn distance_to_plane(self, origin: NavVec3, normal: NavVec3) -> f32

Source

pub fn is_above_plane(self, origin: NavVec3, normal: NavVec3) -> bool

Source

pub fn project_on_plane(self, origin: NavVec3, normal: NavVec3) -> NavVec3

Source

pub fn raycast_plane( from: NavVec3, to: NavVec3, origin: NavVec3, normal: NavVec3, ) -> Option<NavVec3>

Source

pub fn raycast_line( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> Option<NavVec3>

Source

pub fn raycast_line_exact( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> Option<NavVec3>

Source

pub fn raycast_triangle( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, c: NavVec3, ) -> Option<NavVec3>

Source

pub fn planes_intersection( p1: NavVec3, n1: NavVec3, p2: NavVec3, n2: NavVec3, ) -> Option<(NavVec3, NavVec3)>

line: (origin, normal)

Source

pub fn is_line_between_points( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> bool

Trait Implementations§

Source§

impl AbsDiffEq for NavVec3

Source§

type Epsilon = <f32 as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> <NavVec3 as AbsDiffEq>::Epsilon

The default tolerance to use when testing values that are close together. Read more
Source§

fn abs_diff_eq( &self, other: &NavVec3, epsilon: <NavVec3 as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl Add<f32> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> NavVec3

Performs the + operation. Read more
Source§

impl Add for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the + operator.
Source§

fn add(self, other: NavVec3) -> NavVec3

Performs the + operation. Read more
Source§

impl Clone for NavVec3

Source§

fn clone(&self) -> NavVec3

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 NavVec3

Source§

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

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

impl Default for NavVec3

Source§

fn default() -> NavVec3

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

impl<'de> Deserialize<'de> for NavVec3

Source§

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

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

impl Div<f32> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> NavVec3

Performs the / operation. Read more
Source§

impl Div for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the / operator.
Source§

fn div(self, other: NavVec3) -> NavVec3

Performs the / operation. Read more
Source§

impl From<[f32; 2]> for NavVec3

Source§

fn from(value: [f32; 2]) -> NavVec3

Converts to this type from the input type.
Source§

impl From<[f32; 3]> for NavVec3

Source§

fn from(value: [f32; 3]) -> NavVec3

Converts to this type from the input type.
Source§

impl From<(f32, f32)> for NavVec3

Source§

fn from(value: (f32, f32)) -> NavVec3

Converts to this type from the input type.
Source§

impl From<(f32, f32, f32)> for NavVec3

Source§

fn from(value: (f32, f32, f32)) -> NavVec3

Converts to this type from the input type.
Source§

impl Mul<f32> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> NavVec3

Performs the * operation. Read more
Source§

impl Mul for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the * operator.
Source§

fn mul(self, other: NavVec3) -> NavVec3

Performs the * operation. Read more
Source§

impl Neg for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the - operator.
Source§

fn neg(self) -> NavVec3

Performs the unary - operation. Read more
Source§

impl PartialEq for NavVec3

Source§

fn eq(&self, other: &NavVec3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PointN for NavVec3

Source§

type Scalar = f32

The points’s internal scalar type.
Source§

fn dimensions() -> usize

The (fixed) number of dimensions of this point type.
Source§

fn nth(&self, index: usize) -> &<NavVec3 as PointN>::Scalar

Returns the nth element of this point.
Source§

fn nth_mut(&mut self, index: usize) -> &mut <NavVec3 as PointN>::Scalar

Returns a mutable reference to the nth element of this point.
Source§

fn from_value(value: <NavVec3 as PointN>::Scalar) -> NavVec3

Creates a new point with all components set to a certain value.
Source§

impl RelativeEq for NavVec3

Source§

fn default_max_relative() -> <NavVec3 as AbsDiffEq>::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Source§

fn relative_eq( &self, other: &NavVec3, epsilon: <NavVec3 as AbsDiffEq>::Epsilon, max_relative: <NavVec3 as AbsDiffEq>::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Source§

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Source§

impl Serialize for NavVec3

Source§

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

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

impl Sub<f32> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> NavVec3

Performs the - operation. Read more
Source§

impl Sub for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the - operator.
Source§

fn sub(self, other: NavVec3) -> NavVec3

Performs the - operation. Read more
Source§

impl UlpsEq for NavVec3

Source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
Source§

fn ulps_eq( &self, other: &NavVec3, epsilon: <NavVec3 as AbsDiffEq>::Epsilon, max_ulps: u32, ) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
Source§

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
Source§

impl Copy for NavVec3

Source§

impl StructuralPartialEq for NavVec3

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

Source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<V> HasPosition for V
where V: PointN,

Source§

type Point = V

The object’s point type
Source§

fn position(&self) -> V

Return’s the object’s position.
Source§

impl<T> Initialize for T
where T: Default,

Source§

fn initialize(&mut self)

Source§

unsafe fn initialize_raw(data: *mut ())

Safety Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: Copy + PartialEq + Debug + Any,

Source§

fn is<T>() -> bool
where T: Scalar,

Tests if Self the same as the type T Read more
Source§

impl<S> SpatialObject for S
where S: HasPosition,

Source§

type Point = <S as HasPosition>::Point

The object’s point type.
Source§

fn mbr(&self) -> BoundingRect<<S as HasPosition>::Point>

Returns the object’s minimal bounding rectangle. Read more
Source§

fn distance2( &self, point: &<S as HasPosition>::Point, ) -> <<S as HasPosition>::Point as PointN>::Scalar

Returns the squared euclidean distance from the object’s contour. Returns a value samller than zero if the point is contained within the object.
Source§

fn contains(&self, point: &<S as HasPosition>::Point) -> bool

Returns true if a given point is contained in this object.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<T> Component for T
where T: Send + Sync + 'static,

Source§

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