public class RotationUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.math3.geometry.euclidean.threed.RotationOrder |
DEFAULT_ORDER
Rotation order that is used by defualt in Nova.
|
static int[] |
sideRotOffsets
Rotate pi/2 * this offset for [side] about y axis before rotating to the side for the rotation indicies to line up
|
| Modifier and Type | Method and Description |
|---|---|
static double |
dotProduct(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b)
Returns the "dot" product of this Quaternion and
b:
this.x * b.x + this.y * b.y + this.z * b.z + this.w * b.w |
static Direction |
getRelativeSide(Direction front,
Direction side)
Finds the direction relative to a base direction.
|
static int |
rotateSide(int s,
int r)
Rotates a relative side into a Direction global size.
|
static int |
rotationTo(int s1,
int s2)
Rotates a Direction global size into a relative side.
|
static org.apache.commons.math3.geometry.euclidean.threed.Rotation |
slerp(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b,
double t)
Wrapper function that simply calls
slerp(a, b, t, true). |
static org.apache.commons.math3.geometry.euclidean.threed.Rotation |
slerp(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b,
double t,
boolean allowFlip)
Returns the slerp interpolation of Rotations
a and b, at
time t. |
public static final org.apache.commons.math3.geometry.euclidean.threed.RotationOrder DEFAULT_ORDER
public static int[] sideRotOffsets
public static int rotateSide(int s,
int r)
s - - The current face we are on (0-6)r - - The rotation to be applied (0-3)public static int rotationTo(int s1,
int s2)
s1 - Side 1s2 - Side 2public static Direction getRelativeSide(Direction front, Direction side)
front - The direction in which this block is facing/front. Use a number between 0 and
5. Default is 3.side - The side you are trying to find. A number between 0 and 5.public static org.apache.commons.math3.geometry.euclidean.threed.Rotation slerp(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b,
double t)
slerp(a, b, t, true).
See slerp(Rotation, Rotation, double, boolean) for details.
a - the first Rotationb - the second Rotationt - the temporal interpolation parametera and b, at time t.public static org.apache.commons.math3.geometry.euclidean.threed.Rotation slerp(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b,
double t,
boolean allowFlip)
a and b, at
time t.
t should range in [0,1]. Result is a when t=0 and
b when t=1.
When allowFlip is true (default) the slerp interpolation will
always use the "shortest path" between the Rotations' orientations, by
"flipping" the source Rotation if needed.
a - the first Rotationb - the second Rotationt - the temporal interpolation parameterallowFlip - tells whether or not the interpolation allows axis flipa and b, at time t.public static double dotProduct(org.apache.commons.math3.geometry.euclidean.threed.Rotation a,
org.apache.commons.math3.geometry.euclidean.threed.Rotation b)
b:
this.x * b.x + this.y * b.y + this.z * b.z + this.w * b.w
a - Thisb - the Quaternion