|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.util.QTByteObject | +--quicktime.qd3d.math.Quaternion
Quaternion A quadruple of floating-point numbers that obeys the laws of quaternion arithmetic. A Quaternion transform will rotate and twist an object according to the mathematical properties of quaternions. Refer to TQ3Quaternion in QuickDraw3d
Field Summary | |
static int |
kNativeSize
This is the size (the number of bytes) that are required for this class |
Fields inherited from interface quicktime.jdirect.QuickTimeLib |
JDirect_MacOSX, libraryInstance, name |
Fields inherited from interface quicktime.jdirect.QuickDraw3DLib |
libraryInstance |
Constructor Summary | |
Quaternion()
Creates a Quaternion object set to the identity. |
|
Quaternion(float w,
float x,
float y,
float z)
Creates a Quaternion object containing given data. |
Method Summary | |
java.lang.Object |
clone()
Returns a copy of this class. |
Quaternion |
copy()
Returns a copy of the quaternion. |
float |
dot(Quaternion q2)
Returns the dot product of two quaternions, this and q2. |
static EndianDescriptor |
getEndianDescriptor()
Returns the EndianDescriptor for this class. |
float |
getW()
returns the w value |
float |
getX()
returns the position in the x direction |
float |
getY()
returns the position in the y direction |
float |
getZ()
returns the position in the z direction |
Quaternion |
interpolateFast(Quaternion q2,
float t)
Return a a quaternion that is a fast interpolation between the this and the specified quaternion. |
Quaternion |
interpolateLinear(Quaternion q2,
float t)
Return a a quaternion that is a linear interpolation between the this and the specified quaternion. |
Quaternion |
invert()
Returns the inverse of the quaternion. |
boolean |
isIdentity()
Returns rue if the quaternion is an identity quaternion. |
Quaternion |
matchReflection(Quaternion q2)
Returns a quaternion that is either identical to the quaternion specified by the q1 parameter or is the negative of q1, depending on whether q1 or its negative matches the orientation of the quaternion specified by the q2 parameter. |
Quaternion |
multiply(Quaternion q2)
Returns the product of the two quaternions, this and q2. |
Quaternion |
normalize()
Returns a normalized the quaternion. |
void |
setIdentity()
Sets the Quaternion to the identity quaternion. |
void |
setMatrix(Matrix4x4 matrix)
Sets a quaternion that has the same transformational properties as the matrix specified by the matrix parameter. |
void |
setRotateAboutAxis(Vector3D axis,
float angle)
Sets a a rotate-about-axis quaternion that rotates an object by the angle angle around the axis specified by the axis parameter. |
void |
setRotateVectorToVector(Vector3D v1,
Vector3D v2)
Sets a rotational quaternion that rotates objects around the origin in such a way that the transformed vector v1 matches the vector v2. |
void |
setRotateX(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis. |
void |
setRotateXYZ(float xAngle,
float yAngle,
float zAngle)
Sets a rotational quaternion that rotates an object by the specified angles around their specified axis. |
void |
setRotateY(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the y axis. |
void |
setRotateZ(float angle)
Sets a rotational quaternion that rotates an object by the specified angle around the x axis. |
void |
setW(float w)
sets the w value |
void |
setX(float x)
sets the position in the x direction |
void |
setY(float y)
sets the position in the y direction |
void |
setZ(float z)
sets the position in the z direction |
Methods inherited from class quicktime.util.QTByteObject |
equals, fromArray, getBytes, getSize, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int kNativeSize
Constructor Detail |
public Quaternion()
public Quaternion(float w, float x, float y, float z)
w
- The final w value.x
- The final x position.y
- The final y position.z
- The final z position.Method Detail |
public static final EndianDescriptor getEndianDescriptor()
public float getW()
public float getX()
public float getY()
public float getZ()
public void setW(float w)
public void setX(float x)
public void setY(float y)
public void setZ(float z)
public Quaternion copy()
public void setIdentity()
public boolean isIdentity()
public Quaternion invert()
public Quaternion multiply(Quaternion q2)
q2
- a quaternionpublic Quaternion normalize()
public float dot(Quaternion q2)
q2
- A quaternion.public void setRotateAboutAxis(Vector3D axis, float angle)
axis
- The desired axis of rotation.angle
- The desired angle of rotation, in radians.public void setRotateX(float angle)
angle
- The desired angle of rotation around the x coordinate axis, in radians.public void setRotateY(float angle)
angle
- The desired angle of rotation around the y coordinate axis, in radians.public void setRotateZ(float angle)
angle
- The desired angle of rotation around the z coordinate axis, in radians.public void setRotateXYZ(float xAngle, float yAngle, float zAngle)
xAngle
- The desired angle of rotation around the x coordinate axis, in radians.yAngle
- The desired angle of rotation around the y coordinate axis, in radians.zAngle
- The desired angle of rotation around the z coordinate axis, in radians.public void setMatrix(Matrix4x4 matrix)
matrix
- A 4-by-by matrix.public void setRotateVectorToVector(Vector3D v1, Vector3D v2)
v1
- A three-dimensional vector.v2
- A three-dimensional vector.public Quaternion matchReflection(Quaternion q2)
q2
- A quaternion.public Quaternion interpolateFast(Quaternion q2, float t)
q2
- A quaternion.t
- An interpolation factor. This parameter should contain a value between 0.0 and 1.0.public Quaternion interpolateLinear(Quaternion q2, float t)
q2
- A quaternion.t
- An interpolation factor. This parameter should contain a value between 0.0 and 1.0.public java.lang.Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |