public class Quaternion extends Vector implements ReadableVector4f
Constructor and Description |
---|
Quaternion()
C'tor.
|
Quaternion(float x,
float y,
float z,
float w)
C'tor
|
Quaternion(ReadableVector4f src)
C'tor
|
Modifier and Type | Method and Description |
---|---|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
length
public Quaternion()
public Quaternion(ReadableVector4f src)
src
- public Quaternion(float x, float y, float z, float w)
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 vectorpublic Quaternion setIdentity()
public static Quaternion setIdentity(Quaternion q)
q
- The quaternionpublic 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
createdpublic Quaternion normalise(Quaternion dest)
dest
- The destination quaternion, or null if a new quaternion is to be
createdpublic static float dot(Quaternion left, Quaternion right)
left
- The LHS quatright
- The RHS quatpublic 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()
public Vector load(java.nio.FloatBuffer buf)
Vector
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 createdpublic 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 positionpublic 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 matrixpublic static Quaternion setFromMatrix(Matrix4f m, Quaternion q)
m
- The source matrixq
- The destination quaternion, or null if a new quaternion is to be createdpublic 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 createdCopyright © 2002-2009 lwjgl.org. All Rights Reserved.