Struct nalgebra::Rot3
[−]
[src]
pub struct Rot3<N> { // some fields omitted }
Three dimensional rotation matrix.
Methods
impl<N: Clone + BaseFloat> Rot3<N>
[src]
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>
[src]
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.
impl<N> Rot3<N>
[src]
Trait Implementations
impl<N: Copy> Copy for Rot3<N>
[src]
impl<N: Hash> Hash for Rot3<N>
[src]
fn hash<__HN: Hasher>(&self, __arg_0: &mut __HN)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<N: Debug> Debug for Rot3<N>
[src]
impl<N: Clone> Clone for Rot3<N>
[src]
fn clone(&self) -> Rot3<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: Decodable> Decodable for Rot3<N>
[src]
impl<N: Encodable> Encodable for Rot3<N>
[src]
impl<N: PartialEq> PartialEq for Rot3<N>
[src]
fn eq(&self, __arg_0: &Rot3<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rot3<N>) -> bool
This method tests for !=
.
impl<N: Eq> Eq for Rot3<N>
[src]
impl<N: Clone + BaseFloat + Cast<f64>> Rotation<Vec3<N>> for Rot3<N>
[src]
fn rotation(&self) -> Vec3<N>
Gets the rotation associated with self
.
fn inv_rotation(&self) -> Vec3<N>
Gets the inverse rotation associated with self
.
fn append_rotation_mut(&mut self, rot: &Vec3<N>)
Appends a rotation to this object.
fn append_rotation(&self, axisangle: &Vec3<N>) -> Rot3<N>
Appends the rotation amount
to a copy of t
.
fn prepend_rotation_mut(&mut self, rot: &Vec3<N>)
Prepends a rotation to this object.
fn prepend_rotation(&self, axisangle: &Vec3<N>) -> Rot3<N>
Prepends the rotation amount
to a copy of t
.
fn set_rotation(&mut self, axisangle: Vec3<N>)
Sets the rotation of self
.
impl<N: BaseFloat> RotationTo for Rot3<N>
[src]
type AngleType = N
Type of the angle between two elements.
type DeltaRotationType = Rot3<N>
Type of the rotation between two elements.
fn angle_to(&self, other: &Self) -> N
Computes an angle nedded to transform the first element to the second one using a rotation. Read more
fn rotation_to(&self, other: &Self) -> Rot3<N>
Computes the smallest rotation needed to transform the first element to the second one.
impl<N: Clone + Rand + BaseFloat> Rand for Rot3<N>
[src]
fn rand<R: Rng>(rng: &mut R) -> Rot3<N>
Generates a random instance of this type using the specified source of randomness. Read more
impl<N: BaseFloat> AbsoluteRotate<Vec3<N>> for Rot3<N>
[src]
fn absolute_rotate(&self, v: &Vec3<N>) -> Vec3<N>
This is the same as: Read more
impl<N: BaseNum> Rotate<Vec3<N>> for Rot3<N>
[src]
fn rotate(&self, v: &Vec3<N>) -> Vec3<N>
Applies a rotation to v
.
fn inv_rotate(&self, v: &Vec3<N>) -> Vec3<N>
Applies an inverse rotation to v
.
impl<N: BaseNum> Rotate<Pnt3<N>> for Rot3<N>
[src]
fn rotate(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies a rotation to v
.
fn inv_rotate(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies an inverse rotation to v
.
impl<N: BaseNum> Transform<Vec3<N>> for Rot3<N>
[src]
fn transform(&self, v: &Vec3<N>) -> Vec3<N>
Applies a transformation to v
.
fn inv_transform(&self, v: &Vec3<N>) -> Vec3<N>
Applies an inverse transformation to v
.
impl<N: BaseNum> Transform<Pnt3<N>> for Rot3<N>
[src]
fn transform(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies a transformation to v
.
fn inv_transform(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies an inverse transformation to v
.
impl<N> Dim for Rot3<N>
[src]
impl<N: BaseNum> Mul<Rot3<N>> for Rot3<N>
[src]
type Output = Rot3<N>
The resulting type after applying the *
operator
fn mul(self, right: Rot3<N>) -> Rot3<N>
The method for the *
operator
impl<N: BaseNum> Mul<Vec3<N>> for Rot3<N>
[src]
type Output = Vec3<N>
The resulting type after applying the *
operator
fn mul(self, right: Vec3<N>) -> Vec3<N>
The method for the *
operator
impl<N: BaseNum> Mul<Pnt3<N>> for Rot3<N>
[src]
type Output = Pnt3<N>
The resulting type after applying the *
operator
fn mul(self, right: Pnt3<N>) -> Pnt3<N>
The method for the *
operator
impl<N: BaseNum> One for Rot3<N>
[src]
impl<N: BaseNum> Eye for Rot3<N>
[src]
fn new_identity(dim: usize) -> Rot3<N>
Return the identity matrix of specified dimension
impl<N: Zero + BaseNum + Cast<f64> + BaseFloat> RotationMatrix<N, Vec3<N>, Vec3<N>> for Rot3<N>
[src]
type Output = Rot3<N>
The output rotation matrix type.
fn to_rot_mat(&self) -> Rot3<N>
Gets the rotation matrix represented by self
.
impl<N: Copy + Zero> Col<Vec3<N>> for Rot3<N>
[src]
fn ncols(&self) -> usize
The number of column of this matrix or vector.
fn col(&self, i: usize) -> Vec3<N>
Reads the i
-th column of self
.
fn set_col(&mut self, i: usize, col: Vec3<N>)
Writes the i
-th column of self
.
impl<N: Copy + Zero> Row<Vec3<N>> for Rot3<N>
[src]
fn nrows(&self) -> usize
The number of column of self
.
fn row(&self, i: usize) -> Vec3<N>
Reads the i
-th row of self
.
fn set_row(&mut self, i: usize, row: Vec3<N>)
Writes the i
-th row of self
.
impl<N> Index<(usize, usize)> for Rot3<N>
[src]
type Output = N
The returned type after indexing
fn index(&self, i: (usize, usize)) -> &N
The method for the indexing (Foo[Bar]
) operation
impl<N: Absolute<N>> Absolute<Mat3<N>> for Rot3<N>
[src]
fn abs(m: &Rot3<N>) -> Mat3<N>
Computes some absolute value of this object. Typically, this will make all component of a matrix or vector positive. Read more
impl<N: BaseNum> ToHomogeneous<Mat4<N>> for Rot3<N>
[src]
fn to_homogeneous(&self) -> Mat4<N>
Gets the homogeneous coordinates form of this object.
impl<N: Copy> Inv for Rot3<N>
[src]
fn inv_mut(&mut self) -> bool
In-place version of inverse
.
fn inv(&self) -> Option<Rot3<N>>
Returns the inverse of m
.
impl<N: Copy> Transpose for Rot3<N>
[src]
fn transpose(&self) -> Rot3<N>
Computes the transpose of a matrix.
fn transpose_mut(&mut self)
In-place version of transposed
.
impl<N: ApproxEq<N>> ApproxEq<N> for Rot3<N>
[src]
fn approx_epsilon(_: Option<Rot3<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<Rot3<N>>) -> u32
Default ULPs for approximation.
fn approx_eq(&self, other: &Rot3<N>) -> bool
Tests approximate equality.
fn approx_eq_eps(&self, other: &Rot3<N>, epsilon: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &Rot3<N>, ulps: u32) -> bool
Tests approximate equality using units in the last place (ULPs)