Struct oxygengine_navigation::resources::NavVec3
source · #[repr(C)]pub struct NavVec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
Fields§
§x: f32
§y: f32
§z: f32
Implementations§
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<NavVec3>>::Epsilon
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
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
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 nth_mut(&mut self, index: usize) -> &mut <NavVec3 as PointN>::Scalar
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
fn from_value(value: <NavVec3 as PointN>::Scalar) -> NavVec3
Creates a new point with all components set to a certain value.
source§fn default_max_relative() -> <NavVec3 as AbsDiffEq<NavVec3>>::Epsilon
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
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
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§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§unsafe fn finalize_raw(data: *mut ())
unsafe fn finalize_raw(data: *mut ())
Safety Read more
fn initialize(&mut self)
§unsafe fn initialize_raw(data: *mut ())
unsafe fn initialize_raw(data: *mut ())
Safety Read more
§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
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.