#[repr(C)]
pub struct DRotor3x4 { pub s: f64x4, pub bv: DBivec3x4, }
Expand description

A Rotor in 3d space.

Please see the module level documentation for more information on rotors!

Fields

s: f64x4bv: DBivec3x4

Implementations

Construct a Rotor that rotates one vector to another.

Construct a rotor given a bivector which defines a plane and rotation orientation, and a rotation angle.

plane must be normalized!

This is the equivalent of an axis-angle rotation.

Return the angle and the normalized plane of the rotation represented by self. The value of the returned angle is between 0 and PI.

Multiply the angle of the rotation represented by self by scale.

Return a rotor representing the same rotatation as self but with an angle multiplied by scale

Create new Rotor from a rotation in the xy plane (also known as “around the z axis”).

Create new Rotor from a rotation in the xz plane (also known as “around the y axis”).

Create new Rotor from a rotation in the yz plane (also known as “around the x axis”).

Angles are applied in the order roll -> pitch -> yaw

  • Roll is rotation inside the xy plane (“around the z axis”)
  • Pitch is rotation inside the yz plane (“around the x axis”)
  • Yaw is rotation inside the xz plane (“around the y axis”)

Rotates this rotor by another rotor in-place. Note that if you are looking to compose rotations which will then be applied to another object/vector (you probably are), you should NOT use this operation. Rather, just use regular left-multiplication as in matrix composition, i.e.

second_rotor * first_rotor

Rotates this rotor by another rotor and returns the result. Note that if you are looking to compose rotations, you should NOT use this operation and rather just use regular left-multiplication like as in matrix composition, i.e.

second_rotor * first_rotor

Rotates a vector by this rotor.

self must be normalized!

Rotates multiple vectors by this rotor.

This will be faster than calling rotate_vec individually on many vecs as intermediate values can be precomputed once and applied to each vector.

self must be normalized!

Convert this rotor into an array that represents a quaternion. This is in the form [vector, scalar].

Convert an array that represents a quaternion in the form [vector, scalar] into a rotor.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Linearly interpolate between self and end by t between 0.0 and 1.0. i.e. (1.0 - t) * self + (t) * end.

For interpolating Rotors with linear interpolation, you almost certainly want to normalize the returned Rotor. For example,

let interpolated_rotor = rotor1.lerp(rotor2, 0.5).normalized();

For most cases (especially where performance is the primary concern, like in animation interpolation for games, this ‘normalized lerp’ or ‘nlerp’ is probably what you want to use. However, there are situations in which you really want the interpolation between two Rotors to be of constant angular velocity. In this case, check out Slerp.

The resulting type after applying the * operator.

Performs the * operation. Read more

The composition of self with q, i.e. self * q gives the rotation as though you first perform q and then self.

The composition of self with q, i.e. self * q gives the rotation as though you first perform q and then self.

The resulting type after applying the * operator.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Spherical-linear interpolation between self and end based on t from 0.0 to 1.0.

self and end should both be normalized or something bad will happen!

The implementation for SIMD types also requires that the two things being interpolated between are not exactly aligned, or else the result is undefined.

Basically, interpolation that maintains a constant angular velocity from one orientation on a unit hypersphere to another. This is sorta the “high quality” interpolation for Rotors, and it can also be used to interpolate other things, one example being interpolation of 3d normal vectors.

Note that you should often normalize the result returned by this operation, when working with Rotors, etc!

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.