pub struct Vector3 {
pub x: Float,
pub y: Float,
pub z: Float,
}Fields§
§x: Float§y: Float§z: FloatImplementations§
Source§impl Vector3
impl Vector3
pub fn new(x: Float, y: Float, z: Float) -> Vector3
pub fn length(&self) -> Float
pub fn normalize(&mut self)
pub fn cross(&self, b: &Vector3) -> Vector3
pub fn distance(&self, b: &Vector3) -> Float
pub fn angle(&self, b: &Vector3) -> Float
pub fn project_on(&self, b: &Vector3) -> Vector3
pub fn retrieve_rotation(&self, origin: f64) -> Matrix4
pub fn apply(&mut self, f: fn(f64) -> f64)
pub fn rand(max: Float) -> Vector3
Trait Implementations§
Source§impl AddAssign for Vector3
impl AddAssign for Vector3
Source§fn add_assign(&mut self, b: Vector3)
fn add_assign(&mut self, b: Vector3)
Performs the
+= operation. Read moreSource§impl DivAssign<f64> for Vector3
impl DivAssign<f64> for Vector3
Source§fn div_assign(&mut self, s: Float)
fn div_assign(&mut self, s: Float)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Vector3
impl MulAssign<f64> for Vector3
Source§fn mul_assign(&mut self, s: Float)
fn mul_assign(&mut self, s: Float)
Performs the
*= operation. Read moreSource§impl MulAssign for Vector3
impl MulAssign for Vector3
Source§fn mul_assign(&mut self, b: Vector3)
fn mul_assign(&mut self, b: Vector3)
Performs the
*= operation. Read moreSource§impl SubAssign for Vector3
impl SubAssign for Vector3
Source§fn sub_assign(&mut self, b: Vector3)
fn sub_assign(&mut self, b: Vector3)
Performs the
-= operation. Read moreimpl Copy for Vector3
impl Eq 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