Type Definition turbine::math::Vec3
[−]
[src]
type Vec3 = [f32; 3];
Vector type: x, y, z.
Trait Implementations
impl Vector for Vec3
[src]
fn zero() -> Self
[src]
Returns a vector with zero length.
fn eye_forward() -> Self
[src]
Returns a vector in the forward direction.
fn from_2d(pos: [f64; 2], window_size: [u32; 2]) -> Self
[src]
Creates vector from 2D position. Returns a vector in normalized coordinates. Read more
fn from_4d(pos: [f32; 4]) -> Self
[src]
Creates vector from 4D position. Ignores the w component. Read more
fn add(self, rhs: Self) -> Self
[src]
Adds two vectors.
fn sub(self, rhs: Self) -> Self
[src]
Subtracts two vectors.
fn dot(self, rhs: Self) -> f32
[src]
Returns dot product of two vectors.
fn scale(self, f: f32) -> Self
[src]
Scales a vector.
fn normalized(self) -> Self
[src]
Returns the normalized vector.
fn point4(self) -> Vec4
[src]
Creates a homogeneous point. Puts 1.0 in the w component. Read more
fn vec4(self) -> Vec4
[src]
Create a homogeneous vector. Puts 0.0 in the w component. Read more
fn i32x2(self) -> [i32; 2]
[src]
Cast to [i32; 2].