Expand description
A point in 3D space.
Fields
x: f32
y: f32
z: f32
Implementations
sourceimpl Point
impl Point
sourcepub const fn new(x: f32, y: f32, z: f32) -> Self
pub const fn new(x: f32, y: f32, z: f32) -> Self
Construct new a vector from individual coordinates
sourcepub const fn from_scalar(s: f32) -> Self
pub const fn from_scalar(s: f32) -> Self
Construct new a vector where each coordinate is the same
sourcepub fn lerp(&self, rhs: Self, factor: f32) -> Self
pub fn lerp(&self, rhs: Self, factor: f32) -> Self
Linear interpolation between this vector and another
sourcepub fn min(&self, rhs: Self) -> Self
pub fn min(&self, rhs: Self) -> Self
Compute the element-wise minimum of this vector and another
sourcepub fn max(&self, rhs: Self) -> Self
pub fn max(&self, rhs: Self) -> Self
Compute the element-wise maximum of this vector and another
sourcepub fn magnitude_squared(&self) -> f32
pub fn magnitude_squared(&self) -> f32
The length of this vector squared. Note that this avoids an expensive square root.
sourcepub fn magnitude(&self) -> f32
pub fn magnitude(&self) -> f32
The length of this vector. Note that this involves an expensive square root.
sourcepub fn normalized(&self) -> Self
pub fn normalized(&self) -> Self
Normalize this vector to unit length. Note that this involves an expensive square root.
pub fn as_slice(&self) -> &[f32]
Trait Implementations
sourceimpl AddAssign<Vector3> for Point
impl AddAssign<Vector3> for Point
sourcefn add_assign(&mut self, rhs: Vector3)
fn add_assign(&mut self, rhs: Vector3)
Performs the +=
operation. Read more
sourceimpl AddAssign<f32> for Point
impl AddAssign<f32> for Point
sourcefn add_assign(&mut self, t: f32)
fn add_assign(&mut self, t: f32)
Performs the +=
operation. Read more
sourceimpl DivAssign<f32> for Point
impl DivAssign<f32> for Point
sourcefn div_assign(&mut self, t: f32)
fn div_assign(&mut self, t: f32)
Performs the /=
operation. Read more
sourceimpl MulAssign<f32> for Point
impl MulAssign<f32> for Point
sourcefn mul_assign(&mut self, t: f32)
fn mul_assign(&mut self, t: f32)
Performs the *=
operation. Read more
sourceimpl NearlyEqual for &Point
impl NearlyEqual for &Point
fn nearly_equals(self, rhs: Self) -> bool
sourceimpl SubAssign<Vector3> for Point
impl SubAssign<Vector3> for Point
sourcefn sub_assign(&mut self, rhs: Vector3)
fn sub_assign(&mut self, rhs: Vector3)
Performs the -=
operation. Read more
sourceimpl SubAssign<f32> for Point
impl SubAssign<f32> for Point
sourcefn sub_assign(&mut self, t: f32)
fn sub_assign(&mut self, t: f32)
Performs the -=
operation. Read more
impl Copy for Point
impl StructuralPartialEq for Point
Auto Trait Implementations
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more