public final class Transform extends java.lang.Object implements IData<Transform>, ITransformable
| Constructor and Description |
|---|
Transform() |
| Modifier and Type | Method and Description |
|---|---|
Transform |
add(Transform t1,
Transform t2)
Axis inversion and scale rotate are ignored
|
Transform |
clone() |
boolean |
equals(java.lang.Object obj) |
Vec3 |
getLookAtForward(Vec3 dst) |
Vec3 |
getLookAtLeft(Vec3 dst) |
Mat4x4 |
getLookAtMatrix(Mat4x4 dst) |
Vec3 |
getLookAtUp(Vec3 dst) |
Mat4x4 |
getMatrix(Mat4x4 dst) |
Vec3 |
getPosition(Vec3 dst)
If modified, call the appropriate setter to synchronize internal data
|
Quat |
getRotation(Quat dst)
If modified, call the appropriate setter to synchronize internal data
|
Vec3 |
getScale(Vec3 dst)
If modified, call the appropriate setter to synchronize internal data
|
Quat |
getScaleRotate(Quat dst) |
Transform |
getTransform(Transform t) |
boolean |
hasPosition() |
boolean |
hasRotation() |
boolean |
hasScale() |
Transform |
interpolate(Transform current,
Transform next,
float t)
Create the interpolation frame between two frame
|
Transform |
inverseMultiply(Transform t1,
Transform t2) |
boolean |
isIdentity() |
boolean |
isInverseAxis() |
static Mat4x4 |
multiply(Mat4x4 dst,
Mat4x4 src,
Transform t)
dst = src * t
|
Transform |
multiply(Mat4x4 m1,
Transform t2) |
Transform |
multiply(Transform t1,
Mat4x4 m2) |
Transform |
multiply(Transform t1,
Transform t2) |
Vec3 |
multiply(Vec3 dst,
Vec3 src) |
Transform |
multiplyInverse(Transform t1,
Transform t2) |
static Transform |
read(ByteInputStream in) |
Vec3 |
rotate(Vec3 dst,
Vec3 src) |
Transform |
set(Transform t) |
Transform |
setIdentity()
set the identity transformation
|
Transform |
setInverseAxis(boolean inverseAxis) |
Transform |
setLookAtMatrix(Mat4x4 matrix)
Set this Transform to be identical to the look at matrix
|
Transform |
setMatrix(Mat4x4 matrix)
Set this Transform to be identical to the matrix.
|
Transform |
setMatrixTRS(Mat4x4 matrix)
WARNING:
This method is only valid for matrix created from a combination of a Translation, a Rotation and a Scale matrix. |
Transform |
setPosition(Vec3 position) |
Transform |
setRotation(Quat rotation) |
Transform |
setRotationAroundPivot(Mat4x4 m,
Vec3 pivot,
Vec3 axis,
float angleInRadians)
Deprecated.
|
Transform |
setRotationAroundPivot(Quat q,
Vec3 pivot,
Vec3 axis,
float angleInRadians)
Deprecated.
|
Transform |
setRotationAroundPivot(Vec3 pivot,
Vec3 axis,
float angleInRadians)
Deprecated.
|
Transform |
setScale(Vec3 scale) |
Transform |
setScaleRotate(Quat scaleRotate) |
void |
setTransform(Transform src) |
static void |
slerp(Transform[] ts1,
Transform[] ts2,
float t)
ts1 = slerp(ts1, ts2, t)
|
java.lang.String |
toString() |
void |
transform(Transform t) |
void |
write(ByteOutputStream out) |
public static final void slerp(Transform[] ts1, Transform[] ts2, float t)
ts1 - ts2 - t - a value between [0;1]public static final Transform read(ByteInputStream in) throws java.io.IOException
java.io.IOExceptionpublic final void write(ByteOutputStream out) throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String toString()
toString in class java.lang.Objectpublic final Transform clone()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final Transform setIdentity()
public final Transform set(Transform t)
set in interface IValueCopy<Transform>t - transform to copy to thispublic final Transform setMatrix(Mat4x4 matrix)
public final Transform setMatrixTRS(Mat4x4 matrix)
#setMatrix(Mat4x4) for general use.#setMatrix(Mat4x4).matrix - a TRS matrixsetMatrix(Mat4x4)public final Transform setLookAtMatrix(Mat4x4 matrix)
@Deprecated public final Transform setRotationAroundPivot(Vec3 pivot, Vec3 axis, float angleInRadians)
@Deprecated public final Transform setRotationAroundPivot(Quat q, Vec3 pivot, Vec3 axis, float angleInRadians)
q - a rotation representing a reference axis system@Deprecated public final Transform setRotationAroundPivot(Mat4x4 m, Vec3 pivot, Vec3 axis, float angleInRadians)
m - a 3x3 matrix (4th row/col are ignored) representing a reference axis systempublic final Transform interpolate(Transform current, Transform next, float t)
interpolate in interface IInterpolable<Transform>interpolate in interface IData<Transform>next - next framet - tells how far we are from next framecurrent - current valuepublic final Transform add(Transform t1, Transform t2)
public final Transform multiply(Transform t1, Transform t2)
t1 - t2 - public final Transform multiply(Transform t1, Mat4x4 m2)
t1 - m2 - public final Transform multiply(Mat4x4 m1, Transform t2)
t1 - m2 - public final Transform multiplyInverse(Transform t1, Transform t2)
t1 - t2 - public final Transform inverseMultiply(Transform t1, Transform t2)
t1 - t2 - public static final Mat4x4 multiply(Mat4x4 dst, Mat4x4 src, Transform t)
dst - a destination Mat4x4, can be srcsrc - t - public final boolean isIdentity()
public final Mat4x4 getMatrix(Mat4x4 dst)
dst - destination matrix to store the matrix represented by this quaternionjava.lang.IllegalArgumentException - if this transform has scaling or axis inversionpublic final Mat4x4 getLookAtMatrix(Mat4x4 dst)
dst - destination matrix to store the look at matrixjava.lang.IllegalArgumentException - if this transform has scaling or axis inversionpublic final Vec3 getLookAtLeft(Vec3 dst)
dst - destination vector to store the left vector of the look at matrix of this Transformpublic final Vec3 getLookAtUp(Vec3 dst)
dst - destination vector to store the up vector of the look at matrix of this Transformpublic final Vec3 getLookAtForward(Vec3 dst)
dst - destination vector to store the forward vector of the look at matrix of this Transformpublic final Transform setPosition(Vec3 position)
position - the position, or null for no translation (position (0, 0, 0))public final Transform setInverseAxis(boolean inverseAxis)
inverseAxis - true to invert axis before applying rotation (default is false)public final Transform setRotation(Quat rotation)
rotation - the quaternion defining the rotation, or null for no rotation (ie identity rotation)public final Transform setScaleRotate(Quat scaleRotate)
scaleRotate - the quaternion defining the orientation of the scale vectors, or null for default scale vector orientation.public final Transform setScale(Vec3 scale)
scale - the scaling values, or null for no scalingpublic final Vec3 getPosition(Vec3 dst)
public final boolean isInverseAxis()
public final Quat getRotation(Quat dst)
public final Vec3 getScale(Vec3 dst)
public final boolean hasPosition()
public final boolean hasRotation()
public final boolean hasScale()
public final Transform getTransform(Transform t)
getTransform in interface ITransformablet - storage of the Transform value (or the identity if the value is null)public void setTransform(Transform src)
setTransform in interface ITransformablepublic final void transform(Transform t)
transform in interface ITransformableBonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com