Struct ami::Vec3
[−]
[src]
pub struct Vec3 { pub x: f32, pub y: f32, pub z: f32, }
3-dimensional vector
Fields
x: f32
X coordinate
y: f32
Y coordinate
z: f32
Z coordinate
Methods
impl Vec3
[src]
pub fn new(x: f32, y: f32, z: f32) -> Vec3
[src]
Create a new Vec3
pub fn mag(self) -> f32
[src]
Get the magnitude of a Vec3
pub fn transform_dir(self, rhs: Mat4) -> Self
[src]
Multiply matrix onto Vec3 (as directional vector)
pub fn zero() -> Self
[src]
Create a zero Vec3
pub fn midpoint(self, other: Self) -> Self
[src]
Find the midpoint between two Vec3
pub fn dist_sq(self, other: Self) -> f32
[src]
Calculate the distance squared between two Vec3
pub fn recip(self) -> Self
[src]
The recipricol (inverse) of the vector.
pub fn dot(&self, other: Vec3) -> f32
[src]
Calculate the dot product of two Vec3
s
pub fn normalize(self) -> Self
[src]
Normalize a Vec3
pub fn angle(&self, other: Vec3) -> f32
[src]
Calculate angle between 2 Vec3's
Trait Implementations
impl Mul<Vec3> for Mat4
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec3) -> Self::Output
[src]
Transform as a position.
impl Sub<Vec3> for BBox
[src]
type Output = BBox
The resulting type after applying the -
operator.
fn sub(self, other: Vec3) -> Self::Output
[src]
Performs the -
operation.
impl Add<Vec3> for BBox
[src]
type Output = BBox
The resulting type after applying the +
operator.
fn add(self, other: Vec3) -> Self::Output
[src]
Performs the +
operation.
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 Copy for Vec3
[src]
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 Debug for Vec3
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Add for Vec3
[src]
type Output = Vec3
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
Performs the +
operation.
impl Sub for Vec3
[src]
type Output = Vec3
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
Performs the -
operation.
impl Mul<f32> for Vec3
[src]
type Output = Vec3
The resulting type after applying the *
operator.
fn mul(self, s: f32) -> Self::Output
[src]
Performs the *
operation.
impl Div<f32> for Vec3
[src]
type Output = Vec3
The resulting type after applying the /
operator.
fn div(self, s: f32) -> Vec3
[src]
Performs the /
operation.