Struct cgmath::Vector3
[−]
[src]
pub struct Vector3<S> { pub x: S, pub y: S, pub z: S, }
Fields
x | |
y | |
z |
Methods
impl<S> Vector3<S>
impl<S: Copy + Neg<Output=S>> Vector3<S>
fn neg_self(&mut self)
Negate this vector in-place (multiply by -1).
impl<S: NumCast + Copy> Vector3<S>
impl<S: BaseNum> Vector3<S>
Operations specific to numeric three-dimensional vectors.
fn unit_x() -> Vector3<S>
A unit vector in the x
direction.
fn unit_y() -> Vector3<S>
A unit vector in the y
direction.
fn unit_z() -> Vector3<S>
A unit vector in the w
direction.
fn cross(&self, other: &Vector3<S>) -> Vector3<S>
Returns the cross product of the vector and other
.
fn cross_self(&mut self, other: &Vector3<S>)
Calculates the cross product of the vector and other
, then stores the
result in self
.
fn extend(&self, w: S) -> Vector4<S>
Create a Vector4
, using the x
, y
and z
values from this vector, and the
provided w
.
fn truncate(&self) -> Vector2<S>
Create a Vector2
, dropping the z
value.