pub struct Vector3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
3 component vector, values are stored as doubles (f64)
Fields§
§x: f64§y: f64§z: f64Implementations§
Source§impl Vector3
impl Vector3
pub fn new(x: f64, y: f64, z: f64) -> Self
pub fn set(&mut self, x: f64, y: f64, z: f64)
pub fn set_from_spherical(&mut self, azimuthal_angle: f64, polar_angle: f64)
pub fn set_random_direction(&mut self)
pub fn length(&self) -> f64
pub fn length_squared(&self) -> f64
pub fn distance(&self, other: &Vector3) -> f64
pub fn distance_squared(&self, other: &Vector3) -> f64
pub fn dot(&self, other: &Vector3) -> f64
pub fn cross(&self, other: &Vector3) -> Vector3
pub fn lerp(&mut self, target: &Vector3, alpha: f64)
pub fn nor(&mut self)
pub fn slerp(&mut self, target: &Vector3, alpha: f64)
pub fn copy(&self) -> Self
pub fn add(&mut self, other: &Vector3)
pub fn subtract(&mut self, other: &Vector3)
pub fn multiply(&mut self, other: &Vector3)
pub fn divide(&mut self, other: &Vector3)
pub fn add_scalar(&mut self, scalar: f64)
pub fn subtract_scalar(&mut self, scalar: f64)
pub fn multiply_scalar(&mut self, scalar: f64)
pub fn divide_scalar(&mut self, scalar: f64)
Trait Implementations§
Source§impl AddAssign<f64> for Vector3
impl AddAssign<f64> for Vector3
Source§fn add_assign(&mut self, scalar: f64)
fn add_assign(&mut self, scalar: f64)
Performs the
+= operation. Read moreSource§impl AddAssign for Vector3
impl AddAssign for Vector3
Source§fn add_assign(&mut self, other: Vector3)
fn add_assign(&mut self, other: Vector3)
Performs the
+= operation. Read moreSource§impl DivAssign<f64> for Vector3
impl DivAssign<f64> for Vector3
Source§fn div_assign(&mut self, scalar: f64)
fn div_assign(&mut self, scalar: f64)
Performs the
/= operation. Read moreSource§impl DivAssign for Vector3
impl DivAssign for Vector3
Source§fn div_assign(&mut self, other: Vector3)
fn div_assign(&mut self, other: Vector3)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Vector3
impl MulAssign<f64> for Vector3
Source§fn mul_assign(&mut self, scalar: f64)
fn mul_assign(&mut self, scalar: f64)
Performs the
*= operation. Read moreSource§impl MulAssign for Vector3
impl MulAssign for Vector3
Source§fn mul_assign(&mut self, other: Vector3)
fn mul_assign(&mut self, other: Vector3)
Performs the
*= operation. Read moreSource§impl SubAssign<f64> for Vector3
impl SubAssign<f64> for Vector3
Source§fn sub_assign(&mut self, scalar: f64)
fn sub_assign(&mut self, scalar: f64)
Performs the
-= operation. Read moreSource§impl SubAssign for Vector3
impl SubAssign for Vector3
Source§fn sub_assign(&mut self, other: Vector3)
fn sub_assign(&mut self, other: Vector3)
Performs the
-= operation. Read moreimpl Copy for Vector3
Auto Trait Implementations§
impl Freeze for Vector3
impl RefUnwindSafe for Vector3
impl Send for Vector3
impl Sync for Vector3
impl Unpin for Vector3
impl UnwindSafe for Vector3
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