|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.Transform3D
public class Transform3D
Is represented internally as a 4x4 floating point matrix. The mathematical representation is row major, as in traditional matrix mathematics. A Transform3D is used for rotating, translating and scaling scenegraph objects such as TransformGroups.
| Field Summary | |
|---|---|
static Transform3D |
IDENTITY
|
protected TransformGroup |
transformGroup
|
static Transform3D |
ZERO
|
| Constructor Summary | |
|---|---|
Transform3D()
Constructs a new Transform3D object and sets it to the identity transformation. |
|
Transform3D(float transX,
float transY,
float transZ)
|
|
Transform3D(org.openmali.vecmath2.Matrix3f m)
|
|
Transform3D(org.openmali.vecmath2.Matrix4f m)
|
|
Transform3D(Transform3D t)
Constructs a new Transform3D object and initializes it from the specified transform. |
|
Transform3D(org.openmali.vecmath2.Tuple3f v)
|
|
| Method Summary | |
|---|---|
void |
add(Transform3D t2)
Add this transform to the transform in t and then places the result back into this. |
void |
add(Transform3D t1,
Transform3D t2)
Adds the transforms t1 and t2 and places the result into this. |
int |
compareTo(Transform3D t2)
|
boolean |
equals(java.lang.Object o)
|
void |
frustum(float left,
float right,
float bottom,
float top,
float near,
float far)
Creates a perspective projection transform, that mimics a standard, camera-based, view-model. |
void |
frustumMesa(float left,
float right,
float bottom,
float top,
float zNear,
float zFar)
Creates a masa-style perspective projection transform, that mimics a standard, camera-based, view-model. |
void |
get(org.openmali.vecmath2.Matrix4f m)
|
void |
get(org.openmali.vecmath2.Quaternion4f quat)
|
void |
get(Transform3D transform)
Gets the full transform. |
void |
get(org.openmali.vecmath2.Tuple3f loc)
|
void |
getColumnMajor(float[] trans)
Moved the matrix into the float array |
Transform3D |
getCopy()
|
float |
getDeterminant()
Calculates and returns the determinant of this transform. |
boolean |
getDeterminantSign()
|
void |
getEuler(org.openmali.vecmath2.Tuple3f euler)
Calculates Euler angles from the current rotation matrix. |
org.openmali.vecmath2.Matrix4f |
getMatrix4f()
Get the Matrix4f for this transform. |
org.openmali.vecmath2.Matrix4f |
getMatrix4f(org.openmali.vecmath2.Matrix4f matrix)
Copies the Matrix4f for this transform into Matrix4f matrix. |
org.openmali.vecmath2.Matrix3f |
getRotation(org.openmali.vecmath2.Matrix3f rotMat)
Copy the rotation, the upper 3x3 matrix values of this transform into the Matrix3f m. |
void |
getRowMajor(float[] trans)
Moved the matrix into the float array |
float |
getScale()
|
StateNode |
getStateNode()
|
void |
getTransform(Transform3D t)
Deprecated. it has been replaced by get(Transform3D). |
org.openmali.vecmath2.Vector3f |
getTranslation()
Gets the translational values of this matrix and places them in the Vector3f v. |
void |
getTranslation(org.openmali.vecmath2.Tuple3f translation)
Gets the translational values of this matrix and places them in the Tuple3f. |
int |
hashCode()
|
void |
invert()
Inverts this transform in place. |
void |
invert(Transform3D t)
Inverts the transform t and place the result in this transform. |
boolean |
isChanged()
|
void |
lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ)
Helping function that specifies the position and orientation of a view matrix. |
void |
lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ,
float vecUpX,
float vecUpY,
float vecUpZ)
Helping function that specifies the position and orientation of a view matrix. |
void |
lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection)
Helping function that specifies the position and orientation of a view matrix. |
void |
lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection,
org.openmali.vecmath2.Tuple3f vecUp)
Helping function that specifies the position and orientation of a view matrix. |
void |
lookAt(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
Helping function that specifies the position and orientation of a view matrix. |
void |
lookAt(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
Helping function that specifies the position and orientation of a view matrix. |
void |
mul(Transform3D t)
|
void |
ortho(float left,
float right,
float bottom,
float top,
float near,
float far)
Creates an orthographic projection transform, that mimics a standard, camera-based, view-model. |
void |
perspective(float fovy,
float aspect,
float zNear,
float zFar)
Creates a perspective projection transform, that mimics a standard, camera-based, view-model. |
void |
perspectiveMesa(float fovy,
float aspect,
float zNear,
float zFar)
Creates a mesa-style perspective projection transform, that mimics a standard, camera-based, view-model. |
void |
rotAxis(float axisX,
float axisY,
float axisZ,
float angle)
Set the value of this matrix to a rotation matrix about an arbitray axis. |
void |
rotAxis(org.openmali.vecmath2.Vector3f axis,
float angle)
Set the value of this matrix to a rotation matrix about an arbitray axis. |
void |
rotX(float angle)
Rotates relative to the current rotation about the X axis. |
void |
rotXYZ(float angleX,
float angleY,
float angleZ)
Set the value of this matrix to a rotation matrix about a combination of the X, Y and Z axis. |
void |
rotY(float angle)
Rotates relative to the current rotation about the Y axis. |
void |
rotZ(float angle)
Rotates relative to the current rotation about the Z axis. |
void |
scaleTranslation(float scale)
Scales the translational values of this matrix by the scalar value scale. |
void |
set(float transX,
float transY,
float transZ)
Set the translational value of this matrix to the specified vector parameter values and set the other components of the matrix as if this transform were an identity matrix. |
void |
set(org.openmali.vecmath2.Matrix3f m)
Set the rotational components (upper 3x3) of this transform to the matrix values in the specified matrix. |
void |
set(org.openmali.vecmath2.Matrix4f m)
|
void |
set(org.openmali.vecmath2.Quaternion4f quat)
|
void |
set(org.openmali.vecmath2.Quaternion4f rotation,
org.openmali.vecmath2.Tuple3f translation,
float scale)
Sets the transform matrix using the rotation quaternion, translation vector and scale. |
void |
set(Transform3D t)
Set the matrix and state of this transform to the matrix state of the Transform3D t. |
void |
set(org.openmali.vecmath2.Tuple3f trans)
Set the translational value of this matrix to the specified vector parameter values and set the other components of the matrix as if this transform were an identity matrix. |
void |
set(org.openmali.vecmath2.Tuple3f translation,
float scale)
Set the value of this transform to a scaled translation matrix. |
void |
setEuler(float angleX,
float angleY,
float angleZ)
Set the value of this matrix to a rotation matrix about a combination of the X, Y and Z axis. |
void |
setEuler(org.openmali.vecmath2.Tuple3f euler)
|
void |
setIdentity()
Sets the transform to the identity matrix. |
void |
setRotation(org.openmali.vecmath2.AxisAngle3f aa)
Rotates the matrix around the passed axis by the passed angle. |
void |
setRotation(org.openmali.vecmath2.Matrix3f rotMat)
Sets the rotation by replacing the upper 3x3 matrix values of this transform with the values in the Matrix3f m. |
void |
setRotation(org.openmali.vecmath2.Quaternion4f quat)
Sets the matrix rotation by the given quaternion. |
void |
setRotationScale(org.openmali.vecmath2.Matrix3f m1)
Replaces the upper 3x3 matrix values of this transform with the values in the matrix m1. |
void |
setScale(float scale)
Sets the scale. |
void |
setScale(float scaleX,
float scaleY,
float scaleZ)
Set this transform to a scaling matrix after setting it to the identity matrix. |
void |
setScale(org.openmali.vecmath2.Tuple3f scale)
Set this transform to a scaling matrix after setting it to the identity matrix. |
void |
setStateNode(StateNode node)
|
void |
setTranslation(float x,
float y,
float z)
Modifies the translational components of this transform to the value of the argument. |
void |
setTranslation(org.openmali.vecmath2.Tuple3f translation)
Modifies the translational components of this transform to the value of the argument. |
void |
setZero()
Sets the transform to all zeros. |
void |
sub(Transform3D t2)
Subtracts transform t from this transform and then places the result back into this. |
void |
sub(Transform3D t1,
Transform3D t2)
Subtracts the transform t2 from t1 and places the result into this. |
java.lang.String |
toString()
|
void |
transform(org.openmali.vecmath2.Point3f point)
|
void |
transform(org.openmali.vecmath2.Point3f point,
org.openmali.vecmath2.Point3f pointOut)
Transforms the point parameter with this transform and places the result into pointOut. |
void |
transform(Transform3D t)
|
void |
transform(Transform3D t,
Transform3D out)
|
void |
transform(org.openmali.vecmath2.Vector3f vector)
|
void |
transform(org.openmali.vecmath2.Vector3f vector,
org.openmali.vecmath2.Vector3f vecOut)
Transforms the vector parameter with this transform and places the result into vecOut. |
void |
transform(org.openmali.vecmath2.Vector4f vector)
|
void |
transpose()
Transposes this matrix in place. |
void |
transpose(Transform3D trans)
Transposes transform t and places the value into this transform, trans is not modified. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Transform3D IDENTITY
public static final Transform3D ZERO
protected TransformGroup transformGroup
| Constructor Detail |
|---|
public Transform3D()
public Transform3D(Transform3D t)
public Transform3D(org.openmali.vecmath2.Matrix4f m)
public Transform3D(org.openmali.vecmath2.Matrix3f m)
public Transform3D(org.openmali.vecmath2.Tuple3f v)
public Transform3D(float transX,
float transY,
float transZ)
| Method Detail |
|---|
public final boolean isChanged()
public final void set(org.openmali.vecmath2.Tuple3f trans)
trans -
public final void set(float transX,
float transY,
float transZ)
transX - transY - transZ -
public final void set(org.openmali.vecmath2.Tuple3f translation,
float scale)
translation - scale - public final void set(Transform3D t)
public final void set(org.openmali.vecmath2.Matrix3f m)
public final void set(org.openmali.vecmath2.Matrix4f m)
public final void set(org.openmali.vecmath2.Quaternion4f rotation,
org.openmali.vecmath2.Tuple3f translation,
float scale)
rotation - quaterniontranslation - translationscale - scalepublic final void get(org.openmali.vecmath2.Tuple3f loc)
public final void get(org.openmali.vecmath2.Quaternion4f quat)
public final void set(org.openmali.vecmath2.Quaternion4f quat)
public final void get(org.openmali.vecmath2.Matrix4f m)
public final void getRowMajor(float[] trans)
public final void getColumnMajor(float[] trans)
public final org.openmali.vecmath2.Matrix4f getMatrix4f()
public final org.openmali.vecmath2.Matrix4f getMatrix4f(org.openmali.vecmath2.Matrix4f matrix)
matrix - public final void get(Transform3D transform)
transform - @Deprecated public final void getTransform(Transform3D t)
get(Transform3D).
public final boolean getDeterminantSign()
public final float getDeterminant()
public final void setIdentity()
public final void setZero()
public final void setRotationScale(org.openmali.vecmath2.Matrix3f m1)
m1 - The matrix that will be the new upper 3x3Matrix4f.setRotationScale(org.openmali.vecmath2.Matrix3f)public final void setRotation(org.openmali.vecmath2.Matrix3f rotMat)
rotMat - public final void setRotation(org.openmali.vecmath2.AxisAngle3f aa)
aa - Rotation amount and axis of rotationpublic final void setRotation(org.openmali.vecmath2.Quaternion4f quat)
quat - the quaternion to get the rotation frompublic final org.openmali.vecmath2.Matrix3f getRotation(org.openmali.vecmath2.Matrix3f rotMat)
rotMat - public final void add(Transform3D t2)
t2 -
public final void add(Transform3D t1,
Transform3D t2)
t1 - t2 - public final void sub(Transform3D t2)
t2 -
public final void sub(Transform3D t1,
Transform3D t2)
t1 - t2 - public final void mul(Transform3D t)
public final void rotAxis(float axisX,
float axisY,
float axisZ,
float angle)
axisX - axisY - axisZ - angle -
public final void rotAxis(org.openmali.vecmath2.Vector3f axis,
float angle)
axis - angle - public final void rotX(float angle)
angle - public final void rotY(float angle)
angle - public final void rotZ(float angle)
angle -
public final void rotXYZ(float angleX,
float angleY,
float angleZ)
angleX - angleY - angleZ -
public final void setEuler(float angleX,
float angleY,
float angleZ)
angleX - angleY - angleZ - public final void setEuler(org.openmali.vecmath2.Tuple3f euler)
public final void getEuler(org.openmali.vecmath2.Tuple3f euler)
euler - the euler to be filled
public final void setScale(float scaleX,
float scaleY,
float scaleZ)
scaleX - scaleY - scaleZ - public final void setScale(org.openmali.vecmath2.Tuple3f scale)
scale - public final void setScale(float scale)
scale - public final float getScale()
public final void setTranslation(float x,
float y,
float z)
x - y - z - public final void setTranslation(org.openmali.vecmath2.Tuple3f translation)
translation - public final org.openmali.vecmath2.Vector3f getTranslation()
public final void getTranslation(org.openmali.vecmath2.Tuple3f translation)
translation - public final void scaleTranslation(float scale)
scale - public final void transpose()
public final void transpose(Transform3D trans)
trans - public final void invert()
public final void invert(Transform3D t)
public final void transform(org.openmali.vecmath2.Point3f point)
public final void transform(org.openmali.vecmath2.Point3f point,
org.openmali.vecmath2.Point3f pointOut)
point - the input point to be transformedpointOut - the transformed pointpublic final void transform(org.openmali.vecmath2.Vector3f vector)
public final void transform(org.openmali.vecmath2.Vector3f vector,
org.openmali.vecmath2.Vector3f vecOut)
vector - the input point to be transformedvecOut - the transformed pointpublic final void transform(org.openmali.vecmath2.Vector4f vector)
public final void transform(Transform3D t)
public final void transform(Transform3D t,
Transform3D out)
public final void lookAt(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewFocusX,
float viewFocusY,
float viewFocusZ,
float vecUpX,
float vecUpY,
float vecUpZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewFocusX - the point the view looks atviewFocusY - the point the view looks atviewFocusZ - the point the view looks atvecUpX - the vector pointing upvecUpY - the vector pointing upvecUpZ - the vector pointing up
public final void lookAt(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewFocus,
org.openmali.vecmath2.Tuple3f vecUp)
eyePosition - the center of the eyeviewFocus - the point the view looks atvecUp - the vector pointing up
public final void lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ,
float vecUpX,
float vecUpY,
float vecUpZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewDirectionX - the direction the view looks alongviewDirectionY - the direction the view looks alongviewDirectionZ - the direction the view looks alongvecUpX - the vector pointing upvecUpY - the vector pointing upvecUpZ - the vector pointing up
public final void lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection,
org.openmali.vecmath2.Tuple3f vecUp)
eyePosition - the center of the eyeviewDirection - the direction the view looks alongvecUp - the vector pointing up
public final void lookAlong(float eyePositionX,
float eyePositionY,
float eyePositionZ,
float viewDirectionX,
float viewDirectionY,
float viewDirectionZ)
eyePositionX - the center of the eyeeyePositionY - the center of the eyeeyePositionZ - the center of the eyeviewDirectionX - the direction the view looks alongviewDirectionY - the direction the view looks alongviewDirectionZ - the direction the view looks along
public final void lookAlong(org.openmali.vecmath2.Tuple3f eyePosition,
org.openmali.vecmath2.Tuple3f viewDirection)
eyePosition - the center of the eyeviewDirection - the direction the view looks along
public final void frustum(float left,
float right,
float bottom,
float top,
float near,
float far)
left - the vertical line on the left edge of the near clipping plane
mapped to the left edge of the graphics windowright - the vertical line on the right edge of the near clipping
plane mapped to the right edge of the graphics windowbottom - the horizontal line on the bottom edge of the near clipping
plane mapped to the bottom edge of the graphics windowtop - the horizontal line on the top edge of the nearnear - the distance to the frustum's near clipping plane.
This value must be positive, (the value -near is the location of
the near clip plane).far - the distance to the frustum's far clipping plane.
This value must be positive, and must be greater than near.
public final void frustumMesa(float left,
float right,
float bottom,
float top,
float zNear,
float zFar)
left - the vertical line on the left edge of the near clipping plane
mapped to the left edge of the graphics windowright - the vertical line on the right edge of the near clipping
plane mapped to the right edge of the graphics windowbottom - the horizontal line on the bottom edge of the near clipping
plane mapped to the bottom edge of the graphics windowtop - the horizontal line on the top edge of the nearzNear - the distance to the frustum's near clipping plane.
This value must be positive, (the value -near is the location of
the near clip plane).zFar - the distance to the frustum's far clipping plane.
This value must be positive, and must be greater than near.
public final void perspectiveMesa(float fovy,
float aspect,
float zNear,
float zFar)
fovy - specifies the field of view in the y direction, in radiansaspect - specifies the aspect ratio and thus the field of view
in the x direction. The aspect ratio is the ratio of x to y,
or width to height.zNear - the distance to the frustum's near clipping plane.
This value must be positive, (the value -zNear is the
location of the near clip plane).zFar - the distance to the frustum's far clipping plane.
public final void perspective(float fovy,
float aspect,
float zNear,
float zFar)
fovy - specifies the field of view in the y direction, in radiansaspect - specifies the aspect ratio and thus the field of view
in the x direction. The aspect ratio is the ratio of x to y,
or width to height.zNear - the distance to the frustum's near clipping plane.
This value must be positive, (the value -zNear is the
location of the near clip plane).zFar - the distance to the frustum's far clipping plane.
public final void ortho(float left,
float right,
float bottom,
float top,
float near,
float far)
left - the vertical line on the left edge of the near clipping plane
mapped to the left edge of the graphics windowright - the vertical line on the right edge of the near clipping
plane mapped to the right edge of the graphics windowbottom - the horizontal line on the bottom edge of the near clipping
plane mapped to the bottom edge of the graphics windowtop - the horizontal line on the top edge of the near clipping plane
mapped to the top edge of the graphics windownear - the distance to the frustum's near clipping plane
(the value -near is the location of the near clip plane)far - the distance to the frustum's far clipping planepublic final void setStateNode(StateNode node)
public final StateNode getStateNode()
public final Transform3D getCopy()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(Transform3D t2)
compareTo in interface java.lang.Comparable<Transform3D>public int hashCode()
hashCode in class java.lang.Objectpublic 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 | |||||||||