Type Definition nalgebra::geometry::Rotation3
[−]
[src]
type Rotation3<N> = Rotation<N, U3>;
A 3-dimensional rotation matrix.
Methods
impl<N: Real> Rotation3<N>
[src]
pub fn new<SB: Storage<N, U3>>(axisangle: Vector<N, U3, SB>) -> Self
[src]
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.
pub fn from_scaled_axis<SB: Storage<N, U3>>(
axisangle: Vector<N, U3, SB>
) -> Self
[src]
axisangle: Vector<N, U3, SB>
) -> Self
Builds a 3D rotation matrix from an axis scaled by the rotation angle.
pub fn from_axis_angle<SB>(axis: &Unit<Vector<N, U3, SB>>, angle: N) -> Self where
SB: Storage<N, U3>,
[src]
SB: Storage<N, U3>,
Builds a 3D rotation matrix from an axis and a rotation angle.
pub fn from_euler_angles(roll: N, pitch: N, yaw: N) -> Self
[src]
Creates a new rotation from Euler angles.
The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.
pub fn new_observer_frame<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
[src]
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Creates a rotation that corresponds to the local frame of an observer standing at the
origin and looking toward dir
.
It maps the view direction dir
to the positive z
axis.
Arguments
- dir - The look direction, that is, direction the matrix
z
axis will be aligned with. - up - The vertical direction. The only requirement of this parameter is to not be
collinear
to
dir
. Non-collinearity is not checked.
pub fn look_at_rh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
[src]
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Builds a right-handed look-at view matrix without translation.
This conforms to the common notion of right handed look-at matrix from the computer graphics community.
Arguments
- eye - The eye position.
- target - The target position.
- up - A vector approximately aligned with required the vertical axis. The only
requirement of this parameter is to not be collinear to
target - eye
.
pub fn look_at_lh<SB, SC>(
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
[src]
dir: &Vector<N, U3, SB>,
up: &Vector<N, U3, SC>
) -> Self where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
Builds a left-handed look-at view matrix without translation.
This conforms to the common notion of left handed look-at matrix from the computer graphics community.
Arguments
- eye - The eye position.
- target - The target position.
- up - A vector approximately aligned with required the vertical axis. The only
requirement of this parameter is to not be collinear to
target - eye
.
pub fn rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>
) -> Option<Self> where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
[src]
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>
) -> Option<Self> where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The rotation matrix required to align a
and b
but with its angl.
This is the rotation R
such that (R * a).angle(b) == 0 && (R * a).dot(b).is_positive()
.
pub fn scaled_rotation_between<SB, SC>(
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>,
n: N
) -> Option<Self> where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
[src]
a: &Vector<N, U3, SB>,
b: &Vector<N, U3, SC>,
n: N
) -> Option<Self> where
SB: Storage<N, U3>,
SC: Storage<N, U3>,
The smallest rotation needed to make a
and b
collinear and point toward the same
direction, raised to the power s
.
pub fn angle(&self) -> N
[src]
The rotation angle.
pub fn axis(&self) -> Option<Unit<Vector3<N>>>
[src]
The rotation axis. Returns None
if the rotation angle is zero or PI.
pub fn scaled_axis(&self) -> Vector3<N>
[src]
The rotation axis multiplied by the rotation angle.
pub fn angle_to(&self, other: &Rotation3<N>) -> N
[src]
The rotation angle needed to make self
and other
coincide.
pub fn rotation_to(&self, other: &Rotation3<N>) -> Rotation3<N>
[src]
The rotation matrix needed to make self
and other
coincide.
The result is such that: self.rotation_to(other) * self == other
.
pub fn powf(&self, n: N) -> Rotation3<N>
[src]
Raise the quaternion to a given floating power, i.e., returns the rotation with the same
axis as self
and an angle equal to self.angle()
multiplied by n
.
Trait Implementations
impl<N1, N2> SubsetOf<UnitQuaternion<N2>> for Rotation3<N1> where
N1: Real,
N2: Real + SupersetOf<N1>,
[src]
N1: Real,
N2: Real + SupersetOf<N1>,
fn to_superset(&self) -> UnitQuaternion<N2>
[src]
The inclusion map: converts self
to the equivalent element of its superset.
fn is_in_subset(q: &UnitQuaternion<N2>) -> bool
[src]
Checks if element
is actually part of the subset Self
(and can be converted to it).
unsafe fn from_superset_unchecked(q: &UnitQuaternion<N2>) -> Self
[src]
Use with care! Same as self.to_superset
but without any property checks. Always succeeds.
fn from_superset(element: &T) -> Option<Self>
[src]
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more