#[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<NavVec3> for NavVec3

§

type Epsilon = <f32 as AbsDiffEq<f32>>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> <NavVec3 as AbsDiffEq<NavVec3>>::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<NavVec3>>::Epsilon ) -> bool

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

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

The inverse of [AbsDiffEq::abs_diff_eq].
source§

impl Add<NavVec3> for NavVec3

§

type Output = NavVec3

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<f32> for NavVec3

§

type Output = NavVec3

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Clone for NavVec3

source§

fn clone(&self) -> NavVec3

Returns a copy 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<NavVec3> for NavVec3

§

type Output = NavVec3

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<f32> for NavVec3

§

type Output = NavVec3

The resulting type after applying the / operator.
source§

fn div(self, other: f32) -> 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<NavVec3> for NavVec3

§

type Output = NavVec3

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<f32> for NavVec3

§

type Output = NavVec3

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Neg for NavVec3

§

type Output = NavVec3

The resulting type after applying the - operator.
source§

fn neg(self) -> NavVec3

Performs the unary - operation. Read more
source§

impl PartialEq<NavVec3> for NavVec3

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PointN for NavVec3

§

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<NavVec3> for NavVec3

source§

fn default_max_relative() -> <NavVec3 as AbsDiffEq<NavVec3>>::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<NavVec3>>::Epsilon, max_relative: <NavVec3 as AbsDiffEq<NavVec3>>::Epsilon ) -> bool

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

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<NavVec3> for NavVec3

§

type Output = NavVec3

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<f32> for NavVec3

§

type Output = NavVec3

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl UlpsEq<NavVec3> 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<NavVec3>>::Epsilon, max_ulps: u32 ) -> bool

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

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

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.

§

impl<V> HasPosition for Vwhere V: PointN,

§

type Point = V

The object’s point type
§

fn position(&self) -> V

Return’s the object’s position.
§

impl<T> Initialize for Twhere T: Default,

§

fn initialize(&mut self)

§

unsafe fn initialize_raw(data: *mut ())

Safety Read more
source§

impl<T, U> Into<U> for Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

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

source§

fn is<T>() -> boolwhere T: Scalar,

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

impl<S> SpatialObject for Swhere S: HasPosition,

§

type Point = <S as HasPosition>::Point

The object’s point type.
§

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

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

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.
§

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

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

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

§

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

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

fn is_in_subset(&self) -> bool

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

unsafe fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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

source§

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