#[repr(C)]pub struct NavVec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Fields§
§x: f32§y: f32§z: f32Implementations§
pub fn new(x: f32, y: f32, z: f32) -> NavVec3
pub fn sqr_magnitude(self) -> f32
pub fn magnitude(self) -> f32
pub fn same_as(self, other: NavVec3) -> bool
pub fn cross(self, other: NavVec3) -> NavVec3
pub fn dot(self, other: NavVec3) -> f32
pub fn normalize(self) -> NavVec3
pub fn abs(self) -> NavVec3
pub fn lerp(self, other: NavVec3, factor: f32) -> NavVec3
pub fn project(self, from: NavVec3, to: NavVec3) -> f32
pub fn unproject(from: NavVec3, to: NavVec3, t: f32) -> NavVec3
pub fn min(self, other: NavVec3) -> NavVec3
pub fn max(self, other: NavVec3) -> NavVec3
pub fn distance_to_plane(self, origin: NavVec3, normal: NavVec3) -> f32
pub fn is_above_plane(self, origin: NavVec3, normal: NavVec3) -> bool
pub fn project_on_plane(self, origin: NavVec3, normal: NavVec3) -> NavVec3
pub fn raycast_plane( from: NavVec3, to: NavVec3, origin: NavVec3, normal: NavVec3, ) -> Option<NavVec3>
pub fn raycast_line( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> Option<NavVec3>
pub fn raycast_line_exact( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> Option<NavVec3>
pub fn raycast_triangle( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, c: NavVec3, ) -> Option<NavVec3>
Sourcepub fn planes_intersection(
p1: NavVec3,
n1: NavVec3,
p2: NavVec3,
n2: NavVec3,
) -> Option<(NavVec3, NavVec3)>
pub fn planes_intersection( p1: NavVec3, n1: NavVec3, p2: NavVec3, n2: NavVec3, ) -> Option<(NavVec3, NavVec3)>
line: (origin, normal)
pub fn is_line_between_points( from: NavVec3, to: NavVec3, a: NavVec3, b: NavVec3, normal: NavVec3, ) -> bool
Trait Implementations§
Source§fn default_epsilon() -> <NavVec3 as AbsDiffEq>::Epsilon
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
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
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NavVec3, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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§fn dimensions() -> usize
fn dimensions() -> usize
The (fixed) number of dimensions of this point type.
Source§fn nth(&self, index: usize) -> &<NavVec3 as PointN>::Scalar
fn nth(&self, index: usize) -> &<NavVec3 as PointN>::Scalar
Returns the nth element of this point.
Source§fn default_max_relative() -> <NavVec3 as AbsDiffEq>::Epsilon
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
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
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<V> HasPosition for Vwhere
V: PointN,
impl<V> HasPosition for Vwhere
V: PointN,
Source§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere
T: Default,
fn initialize(&mut self)
Source§impl<S> SpatialObject for Swhere
S: HasPosition,
impl<S> SpatialObject for Swhere
S: HasPosition,
Source§type Point = <S as HasPosition>::Point
type Point = <S as HasPosition>::Point
The object’s point type.
Source§fn mbr(&self) -> BoundingRect<<S as HasPosition>::Point>
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
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.