Struct isosurface::math::Vec3
[−]
[src]
pub struct Vec3 { pub x: f32, pub y: f32, pub z: f32, }
A 3 dimensional vector
Ideally we'd reuse an exiting geometry library, but in the interest both of minimising dependencies, and of compatibility with multiple geometry libraries, we'll define our own.
Fields
x: f32
y: f32
z: f32
Methods
impl Vec3
[src]
pub fn new(x: f32, y: f32, z: f32) -> Self
[src]
Create a vector
pub fn zero() -> Self
[src]
Create a vector with all coordinates set to zero
pub fn one() -> Self
[src]
Create a vector with all coordinates set to one
Trait Implementations
impl Debug for Vec3
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Vec3
[src]
impl Clone for Vec3
[src]
fn clone(&self) -> Vec3
[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 Vec3
[src]
fn eq(&self, __arg_0: &Vec3) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vec3) -> bool
[src]
This method tests for !=
.
impl PartialOrd for Vec3
[src]
fn partial_cmp(&self, __arg_0: &Vec3) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Vec3) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Vec3) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Vec3) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Vec3) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Add for Vec3
[src]
type Output = Vec3
The resulting type after applying the +
operator.
fn add(self, other: Vec3) -> Vec3
[src]
Performs the +
operation.
impl Sub for Vec3
[src]
type Output = Vec3
The resulting type after applying the -
operator.
fn sub(self, other: Vec3) -> Vec3
[src]
Performs the -
operation.
impl Mul for Vec3
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, other: Vec3) -> Vec3
[src]
Performs the *
operation.
impl Mul<f32> for Vec3
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, other: f32) -> Vec3
[src]
Performs the *
operation.