public class MathUtils
extends java.lang.Object
Constructor and Description |
---|
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static Quaternion |
exp(Quaternion q,
Quaternion store)
Calculate the exponential of a pure quaternion.
|
static Quaternion |
log(Quaternion q,
Quaternion store)
Calculate the natural logarithm of a unit quaternion.
|
static float |
raySegmentShortestDistance(Ray ray,
Vector3f segStart,
Vector3f segEnd,
Camera camera)
Returns the shortest distance between a Ray and a segment.
|
static Quaternion |
slerp(Quaternion q1,
Quaternion q2,
float t,
Quaternion store)
Interpolate between 2 quaternions using Slerp.
|
static Quaternion |
slerpNoInvert(Quaternion q1,
Quaternion q2,
float t,
Quaternion store) |
static Quaternion |
squad(Quaternion q0,
Quaternion q1,
Quaternion q2,
Quaternion q3,
Quaternion a,
Quaternion b,
float t,
Quaternion store) |
public static Quaternion log(Quaternion q, Quaternion store)
q
- the input Quaternion (not null, normalized, unaffected)store
- storage for the result (not null, modified)public static Quaternion exp(Quaternion q, Quaternion store)
q
- the input Quaternion (not null, w=0, unaffected)store
- storage for the result (not null, modified)public static Quaternion slerpNoInvert(Quaternion q1, Quaternion q2, float t, Quaternion store)
public static Quaternion slerp(Quaternion q1, Quaternion q2, float t, Quaternion store)
q1
- the desired value for t=0q2
- the desired value for t=1t
- the fractional parameter (≥0, ≤1)store
- storage for the result (not null, modified)public static Quaternion squad(Quaternion q0, Quaternion q1, Quaternion q2, Quaternion q3, Quaternion a, Quaternion b, float t, Quaternion store)
public static float raySegmentShortestDistance(Ray ray, Vector3f segStart, Vector3f segEnd, Camera camera)
ray
- The raysegStart
- The start position of the segment in world spacesegEnd
- The end position of the segment in world spacecamera
- The renderer camera if the distance is required in screen space. Null if the distance is required in world space