pub struct Rotation(_);
Expand description

A Signed Permutation Matrix 1 encoded in a byte.

Encoding

The encoding follows the MagicaVoxel ROTATION type.

for example :

let R = [
  [0,  1,  0],
  [0,  0, -1],
  [-1, 0,  0],
];
let _r: u8 = (1 << 0) | (2 << 2) | (0 << 4) | (1 << 5) | (1 << 6);
bitvaluedescripton
0-11Index of the non-zero entry in the first row
2-32Index of the non-zero entry in the second row
40The sign in the first row (0 - positive; 1 - negative)
51The sign in the second row (0 - positive; 1 - negative)
61The sign in the third row (0 - positive; 1 - negative)

  1. A Signed Permutation Matrix is a square binary matrix that has exactly one entry of ±1 in each row and each column and 0s elsewhere. 

Implementations

Decompose the Signed Permutation Matrix into a rotation component, represented by a Quaternion, and a flip component, represented by a Vec3 which is either Vec3::ONE or -Vec3::ONE.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Print the Rotation in a format that looks like Rotation(-y, -z, x)

Integer-only multiplication of two Rotation.

The resulting type after applying the * operator.

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
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.