public class Transform
extends java.lang.Object
CSG, Polygon, Vertex and
Vector3d.
This transform class uses the builder pattern to define combined
transformations.| Constructor and Description |
|---|
Transform()
Constructor.
|
Transform(javax.vecmath.Matrix4d m)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Transform |
apply(Transform t)
Applies the specified transform to this transform.
|
javax.vecmath.Matrix4d |
getInternalMatrix() |
double |
getQuataurionW() |
double |
getQuataurionX() |
double |
getQuataurionY() |
double |
getQuataurionZ() |
double |
getScale()
Performs an SVD normalization of the underlying matrix to calculate and
return the uniform scale factor.
|
double |
getX() |
double |
getY() |
double |
getZ() |
Transform |
inverse()
Return a new transform that is inverted
|
Transform |
invert()
Apply an inversion to this transform
|
boolean |
isMirror()
Indicates whether this transform performs a mirror operation, i.e., flips the
orientation.
|
Transform |
mirror(Plane plane)
Applies a mirror operation to this transform.
|
Transform |
mirrorx()
mirror about x axis.
|
Transform |
mirrory()
mirror about y axis.
|
Transform |
mirrorz()
mirror about z axis.
|
Transform |
move(java.lang.Number[] posVector) |
Transform |
move(java.lang.Number x,
java.lang.Number y,
java.lang.Number z) |
Transform |
move(Vector3d v) |
Transform |
move(Vertex v) |
Transform |
movex(java.lang.Number howFarToMove)
Movex.
|
Transform |
movey(java.lang.Number howFarToMove)
Movey.
|
Transform |
movez(java.lang.Number howFarToMove)
Movez.
|
Transform |
rot(double x,
double y,
double z)
Applies a rotation operation to this transform.
|
Transform |
rot(Vector3d vec)
Applies a rotation operation to this transform.
|
Transform |
rotX(double degrees)
Applies rotation operation around the x axis to this transform.
|
Transform |
rotx(java.lang.Number degreesToRotate)
Rotx.
|
Transform |
rotY(double degrees)
Applies rotation operation around the y axis to this transform.
|
Transform |
roty(java.lang.Number degreesToRotate)
Roty.
|
Transform |
rotZ(double degrees)
Applies rotation operation around the z axis to this transform.
|
Transform |
rotz(java.lang.Number degreesToRotate)
Rotz.
|
Transform |
scale(double s)
Applies a scale operation to this transform.
|
Transform |
scale(double x,
double y,
double z)
Applies a scale operation to this transform.
|
Transform |
scale(Vector3d vec)
Applies a scale operation to this transform.
|
Transform |
scaleX(double s)
Applies a scale operation (x axis) to this transform.
|
Transform |
scaleY(double s)
Applies a scale operation (y axis) to this transform.
|
Transform |
scaleZ(double s)
Applies a scale operation (z axis) to this transform.
|
java.lang.String |
toString() |
Vector3d |
transform(Vector3d vec)
Applies this transform to the specified vector.
|
Vector3d |
transform(Vector3d vec,
double amount)
Applies this transform to the specified vector.
|
Transform |
translate(double x,
double y,
double z)
Applies a translation operation to this transform.
|
Transform |
translate(Vector3d vec)
Applies a translation operation to this transform.
|
Transform |
translateX(double value)
Applies a translation operation to this transform.
|
Transform |
translateY(double value)
Applies a translation operation to this transform.
|
Transform |
translateZ(double value)
Applies a translation operation to this transform.
|
static Transform |
unity()
Returns a new unity transform.
|
public Transform()
public Transform(javax.vecmath.Matrix4d m)
m - matrixpublic static Transform unity()
public Transform rotX(double degrees)
degrees - degreespublic Transform rotY(double degrees)
degrees - degreespublic Transform rotZ(double degrees)
degrees - degreespublic Transform rot(double x, double y, double z)
x - x axis rotation (degrees)y - y axis rotation (degrees)z - z axis rotation (degrees)public Transform rot(Vector3d vec)
vec - axis rotation for x, y, z (degrees)public Transform translate(Vector3d vec)
vec - translation vector (x,y,z)public Transform translate(double x, double y, double z)
x - translation (x axis)y - translation (y axis)z - translation (z axis)public Transform translateX(double value)
value - translation (x axis)public double getQuataurionX()
public double getQuataurionY()
public double getQuataurionZ()
public double getQuataurionW()
public double getX()
public double getY()
public double getZ()
public java.lang.String toString()
toString in class java.lang.Objectpublic Transform translateY(double value)
value - translation (y axis)public Transform translateZ(double value)
value - translation (z axis)public Transform mirror(Plane plane)
plane - the plane that defines the mirror operationpublic Transform scale(Vector3d vec)
vec - vector that specifies scale (x,y,z)public Transform scale(double x, double y, double z)
x - x scale valuey - y scale valuez - z scale valuepublic Transform scale(double s)
s - s scale value (x, y and z)public Transform scaleX(double s)
s - x scale valuepublic Transform scaleY(double s)
s - y scale valuepublic Transform scaleZ(double s)
s - z scale valuepublic Vector3d transform(Vector3d vec)
vec - vector to transformpublic Vector3d transform(Vector3d vec, double amount)
vec - vector to transformamount - transform amount (0 = 0 %, 1 = 100%)public double getScale()
public boolean isMirror()
true if this transform performs a mirror operation;
false otherwisepublic Transform apply(Transform t)
t - transform to applypublic javax.vecmath.Matrix4d getInternalMatrix()
public Transform inverse()
public Transform invert()
public Transform move(java.lang.Number x, java.lang.Number y, java.lang.Number z)
public Transform move(java.lang.Number[] posVector)
public Transform movey(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Transform movez(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Transform movex(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Transform mirrory()
public Transform mirrorz()
public Transform mirrorx()
public Transform rotz(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotatepublic Transform roty(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotatepublic Transform rotx(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotate