Struct nalgebra::Vec3
[−]
[src]
pub struct Vec3<N> { pub x: N, pub y: N, pub z: N, }
Vector of dimension 3.
Fields
x | First component of the vector. |
y | Second component of the vector. |
z | Third component of the vector. |
Methods
impl<N> Vec3<N>
impl<N: Zero + One> Vec3<N>
fn x() -> Vec3<N>
Create a unit vector with its $compN
component equal to 1.0.
fn y() -> Vec3<N>
Create a unit vector with its $compN
component equal to 1.0.
fn z() -> Vec3<N>
Create a unit vector with its $compN
component equal to 1.0.
impl<N> Vec3<N>
fn as_array(&self) -> &[N; 3]
View this vector as an array.
fn as_array_mut(&mut self) -> &mut [N; 3]
View this vector as a mutable array.
fn from_array_ref(array: &[N; 3]) -> &Vec3<N>
View an array as a vector.
fn from_array_mut(array: &mut [N; 3]) -> &mut Vec3<N>
View an array as a vector.
impl<N: Copy> Vec3<N>
unsafe fn at_fast(&self, i: usize) -> N
Unsafe read access to a vector element by index.
unsafe fn set_fast(&mut self, i: usize, val: N)
Unsafe write access to a vector element by index.