Struct mathf::vector3::Vector3
[−]
[src]
pub struct Vector3 { pub x: f32, pub y: f32, pub z: f32, }
A 3D Vector with x, y, z coordinates: Vector3
Fields
x: f32
y: f32
z: f32
Methods
impl Vector3
[src]
fn new(x: f32, y: f32, z: f32) -> Vector3
[src]
Instantiates a new vector with to be defined values of x, y, z;
fn diff(origin: Point3, destination: Point3) -> Vector3
[src]
Instantiates a new Vector3 from 2 Point3 (initial position, final position). The new vector is created as final - initial (Points)
fn UP() -> Vector3
[src]
Defines a Vector with UP direction (y=1, x=0, z=0)
fn DOWN() -> Vector3
[src]
Defines a Vector with DOWN direction (y=-1, x=0, z=0)
fn RIGHT() -> Vector3
[src]
Defines a Vector with RIGHT direction (y=0, x=1, z=0)
fn LEFT() -> Vector3
[src]
Defines a Vector with LEFT direction (y=0, x=-1, z=0)
fn FOWARD() -> Vector3
[src]
Defines a Vector with FOWARD direction (y=0, x=0, z=1)
fn BACK() -> Vector3
[src]
Defines a Vector with BACK direction (y=0, x=0, z=-1)
fn ONE() -> Vector3
[src]
Defines a 3D Vector with x=1, y=1, z=1
fn ZERO() -> Vector3
[src]
Defines a Modulus ZERO Vector (x=0, y=0, z=0)
fn magnitude(self) -> f32
[src]
Vector magnitude: the square root of the sum of each vector part to the power of 2
fn x(self, vec: Vector3) -> Vector3
[src]
Crooss product between two vectors 3.
Trait Implementations
impl Clone for Vector3
[src]
fn clone(&self) -> Vector3
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Vector3
[src]
fn eq(&self, __arg_0: &Vector3) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector3) -> bool
[src]
This method tests for !=
.
impl Debug for Vector3
[src]
impl Add for Vector3
[src]
type Output = Vector3
The resulting type after applying the +
operator.
fn add(self, new_vec: Vector3) -> Vector3
[src]
Implements the Vector3 '+' trait
impl Mul<f32> for Vector3
[src]
type Output = Vector3
The resulting type after applying the *
operator.
fn mul(self, value: f32) -> Vector3
[src]
Implements the scalar multiplication of a Vector3 with a f32. Other numbers should be passed with 'i as f32'
impl Mul<Vector3> for Vector3
[src]
type Output = f32
The resulting type after applying the *
operator.
fn mul(self, new_vec: Vector3) -> f32
[src]
Implements the dot product of 2 Vector3 as '*'.