Struct matriarch::Vec4 [−][src]
A 4D Vector with elements x, y, z, and w
Fields
x: f32
y: f32
z: f32
w: f32
Methods
impl Vec4
[src]
impl Vec4
pub fn new() -> Vec4
[src]
pub fn new() -> Vec4
Returns a new Vec4 at [0, 0, 0, 0].
pub fn new_from_values(x: &f32, y: &f32, z: &f32, w: &f32) -> Vec4
[src]
pub fn new_from_values(x: &f32, y: &f32, z: &f32, w: &f32) -> Vec4
Returns a new Vec4 using the given values for x, y, z, and w.
pub fn new_from_array(input: &[f32; 4]) -> Vec4
[src]
pub fn new_from_array(input: &[f32; 4]) -> Vec4
Returns a new Vec4 using the 0, 1, 2, and 3 indices of the given array, where [0] -> x, [1] -> y, [2] -> z, and [3] -> w.
pub fn to_array(&self) -> [f32; 4]
[src]
pub fn to_array(&self) -> [f32; 4]
Returns an array of the Vec4's x, y, z, and w values where x -> [0], y -> [1], z -> [2], and w -> [3].
pub fn length(&self) -> f32
[src]
pub fn length(&self) -> f32
Returns the length of the Vec4.
Trait Implementations
impl Mul<Vec4> for Mat4
[src]
impl Mul<Vec4> for Mat4
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, vec4: Vec4) -> Vec4
[src]
fn mul(self, vec4: Vec4) -> Vec4
Performs the *
operation.
impl Clone for Vec4
[src]
impl Clone for Vec4
fn clone(&self) -> Vec4
[src]
fn clone(&self) -> Vec4
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Vec4
[src]
impl Copy for Vec4
impl Debug for Vec4
[src]
impl Debug for Vec4
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Vec4
[src]
impl Default for Vec4
impl PartialEq for Vec4
[src]
impl PartialEq for Vec4
fn eq(&self, other: &Vec4) -> bool
[src]
fn eq(&self, other: &Vec4) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vec4) -> bool
[src]
fn ne(&self, other: &Vec4) -> bool
This method tests for !=
.
impl Add<Vec4> for Vec4
[src]
impl Add<Vec4> for Vec4
type Output = Vec4
The resulting type after applying the +
operator.
fn add(self, other_vec4: Vec4) -> Vec4
[src]
fn add(self, other_vec4: Vec4) -> Vec4
Adds one Vec4 to another Vec4 and returns a new Vec4.
impl AddAssign for Vec4
[src]
impl AddAssign for Vec4
fn add_assign(&mut self, other_vec4: Vec4)
[src]
fn add_assign(&mut self, other_vec4: Vec4)
Adds one Vec4 to another Vec4 and re-assigns the first Vec4 to the new Vec4.
impl Mul<Vec4> for f32
[src]
impl Mul<Vec4> for f32
type Output = Vec4
The resulting type after applying the *
operator.
fn mul(self, other_vec4: Vec4) -> Vec4
[src]
fn mul(self, other_vec4: Vec4) -> Vec4
Multiplise a scalar value by a Vec4 and returns a Vec4.
impl Mul<Vec4> for Vec4
[src]
impl Mul<Vec4> for Vec4
type Output = f32
The resulting type after applying the *
operator.
fn mul(self, other_vec4: Vec4) -> f32
[src]
fn mul(self, other_vec4: Vec4) -> f32
Returns the dot product of 2 Vec4s, which is a scalar floating point.
impl Neg for Vec4
[src]
impl Neg for Vec4
type Output = Vec4
The resulting type after applying the -
operator.
fn neg(self) -> Vec4
[src]
fn neg(self) -> Vec4
Negates the values of Vec4, which in turn negates the Vec4.
impl Sub<Vec4> for Vec4
[src]
impl Sub<Vec4> for Vec4
type Output = Vec4
The resulting type after applying the -
operator.
fn sub(self, other_vec4: Vec4) -> Vec4
[src]
fn sub(self, other_vec4: Vec4) -> Vec4
Subtracts one Vec4 from another Vec4 and returns a new Vec4.
impl SubAssign for Vec4
[src]
impl SubAssign for Vec4
fn sub_assign(&mut self, other_vec4: Vec4)
[src]
fn sub_assign(&mut self, other_vec4: Vec4)
Subtracts one Vec4 from another Vec4 and re-assigns the first Vec4 to the new Vec4.