|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.util.Real
net.java.dev.joode.util.Vector4
net.java.dev.joode.util.Quaternion
public class Quaternion
quaternions have the format: (s,vx,vy,vz) where (vx,vy,vz) is the "rotation axis" and s is the "rotation angle".
| Field Summary | |
|---|---|
static Vector4 |
c1
|
static Vector4 |
c2
|
static Vector4 |
c3
|
static Vector4 |
n1
|
static Vector4 |
n2
|
static Vector4 |
n3
|
static Vector4 |
r1
|
static Vector4 |
r2
|
static Vector4 |
r3
|
| Fields inherited from class net.java.dev.joode.util.Vector4 |
|---|
additionalConstraint, linearHyperplaneCooeffecients, linearHyperplaneRHS, modifiedNormals |
| Fields inherited from class net.java.dev.joode.util.Real |
|---|
m |
| Constructor Summary | |
|---|---|
Quaternion()
Quatenion contrsucted with w = 1 and the rest 0 |
|
Quaternion(float s,
float vx,
float vy,
float vz)
|
|
Quaternion(Quaternion q)
Constructs a copy of a specified quaternion. |
|
| Method Summary | |
|---|---|
static boolean |
epsilonEquals(Quaternion a,
Quaternion b,
float e)
checks if two quaternions represent the rotation. |
void |
getDirection(Vector3 rotationAxix,
Vector4 passbackNormal)
if this quaternion is rotated by an infetesimal amount by the provided axis, then this quaterion values will move in the direction calulculated by this method. |
Vector3 |
getEuler(Vector3 passback)
does not appear to work in practice, based on: does not work: http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles |
float |
getNorm()
|
static float |
interpolateSLERP(Vector4 q1,
Vector4 q2,
float amount,
Vector4 result)
A rotational interpolation returns a quaternion that is between the passed in arguments the amount is the bias toward q2. |
void |
invert()
Inverts this quaternion. |
static Vector3 |
invMulScale(Quaternion q,
float scale,
Quaternion result,
Vector3 passback)
returns the vector3 that would satisfy the following use of mulScale t.mulScale(v, s, r); v = invMulScale(t, s, r, v); |
Quaternion |
mul(Quaternion q,
Quaternion result)
Multiplication as defined by quaternion algebra. |
Quaternion |
mulScale(Vector3 v,
float scale)
|
Quaternion |
mulScale(Vector3 v,
float scale,
Quaternion result)
v is assumed to be a quat with w = 0 result = scale * q(o,v) * this note the arguments are the opposite way around to the quat definition of multiply (in order for the vector to be an argument) |
void |
set(Matrix3 R)
sets this quaternion to be the same as the passed in rotation matrix |
void |
setAxisAngle(float angle,
Vector3 axis)
sets this quaternion to be an axis with angle rotation |
void |
setEuler(float ax,
float ay,
float az)
does not appear to work in practice, based on: does not work: http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles |
void |
setEuler(Vector3 v)
|
static Quaternion |
setRandomQuation(Quaternion q)
|
void |
toMatrix(Matrix3 R)
|
static Quaternion |
weightedSLERP(Quaternion start,
Quaternion target,
Vector3 rotationAxis1,
Vector3 rotationAxis2,
Vector3 rotationAxis3,
Vector3 weights,
Vector3 anglePassback,
Quaternion result)
A generalization of SLERP. |
| Methods inherited from class net.java.dev.joode.util.Vector4 |
|---|
add, getLinearHyperPlaneNormal, set, setRandomVector, sub, toString |
| Methods inherited from class net.java.dev.joode.util.Real |
|---|
add, aquireDirtyInstance, aquireInstance, dot, dot, epsilonEquals, epsilonEquals, fill, get, length, lengthSquared, max, min, norm, normalize, releaseInstance, scale, set, set, setZero, size, sub |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Vector4 n1
public static final Vector4 n2
public static final Vector4 n3
public static final Vector4 c1
public static final Vector4 c2
public static final Vector4 c3
public static final Vector4 r1
public static final Vector4 r2
public static final Vector4 r3
| Constructor Detail |
|---|
public Quaternion()
public Quaternion(float s,
float vx,
float vy,
float vz)
public Quaternion(Quaternion q)
| Method Detail |
|---|
public void set(Matrix3 R)
R - public void toMatrix(Matrix3 R)
public static Quaternion setRandomQuation(Quaternion q)
public Quaternion mul(Quaternion q,
Quaternion result)
result <- this * q. It corresponds to the ODE call
dQMultiply0(result,this,q).
this * q = result
q - a quaternion to be multiplied by thisresult - receives the result. It must not be either
this or q.
public Quaternion mulScale(Vector3 v,
float scale)
public Quaternion mulScale(Vector3 v,
float scale,
Quaternion result)
v - result -
public static Vector3 invMulScale(Quaternion q,
float scale,
Quaternion result,
Vector3 passback)
public void setAxisAngle(float angle,
Vector3 axis)
angle - axis - public void setEuler(Vector3 v)
public void setEuler(float ax,
float ay,
float az)
public Vector3 getEuler(Vector3 passback)
public static float interpolateSLERP(Vector4 q1,
Vector4 q2,
float amount,
Vector4 result)
q1 - unit quaternion 1q2 - unit quaternion 2amount - interpolation parameter, between 0 and 1result - the passback of the result
public static Quaternion weightedSLERP(Quaternion start,
Quaternion target,
Vector3 rotationAxis1,
Vector3 rotationAxis2,
Vector3 rotationAxis3,
Vector3 weights,
Vector3 anglePassback,
Quaternion result)
weights - the weight to apply to each rotation component in order (technically not really a vector)
public void getDirection(Vector3 rotationAxix,
Vector4 passbackNormal)
rotationAxix - passbackNormal - public void invert()
public static boolean epsilonEquals(Quaternion a,
Quaternion b,
float e)
a - b - e -
public float getNorm()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||