|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.math.Quaternion
public class Quaternion
this object is not thread safe
Field Summary | |
---|---|
static float |
epsilon
|
static Quaternion |
Identity
|
Constructor Summary | |
---|---|
Quaternion()
no args constructor sets w to 1.0, all others 0 |
|
Quaternion(float x,
float y,
float z,
float w)
|
|
Quaternion(Quaternion other)
|
Method Summary | |
---|---|
static float |
clamp(float value,
float min,
float max)
|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
|
boolean |
equals(Quaternion q)
|
static Quaternion |
fromAngleAxis(double angle,
AOVector axis)
Create a quaternion from a supplied angle and axis |
static Quaternion |
fromAngleAxisDegrees(double angle,
AOVector axis)
Create a quaternion from a supplied angle and axis |
static Quaternion |
fromTwoVectors(AOVector u,
AOVector v)
|
static Quaternion |
fromVectorRotation(AOVector a,
AOVector b)
Create a new quaternion that will rotate vector a into vector b about their mutually perpendicular axis. |
double |
getAngleAxis(AOVector axis)
Get the axis of rotation and the angle for this quaternion |
double |
getAngleAxisDegrees(AOVector axis)
Get the axis of rotation and the angle for this quaternion |
int |
getGimbalPole()
Get the pole of the gimbal lock, if any. |
float |
getPitch()
Get the pitch euler angle in degrees, which is the rotation around the x axis. |
float |
getPitchRad()
Get the pitch euler angle in radians, which is the rotation around the x axis. |
float |
getRoll()
Get the roll euler angle in degrees, which is the rotation around the z axis. |
float |
getRollRad()
Get the roll euler angle in radians, which is the rotation around the z axis. |
float |
getW()
|
float |
getX()
|
AOVector |
getXAxis()
|
float |
getY()
|
float |
getYaw()
Get the yaw euler angle in degrees, which is the rotation around the y axis. |
float |
getYawRad()
Get the yaw euler angle in radians, which is the rotation around the y axis. |
AOVector |
getYAxis()
|
float |
getZ()
|
AOVector |
getZAxis()
|
float |
len()
|
float |
len2()
|
static AOVector |
multiply(Quaternion quat,
AOVector vector)
|
static Quaternion |
multiply(Quaternion left,
Quaternion right)
Multiply two quaternions |
Quaternion |
normalize()
Normalizes this quaternion to unit length |
static Quaternion |
parseQuaternion(java.lang.String s)
|
void |
readExternal(java.io.ObjectInput in)
|
Quaternion |
setEulerAngles(float pitch,
float yaw,
float roll)
Sets the quaternion to the given euler angles in degrees. |
Quaternion |
setEulerAnglesRad(float pitch,
float yaw,
float roll)
Sets the quaternion to the given euler angles in radians. |
void |
setW(float w)
|
void |
setX(float x)
|
void |
setY(float y)
|
void |
setZ(float z)
|
AOVector |
toEulerAngles()
Returns the Euler Angle representation of this Quaternion in radians. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Quaternion Identity
public static float epsilon
Constructor Detail |
---|
public Quaternion()
public Quaternion(float x, float y, float z, float w)
public Quaternion(Quaternion other)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public static Quaternion parseQuaternion(java.lang.String s)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equals(Quaternion q)
public float getX()
public float getY()
public float getZ()
public float getW()
public void setX(float x)
public void setY(float y)
public void setZ(float z)
public void setW(float w)
public static Quaternion fromAngleAxis(double angle, AOVector axis)
angle
- angle in radiansaxis
- axis vector about which to rotate
public static Quaternion fromAngleAxisDegrees(double angle, AOVector axis)
angle
- angle in degreesaxis
- axis vector about which to rotate
public double getAngleAxisDegrees(AOVector axis)
axis
- reference to axis vector which will be populated with
axis of rotation.
public double getAngleAxis(AOVector axis)
axis
- reference to axis vector which will be populated with
axis of rotation.
public static Quaternion fromVectorRotation(AOVector a, AOVector b)
a
- starting facingb
- ending facingpublic static Quaternion fromTwoVectors(AOVector u, AOVector v)
public static Quaternion multiply(Quaternion left, Quaternion right)
left
- the quaternion on the leftright
- the quaternion on the right
public static AOVector multiply(Quaternion quat, AOVector vector)
public Quaternion setEulerAngles(float pitch, float yaw, float roll)
pitch
- the rotation around the x axis in degreesyaw
- the rotation around the y axis in degreesroll
- the rotation around the z axis degrees
public Quaternion setEulerAnglesRad(float pitch, float yaw, float roll)
pitch
- the rotation around the x axis in radiansyaw
- the rotation around the y axis in radiansroll
- the rotation around the z axis in radians
public AOVector toEulerAngles()
public AOVector getXAxis()
public AOVector getYAxis()
public AOVector getZAxis()
public int getGimbalPole()
public float getRollRad()
public float getRoll()
public float getPitchRad()
public float getPitch()
public float getYawRad()
public float getYaw()
public static float clamp(float value, float min, float max)
public float len()
public float len2()
public Quaternion normalize()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |