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