Struct ami::Vec3 [−][src]
3-dimensional vector
Fields
x: f32
X coordinate
y: f32
Y coordinate
z: f32
Z coordinate
Methods
impl Vec3[src]
impl Vec3pub fn new(x: f32, y: f32, z: f32) -> Vec3[src]
pub fn new(x: f32, y: f32, z: f32) -> Vec3Create a new Vec3
pub fn mag(self) -> f32[src]
pub fn mag(self) -> f32Get the magnitude of a Vec3
pub fn transform_dir(self, rhs: Mat4) -> Self[src]
pub fn transform_dir(self, rhs: Mat4) -> SelfMultiply matrix onto Vec3 (as directional vector)
pub fn zero() -> Self[src]
pub fn zero() -> SelfCreate a zero Vec3
pub fn midpoint(self, other: Self) -> Self[src]
pub fn midpoint(self, other: Self) -> SelfFind the midpoint between two Vec3
pub fn dist_sq(self, other: Self) -> f32[src]
pub fn dist_sq(self, other: Self) -> f32Calculate the distance squared between two Vec3
pub fn recip(self) -> Self[src]
pub fn recip(self) -> SelfThe recipricol (inverse) of the vector.
pub fn dot(&self, other: Vec3) -> f32[src]
pub fn dot(&self, other: Vec3) -> f32Calculate the dot product of two Vec3s
pub fn normalize(self) -> Self[src]
pub fn normalize(self) -> SelfNormalize a Vec3
pub fn angle(&self, other: Vec3) -> f32[src]
pub fn angle(&self, other: Vec3) -> f32Calculate angle between 2 Vec3's
Trait Implementations
impl Mul<Vec3> for Mat4[src]
impl Mul<Vec3> for Mat4type Output = Vec3
The resulting type after applying the * operator.
fn mul(self, rhs: Vec3) -> Self::Output[src]
fn mul(self, rhs: Vec3) -> Self::OutputTransform as a position.
impl Sub<Vec3> for BBox[src]
impl Sub<Vec3> for BBoxtype Output = BBox
The resulting type after applying the - operator.
fn sub(self, other: Vec3) -> Self::Output[src]
fn sub(self, other: Vec3) -> Self::OutputPerforms the - operation.
impl Add<Vec3> for BBox[src]
impl Add<Vec3> for BBoxtype Output = BBox
The resulting type after applying the + operator.
fn add(self, other: Vec3) -> Self::Output[src]
fn add(self, other: Vec3) -> Self::OutputPerforms the + operation.
impl Clone for Vec3[src]
impl Clone for Vec3fn clone(&self) -> Vec3[src]
fn clone(&self) -> Vec3Returns 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 Vec3[src]
impl Copy for Vec3impl PartialEq for Vec3[src]
impl PartialEq for Vec3fn eq(&self, other: &Vec3) -> bool[src]
fn eq(&self, other: &Vec3) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Vec3) -> bool[src]
fn ne(&self, other: &Vec3) -> boolThis method tests for !=.
impl Debug for Vec3[src]
impl Debug for Vec3fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Add for Vec3[src]
impl Add for Vec3type Output = Vec3
The resulting type after applying the + operator.
fn add(self, other: Self) -> Self::Output[src]
fn add(self, other: Self) -> Self::OutputPerforms the + operation.
impl Add<f32> for Vec3[src]
impl Add<f32> for Vec3type Output = Vec3
The resulting type after applying the + operator.
fn add(self, other: f32) -> Self::Output[src]
fn add(self, other: f32) -> Self::OutputPerforms the + operation.
impl AddAssign for Vec3[src]
impl AddAssign for Vec3fn add_assign(&mut self, other: Vec3)[src]
fn add_assign(&mut self, other: Vec3)Performs the += operation.
impl Sub for Vec3[src]
impl Sub for Vec3type Output = Vec3
The resulting type after applying the - operator.
fn sub(self, other: Self) -> Self::Output[src]
fn sub(self, other: Self) -> Self::OutputPerforms the - operation.
impl Sub<f32> for Vec3[src]
impl Sub<f32> for Vec3type Output = Vec3
The resulting type after applying the - operator.
fn sub(self, other: f32) -> Self::Output[src]
fn sub(self, other: f32) -> Self::OutputPerforms the - operation.
impl SubAssign for Vec3[src]
impl SubAssign for Vec3fn sub_assign(&mut self, other: Vec3)[src]
fn sub_assign(&mut self, other: Vec3)Performs the -= operation.
impl Mul<f32> for Vec3[src]
impl Mul<f32> for Vec3type Output = Vec3
The resulting type after applying the * operator.
fn mul(self, s: f32) -> Self::Output[src]
fn mul(self, s: f32) -> Self::OutputPerforms the * operation.
impl Div<f32> for Vec3[src]
impl Div<f32> for Vec3type Output = Vec3
The resulting type after applying the / operator.
fn div(self, s: f32) -> Vec3[src]
fn div(self, s: f32) -> Vec3Performs the / operation.
impl Neg for Vec3[src]
impl Neg for Vec3