|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Quaternion
public class Quaternion
Quaternion implementation with SLERP based on http://is.gd/2n9s
Field Summary | |
---|---|
static float |
DOT_THRESHOLD
|
float |
w
|
float |
x
|
float |
y
|
float |
z
|
Constructor Summary | |
---|---|
Quaternion()
|
|
Quaternion(float w,
float x,
float y,
float z)
|
|
Quaternion(float w,
ReadonlyVec3D v)
|
|
Quaternion(Quaternion q)
|
Method Summary | |
---|---|
Quaternion |
add(Quaternion q)
|
Quaternion |
addSelf(Quaternion q)
|
Quaternion |
copy()
|
static Quaternion |
createFromAxisAngle(ReadonlyVec3D axis,
float angle)
Creates a Quaternion from a axis and a angle. |
static Quaternion |
createFromEuler(float pitch,
float yaw,
float roll)
Creates a Quaternion from Euler angles. |
static Quaternion |
createFromMatrix(Matrix4x4 m)
Creates a quaternion from a rotation matrix. |
float |
dot(Quaternion q)
Computes the dot product with the given quaternion. |
static Quaternion |
getAlignmentQuat(ReadonlyVec3D dir,
ReadonlyVec3D forward)
Constructs a quaternion that rotates the vector given by the "forward" param into the direction given by the "dir" param. |
Quaternion |
getConjugate()
Computes this quaternion's conjugate, defined as the same w around the inverted axis. |
Matrix4x4 |
getMatrix()
Deprecated. use toMatrix4x4() instead |
Quaternion |
getNormalized()
Computes normalized version of this quaternion. |
Quaternion |
identity()
|
Quaternion |
interpolateTo(Quaternion target,
float t)
Spherical interpolation to target quaternion (code ported from GamaSutra) |
Quaternion |
interpolateTo(Quaternion target,
float t,
InterpolateStrategy is)
|
Quaternion |
interpolateToSelf(Quaternion target,
float t)
Spherical interpolation to target quaternion (code ported from GamaSutra) |
Quaternion |
interpolateToSelf(Quaternion target,
float t,
InterpolateStrategy is)
Uses spherical interpolation to approach the target quaternion. |
float |
magnitude()
|
Quaternion |
multiply(Quaternion q2)
|
Quaternion |
normalize()
|
Quaternion |
scale(float t)
|
Quaternion |
scaleSelf(float t)
|
Quaternion |
set(float w,
float x,
float y,
float z)
|
Quaternion |
set(float w,
Vec3D v)
|
Quaternion |
set(Quaternion q)
|
Quaternion |
sub(Quaternion q)
|
Quaternion |
subSelf(Quaternion q)
|
float[] |
toArray()
|
float[] |
toAxisAngle()
Converts the quaternion into a float array consisting of: rotation angle in radians, rotation axis x,y,z |
Matrix4x4 |
toMatrix4x4()
Converts the quat to a 4x4 rotation matrix (in row-major format). |
Matrix4x4 |
toMatrix4x4(Matrix4x4 result)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final float DOT_THRESHOLD
public float x
public float y
public float z
public float w
Constructor Detail |
---|
public Quaternion()
public Quaternion(float w, float x, float y, float z)
public Quaternion(float w, ReadonlyVec3D v)
public Quaternion(Quaternion q)
Method Detail |
---|
public static Quaternion createFromAxisAngle(ReadonlyVec3D axis, float angle)
axis
- axis vector (will be normalized)angle
- angle in radians.
public static Quaternion createFromEuler(float pitch, float yaw, float roll)
pitch
- X-angle in radians.yaw
- Y-angle in radians.roll
- Z-angle in radians.
public static Quaternion createFromMatrix(Matrix4x4 m)
m
- rotation matrix
public static Quaternion getAlignmentQuat(ReadonlyVec3D dir, ReadonlyVec3D forward)
dir
- forward
-
public Quaternion add(Quaternion q)
public Quaternion addSelf(Quaternion q)
public Quaternion copy()
public float dot(Quaternion q)
q
-
public Quaternion getConjugate()
@Deprecated public Matrix4x4 getMatrix()
toMatrix4x4()
instead
public Quaternion getNormalized()
public Quaternion identity()
public Quaternion interpolateTo(Quaternion target, float t)
target
- quaterniont
- interpolation factor (0..1)
public Quaternion interpolateTo(Quaternion target, float t, InterpolateStrategy is)
target
- t
- is
-
public Quaternion interpolateToSelf(Quaternion target, float t)
target
- quaterniont
- interpolation factor (0..1)
public Quaternion interpolateToSelf(Quaternion target, float t, InterpolateStrategy is)
InterpolateStrategy
first.
target
- t
- is
-
public float magnitude()
public Quaternion multiply(Quaternion q2)
public Quaternion normalize()
public Quaternion scale(float t)
public Quaternion scaleSelf(float t)
public Quaternion set(float w, float x, float y, float z)
public Quaternion set(float w, Vec3D v)
public Quaternion set(Quaternion q)
public Quaternion sub(Quaternion q)
public Quaternion subSelf(Quaternion q)
public float[] toArray()
public float[] toAxisAngle()
public Matrix4x4 toMatrix4x4()
normalize()
first).
public Matrix4x4 toMatrix4x4(Matrix4x4 result)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |