|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lwjgl.util.vector.Vector
org.lwjgl.util.vector.Quaternion
public class Quaternion
Field Summary | |
---|---|
float |
w
|
float |
x
|
float |
y
|
float |
z
|
Constructor Summary | |
---|---|
Quaternion()
C'tor. |
|
Quaternion(float x,
float y,
float z,
float w)
C'tor |
|
Quaternion(ReadableVector4f src)
C'tor |
Method Summary | |
---|---|
static float |
dot(Quaternion left,
Quaternion right)
The dot product of two quaternions |
float |
getW()
|
float |
getX()
|
float |
getY()
|
float |
getZ()
|
float |
lengthSquared()
|
Vector |
load(java.nio.FloatBuffer buf)
Load this vector from a FloatBuffer |
static Quaternion |
mul(Quaternion left,
Quaternion right,
Quaternion dest)
Sets the value of this quaternion to the quaternion product of quaternions left and right (this = left * right). |
static Quaternion |
mulInverse(Quaternion left,
Quaternion right,
Quaternion dest)
Multiplies quaternion left by the inverse of quaternion right and places the value into this quaternion. |
Vector |
negate()
Calculate the conjugate of this quaternion |
Quaternion |
negate(Quaternion dest)
Calculate the conjugate of this quaternion and put it into the given one |
static Quaternion |
negate(Quaternion src,
Quaternion dest)
Calculate the conjugate of this quaternion and put it into the given one |
Quaternion |
normalise(Quaternion dest)
Normalise this quaternion and place the result in another quaternion. |
static Quaternion |
normalise(Quaternion src,
Quaternion dest)
Normalise the source quaternion and place the result in another quaternion. |
Vector |
scale(float scale)
Scale this vector |
static Quaternion |
scale(float scale,
Quaternion src,
Quaternion dest)
Scale the source quaternion by scale and put the result in the destination |
void |
set(float x,
float y)
|
void |
set(float x,
float y,
float z)
|
void |
set(float x,
float y,
float z,
float w)
|
Quaternion |
set(ReadableVector4f src)
Load from another Vector4f |
void |
setFromAxisAngle(Vector4f a1)
Sets the value of this quaternion to the equivalent rotation of the Axis-Angle argument. |
Quaternion |
setFromMatrix(Matrix3f m)
Sets the value of this quaternion using the rotational component of the passed matrix. |
static Quaternion |
setFromMatrix(Matrix3f m,
Quaternion q)
Sets the value of the source quaternion using the rotational component of the passed matrix. |
Quaternion |
setFromMatrix(Matrix4f m)
Sets the value of this quaternion using the rotational component of the passed matrix. |
static Quaternion |
setFromMatrix(Matrix4f m,
Quaternion q)
Sets the value of the source quaternion using the rotational component of the passed matrix. |
Quaternion |
setIdentity()
Set this quaternion to the multiplication identity. |
static Quaternion |
setIdentity(Quaternion q)
Set the given quaternion to the multiplication identity. |
void |
setW(float w)
Set W |
void |
setX(float x)
Set X |
void |
setY(float y)
Set Y |
void |
setZ(float z)
Set Z |
Vector |
store(java.nio.FloatBuffer buf)
Store this vector in a FloatBuffer |
java.lang.String |
toString()
|
Methods inherited from class org.lwjgl.util.vector.Vector |
---|
length, normalise |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.lwjgl.util.vector.ReadableVector |
---|
length |
Field Detail |
---|
public float x
public float y
public float z
public float w
Constructor Detail |
---|
public Quaternion()
public Quaternion(ReadableVector4f src)
src
- public Quaternion(float x, float y, float z, float w)
Method Detail |
---|
public void set(float x, float y)
public void set(float x, float y, float z)
public void set(float x, float y, float z, float w)
public Quaternion set(ReadableVector4f src)
src
- The source vector
public Quaternion setIdentity()
public static Quaternion setIdentity(Quaternion q)
q
- The quaternion
public float lengthSquared()
lengthSquared
in interface ReadableVector
lengthSquared
in class Vector
public static Quaternion normalise(Quaternion src, Quaternion dest)
src
- The source quaterniondest
- The destination quaternion, or null if a new quaternion is to be
created
public Quaternion normalise(Quaternion dest)
dest
- The destination quaternion, or null if a new quaternion is to be
created
public static float dot(Quaternion left, Quaternion right)
left
- The LHS quatright
- The RHS quat
public Quaternion negate(Quaternion dest)
dest
- The quaternion which should be set to the conjugate of this
quaternionpublic static Quaternion negate(Quaternion src, Quaternion dest)
src
- The source quaterniondest
- The quaternion which should be set to the conjugate of this
quaternionpublic Vector negate()
negate
in class Vector
public Vector load(java.nio.FloatBuffer buf)
Vector
load
in class Vector
buf
- The buffer to load it from, at the current position
public Vector scale(float scale)
Vector
scale
in class Vector
scale
- The scale factor
public static Quaternion scale(float scale, Quaternion src, Quaternion dest)
scale
- The amount to scale bysrc
- The source quaterniondest
- The destination quaternion, or null if a new quaternion is to be created
public Vector store(java.nio.FloatBuffer buf)
Vector
store
in interface ReadableVector
store
in class Vector
buf
- The buffer to store it in, at the current position
public final float getX()
getX
in interface ReadableVector2f
public final float getY()
getY
in interface ReadableVector2f
public final void setX(float x)
x
- public final void setY(float y)
y
- public void setZ(float z)
z
- public float getZ()
getZ
in interface ReadableVector3f
public void setW(float w)
w
- public float getW()
getW
in interface ReadableVector4f
public java.lang.String toString()
toString
in class java.lang.Object
public static Quaternion mul(Quaternion left, Quaternion right, Quaternion dest)
left
- the first quaternionright
- the second quaternionpublic static Quaternion mulInverse(Quaternion left, Quaternion right, Quaternion dest)
left
- the left quaternionright
- the right quaternionpublic final void setFromAxisAngle(Vector4f a1)
a1
- the axis-angle: (x,y,z) is the axis and w is the anglepublic final Quaternion setFromMatrix(Matrix4f m)
m
- The matrix
public static Quaternion setFromMatrix(Matrix4f m, Quaternion q)
m
- The source matrixq
- The destination quaternion, or null if a new quaternion is to be created
public final Quaternion setFromMatrix(Matrix3f m)
m
- The source matrixpublic static Quaternion setFromMatrix(Matrix3f m, Quaternion q)
m
- The source matrixq
- The destination quaternion, or null if a new quaternion is to be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |