Skip to main content

NavVec3

Struct NavVec3 

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

Fields§

§x: Scalar§y: Scalar§z: Scalar

Implementations§

Source§

impl NavVec3

Source

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

Source

pub fn sqr_magnitude(self) -> Scalar

Source

pub fn magnitude(self) -> Scalar

Source

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

Source

pub fn dot(self, other: Self) -> Scalar

Source

pub fn normalize(self) -> Self

Source

pub fn project(self, from: Self, to: Self) -> Scalar

Source

pub fn unproject(from: Self, to: Self, t: Scalar) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Add for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<f64> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the + operator.
Source§

fn add(self, other: Scalar) -> Self

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 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for NavVec3

Source§

impl Debug for NavVec3

Source§

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

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<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl Div for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl Div<f64> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the / operator.
Source§

fn div(self, other: Scalar) -> Self

Performs the / operation. Read more
Source§

impl From<(f64, f64)> for NavVec3

Source§

fn from(value: (Scalar, Scalar)) -> Self

Converts to this type from the input type.
Source§

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

Source§

fn from(value: (Scalar, Scalar, Scalar)) -> Self

Converts to this type from the input type.
Source§

impl Mul for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<f64> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the * operator.
Source§

fn mul(self, other: Scalar) -> Self

Performs the * 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 (const: unstable) · 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 = f64

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) -> &Self::Scalar

Returns the nth element of this point.
Source§

fn nth_mut(&mut self, index: usize) -> &mut Self::Scalar

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

fn from_value(value: Self::Scalar) -> Self

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

impl Serialize for NavVec3

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

Source§

impl Sub for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<f64> for NavVec3

Source§

type Output = NavVec3

The resulting type after applying the - operator.
Source§

fn sub(self, other: Scalar) -> Self

Performs the - operation. Read more

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> Any for T
where T: Any,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Erased for T

Source§

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

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, 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> Resource for T
where T: Any + Send + Sync,

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> TryDefault for T
where T: Default,

Source§

fn try_default() -> Result<T, String>

Tries to create the default.
Source§

fn unwrap_default() -> Self

Calls try_default and panics on an error case.
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.