public class LXTransform extends Object
Constructor and Description |
---|
LXTransform()
Constructs a new transform with the identity matrix
|
LXTransform(LXMatrix matrix)
Constructs a new transform with the given base matrix
|
Modifier and Type | Method and Description |
---|---|
LXMatrix |
getMatrix()
Returns the current state of the transformation matrix
|
LXTransform |
multiply(LXMatrix m)
Multiplies the transform by a transformation matrix
|
LXTransform |
pop()
Pops the matrix stack, to its previous state
|
LXTransform |
push()
Pushes the matrix stack, future operations can be undone by pop()
|
LXTransform |
reset()
Resets this transform to a single identity matrix
|
LXTransform |
reset(LXMatrix matrix)
Reset this transform to the given matrix
|
LXTransform |
rotateX(double rx)
Rotates about the x axis
|
LXTransform |
rotateX(float rx)
Rotates about the x axis
|
LXTransform |
rotateY(double ry)
Rotates about the y axis
|
LXTransform |
rotateY(float ry)
Rotates about the y axis
|
LXTransform |
rotateZ(double rz)
Rotates about the z axis
|
LXTransform |
rotateZ(float rz)
Rotates about the z axis
|
LXTransform |
scale(float sv)
Scales the transform by the same factor on all axes
|
LXTransform |
scale(float sx,
float sy,
float sz)
Scales the transform
|
LXTransform |
scaleX(float sx)
Scales the transform on the X-axis
|
LXTransform |
scaleY(float sy)
Scales the transform on the Y-axis
|
LXTransform |
scaleZ(float sz)
Scales the transform on the Z-axis
|
int |
size()
Returns the size of the Matrix stack
|
LXTransform |
translate(float tx,
float ty)
Translates the point, default of 0 in the z-axis
|
LXTransform |
translate(float tx,
float ty,
float tz)
Translates the point
|
LXTransform |
translateX(float tx)
Translates the point on the x-axis
|
LXTransform |
translateY(float ty)
Translates the point on the y-axis
|
LXTransform |
translateZ(float tz)
Translates the point on the z-axis
|
LXVector |
vector()
Gets the current x, y, z of the transform as a vector
|
float |
x()
Gets the x value of the transform
|
float |
y()
Gets the y value of the transform
|
float |
z()
Gets the z value of the transform
|
public LXTransform()
public LXTransform(LXMatrix matrix)
matrix
- Base matrixpublic LXMatrix getMatrix()
public int size()
public LXTransform push()
public LXTransform pop()
public LXTransform reset(LXMatrix matrix)
matrix
- Transform matrixpublic LXTransform reset()
public LXVector vector()
public float x()
public float y()
public float z()
public LXTransform translateX(float tx)
tx
- x translationpublic LXTransform translateY(float ty)
ty
- y translationpublic LXTransform translateZ(float tz)
tz
- z translationpublic LXTransform translate(float tx, float ty)
tx
- x translationty
- y translationpublic LXTransform translate(float tx, float ty, float tz)
tx
- x translationty
- y translationtz
- z translationpublic LXTransform multiply(LXMatrix m)
m
- Matrixpublic LXTransform scale(float sv)
sv
- Scale factorpublic LXTransform scaleX(float sx)
sx
- Scale factorpublic LXTransform scaleY(float sy)
sy
- Scale factorpublic LXTransform scaleZ(float sz)
sz
- Scale factorpublic LXTransform scale(float sx, float sy, float sz)
sx
- Scale factor on X-axissy
- Scale factor on Y-axissz
- Scale factor on Z-axispublic LXTransform rotateX(float rx)
rx
- Degrees, in radianspublic LXTransform rotateX(double rx)
rx
- Degrees, in radianspublic LXTransform rotateY(float ry)
ry
- Degrees, in radianspublic LXTransform rotateY(double ry)
ry
- Degrees, in radianspublic LXTransform rotateZ(float rz)
rz
- Degrees, in radianspublic LXTransform rotateZ(double rz)
rz
- Degrees, in radiansLX library by Mark C. Slee. © 2012-2020