Struct nalgebra::Rot3
[−]
[src]
pub struct Rot3<N> { // some fields omitted }
Three dimensional rotation matrix.
Methods
impl<N: Clone + BaseFloat> Rot3<N>
fn new(axisangle: Vec3<N>) -> Rot3<N>
Builds a 3 dimensional rotation matrix from an axis and an angle.
Arguments
axisangle
- A vector representing the rotation. Its magnitude is the amount of rotation in radian. Its direction is the axis of rotation.
unsafe fn new_with_mat(mat: Mat3<N>) -> Rot3<N>
Builds a rotation matrix from an orthogonal matrix.
This is unsafe because the orthogonality of mat
is not checked.
fn new_with_euler_angles(roll: N, pitch: N, yaw: N) -> Rot3<N>
Creates a new rotation from Euler angles.
The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.
impl<N: Clone + BaseFloat> Rot3<N>
fn look_at(at: &Vec3<N>, up: &Vec3<N>) -> Rot3<N>
Create a new matrix and orient it such that its local x
axis points to a given point.
Note that the usually known look_at
function does the same thing but with the z
axis.
See look_at_z
for that.
Arguments
- at - The point to look at. It is also the direction the matrix
x
axis will be aligned with - up - Vector pointing
up
. The only requirement of this parameter is to not be colinear withat
. Non-colinearity is not checked.
fn look_at_z(at: &Vec3<N>, up: &Vec3<N>) -> Rot3<N>
Create a new matrix and orient it such that its local z
axis points to a given point.
Arguments
- at - The look direction, that is, direction the matrix
y
axis will be aligned with - up - Vector pointing
up
. The only requirement of this parameter is to not be colinear withat
. Non-colinearity is not checked.