hmi.math
Class QuatCurve

java.lang.Object
  extended by hmi.math.QuatCurve

public final class QuatCurve
extends Object

Constructs quaternion curves (splines, Bezier curves) Implements algorithms from: Kim, Myoung-Jun, Kim, Myung-Soo and Shin, Sung Yong, A general construction scheme for unit quaternion curves with simple high order derivatives, in: SIGGRAPH '95: Proceedings of the 22nd annual conference on Computer graphics and interactive techniques, pages 369--376, ACM, 1995

Author:
Herwin van Welbergen

Constructor Summary
private QuatCurve()
           
 
Method Summary
static void hermite(float[] qStart, float[] qEnd, float[] wStart, float[] wEnd, float t, float[] q)
          Creates a Hermite spline through 2 quaternions with specified angular start and end velocities b1(t) = 1-(1-t)^3 b2(t) = 3t^2-2t^3 b3(t) = t^3 w1 = wStart/3 w3 = wEnd/3 w2 = log(exp(w1)^-1 qStart^-1 qEnd exp(w3)) q = q0 exp(w1 b1(t))exp(w2 b2(t))exp(w3 b3(t)) Kim's exponential map is defined as e^v = (cos(theta), sin(theta)vNorm), with theta = |v| Grassia's exponential map (as used in Quat4f) is defined as e^v = (cos(theta/2), sin(theta/2)vNorm), with theta = |v|, so e^(v*2) = Kim's e^v We correct the angular velocities for this by making them twice as big as in Kim's original formulation
static void hermite(float[] qStart, int qStartIndex, float[] qEnd, int qEndIndex, float[] wStart, int wStartIndex, float[] wEnd, int wEndIndex, float t, float[] q, int qIndex)
          Creates a Hermite spline through 2 quaternions with specified angular start and end velocities b1(t) = 1-(1-t)^3 b2(t) = 3t^2-2t^3 b3(t) = t^3 w1 = wStart/3 w3 = wEnd/3 w2 = log(exp(w1)^-1 qStart^-1 qEnd exp(w3)) q = q0 exp(w1 b1(t))exp(w2 b2(t))exp(w3 b3(t)) Kim's exponential map is defined as e^v = (cos(theta), sin(theta)vNorm), with theta = |v| Grassia's exponential map (as used in Quat4f) is defined as e^v = (cos(theta/2), sin(theta/2)vNorm), with theta = |v|, so e^(v*2) = Kim's e^v We correct the angular velocities for this by making them twice as big as in Kim's original formulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuatCurve

private QuatCurve()
Method Detail

hermite

public static void hermite(float[] qStart,
                           float[] qEnd,
                           float[] wStart,
                           float[] wEnd,
                           float t,
                           float[] q)
Creates a Hermite spline through 2 quaternions with specified angular start and end velocities b1(t) = 1-(1-t)^3 b2(t) = 3t^2-2t^3 b3(t) = t^3 w1 = wStart/3 w3 = wEnd/3 w2 = log(exp(w1)^-1 qStart^-1 qEnd exp(w3)) q = q0 exp(w1 b1(t))exp(w2 b2(t))exp(w3 b3(t)) Kim's exponential map is defined as e^v = (cos(theta), sin(theta)vNorm), with theta = |v| Grassia's exponential map (as used in Quat4f) is defined as e^v = (cos(theta/2), sin(theta/2)vNorm), with theta = |v|, so e^(v*2) = Kim's e^v We correct the angular velocities for this by making them twice as big as in Kim's original formulation

Parameters:
qStart - rotation at start point (Quat4f)
qEnd - rotation at end point (Quat4f)
wStart - angular velocity at start point (Vec3f)
wEnd - angular velocity at end point (Vec3f)
t - interpolation time, 0 <= t <= 1
q - output: interpolated quaternion

hermite

public static void hermite(float[] qStart,
                           int qStartIndex,
                           float[] qEnd,
                           int qEndIndex,
                           float[] wStart,
                           int wStartIndex,
                           float[] wEnd,
                           int wEndIndex,
                           float t,
                           float[] q,
                           int qIndex)
Creates a Hermite spline through 2 quaternions with specified angular start and end velocities b1(t) = 1-(1-t)^3 b2(t) = 3t^2-2t^3 b3(t) = t^3 w1 = wStart/3 w3 = wEnd/3 w2 = log(exp(w1)^-1 qStart^-1 qEnd exp(w3)) q = q0 exp(w1 b1(t))exp(w2 b2(t))exp(w3 b3(t)) Kim's exponential map is defined as e^v = (cos(theta), sin(theta)vNorm), with theta = |v| Grassia's exponential map (as used in Quat4f) is defined as e^v = (cos(theta/2), sin(theta/2)vNorm), with theta = |v|, so e^(v*2) = Kim's e^v We correct the angular velocities for this by making them twice as big as in Kim's original formulation

Parameters:
qStart - rotation at start point (Quat4f)
qEnd - rotation at end point (Quat4f)
wStart - angular velocity at start point (Vec3f)
wEnd - angular velocity at end point (Vec3f)
t - interpolation time, 0 <= t <= 1
q - output: interpolated quaternion