public final class TRSRTransformation extends java.lang.Object implements IModelState, ITransformation
Constructor and Description |
---|
TRSRTransformation(javax.vecmath.Matrix4f matrix) |
TRSRTransformation(javax.vecmath.Vector3f translation,
javax.vecmath.Quat4f leftRot,
javax.vecmath.Vector3f scale,
javax.vecmath.Quat4f rightRot) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<TRSRTransformation> |
apply(java.util.Optional<? extends IModelPart> part) |
static TRSRTransformation |
blockCenterToCorner(TRSRTransformation transform)
convert transformation from assuming center-block system to corner-block system
|
static TRSRTransformation |
blockCornerToCenter(TRSRTransformation transform)
convert transformation from assuming corner-block system to center-block system
|
TRSRTransformation |
compose(TRSRTransformation b) |
boolean |
equals(java.lang.Object obj) |
static TRSRTransformation |
from(Direction facing) |
static TRSRTransformation |
from(ItemTransformVec3f transform)
Deprecated.
|
static TRSRTransformation |
from(ModelRotation rotation) |
javax.vecmath.Quat4f |
getLeftRot() |
static javax.vecmath.Matrix4f |
getMatrix(Direction facing) |
javax.vecmath.Matrix4f |
getMatrixVec() |
javax.vecmath.Quat4f |
getRightRot() |
static ModelRotation |
getRotation(Direction facing) |
javax.vecmath.Vector3f |
getScale() |
javax.vecmath.Vector3f |
getTranslation() |
TRSRTransformation |
getUVLockTransform(Direction originalSide) |
static TRSRTransformation |
getVanillaUvTransformGlobalToLocal(Direction side) |
static TRSRTransformation |
getVanillaUvTransformLocalToGlobal(Direction side) |
int |
hashCode() |
static TRSRTransformation |
identity() |
TRSRTransformation |
inverse() |
boolean |
isIdentity() |
static boolean |
isInteger(javax.vecmath.Matrix4f matrix) |
static javax.vecmath.Vector3f |
lerp(javax.vecmath.Tuple3f from,
javax.vecmath.Tuple3f to,
float progress) |
static javax.vecmath.Vector4f |
lerp(javax.vecmath.Tuple4f from,
javax.vecmath.Tuple4f to,
float progress) |
static javax.vecmath.Matrix4f |
mul(javax.vecmath.Vector3f translation,
javax.vecmath.Quat4f leftRot,
javax.vecmath.Vector3f scale,
javax.vecmath.Quat4f rightRot) |
static javax.vecmath.Quat4f |
quatFromXYZ(float x,
float y,
float z) |
static javax.vecmath.Quat4f |
quatFromXYZ(javax.vecmath.Vector3f xyz) |
static javax.vecmath.Quat4f |
quatFromXYZDegrees(javax.vecmath.Vector3f xyz) |
static javax.vecmath.Quat4f |
quatFromYXZ(float y,
float x,
float z) |
int |
rotate(Direction facing,
int vertexIndex) |
static Direction |
rotate(javax.vecmath.Matrix4f matrix,
Direction facing) |
Direction |
rotateTransform(Direction facing) |
static javax.vecmath.Quat4f |
slerp(javax.vecmath.Quat4f from,
javax.vecmath.Quat4f to,
float progress) |
TRSRTransformation |
slerp(TRSRTransformation that,
float progress) |
static org.apache.commons.lang3.tuple.Triple<javax.vecmath.Quat4f,javax.vecmath.Vector3f,javax.vecmath.Quat4f> |
svdDecompose(javax.vecmath.Matrix3f m) |
static org.apache.commons.lang3.tuple.Pair<javax.vecmath.Matrix3f,javax.vecmath.Vector3f> |
toAffine(javax.vecmath.Matrix4f m) |
ItemTransformVec3f |
toItemTransform()
Deprecated.
|
static Matrix4f |
toMojang(javax.vecmath.Matrix4f m) |
static Vector3f |
toMojang(javax.vecmath.Vector3f vec) |
static Vector4f |
toMojang(javax.vecmath.Vector4f vec) |
java.lang.String |
toString() |
static javax.vecmath.Matrix4f |
toVecmath(Matrix4f m) |
static javax.vecmath.Quat4f |
toVecmath(Quaternion q) |
static javax.vecmath.Vector3f |
toVecmath(Vector3f vec) |
static javax.vecmath.Vector4f |
toVecmath(Vector4f vec) |
static javax.vecmath.Vector3f |
toXYZ(javax.vecmath.Quat4f q) |
static javax.vecmath.Vector3f |
toXYZDegrees(javax.vecmath.Quat4f q) |
static javax.vecmath.Vector3f |
toYXZ(javax.vecmath.Quat4f q) |
static javax.vecmath.Vector3f |
toYXZDegrees(javax.vecmath.Quat4f q) |
void |
transformNormal(javax.vecmath.Vector3f normal) |
void |
transformPosition(javax.vecmath.Vector4f position) |
public TRSRTransformation(@Nullable javax.vecmath.Matrix4f matrix)
public TRSRTransformation(@Nullable javax.vecmath.Vector3f translation, @Nullable javax.vecmath.Quat4f leftRot, @Nullable javax.vecmath.Vector3f scale, @Nullable javax.vecmath.Quat4f rightRot)
@Deprecated public static TRSRTransformation from(ItemTransformVec3f transform)
public static TRSRTransformation from(ModelRotation rotation)
public static TRSRTransformation from(Direction facing)
public static javax.vecmath.Matrix4f getMatrix(Direction facing)
public static ModelRotation getRotation(Direction facing)
public static TRSRTransformation identity()
public TRSRTransformation compose(TRSRTransformation b)
public TRSRTransformation inverse()
public static javax.vecmath.Quat4f quatFromYXZ(float y, float x, float z)
public static javax.vecmath.Quat4f quatFromXYZDegrees(javax.vecmath.Vector3f xyz)
public static javax.vecmath.Quat4f quatFromXYZ(javax.vecmath.Vector3f xyz)
public static javax.vecmath.Quat4f quatFromXYZ(float x, float y, float z)
public static javax.vecmath.Vector3f toYXZDegrees(javax.vecmath.Quat4f q)
public static javax.vecmath.Vector3f toYXZ(javax.vecmath.Quat4f q)
public static javax.vecmath.Vector3f toXYZDegrees(javax.vecmath.Quat4f q)
public static javax.vecmath.Vector3f toXYZ(javax.vecmath.Quat4f q)
public static javax.vecmath.Matrix4f mul(@Nullable javax.vecmath.Vector3f translation, @Nullable javax.vecmath.Quat4f leftRot, @Nullable javax.vecmath.Vector3f scale, @Nullable javax.vecmath.Quat4f rightRot)
public static org.apache.commons.lang3.tuple.Triple<javax.vecmath.Quat4f,javax.vecmath.Vector3f,javax.vecmath.Quat4f> svdDecompose(javax.vecmath.Matrix3f m)
public static org.apache.commons.lang3.tuple.Pair<javax.vecmath.Matrix3f,javax.vecmath.Vector3f> toAffine(javax.vecmath.Matrix4f m)
@Deprecated public ItemTransformVec3f toItemTransform()
public boolean isIdentity()
public javax.vecmath.Matrix4f getMatrixVec()
getMatrixVec
in interface ITransformation
public javax.vecmath.Vector3f getTranslation()
public javax.vecmath.Quat4f getLeftRot()
public javax.vecmath.Vector3f getScale()
public javax.vecmath.Quat4f getRightRot()
public java.util.Optional<TRSRTransformation> apply(java.util.Optional<? extends IModelPart> part)
apply
in interface IModelState
part
- Part of the model we are wanting to transform. An empty optional means
we want a transform for the entire model.public Direction rotateTransform(Direction facing)
rotateTransform
in interface ITransformation
public static boolean isInteger(javax.vecmath.Matrix4f matrix)
public int rotate(Direction facing, int vertexIndex)
rotate
in interface ITransformation
public void transformPosition(javax.vecmath.Vector4f position)
public void transformNormal(javax.vecmath.Vector3f normal)
public java.lang.String toString()
toString
in class java.lang.Object
public static TRSRTransformation blockCenterToCorner(TRSRTransformation transform)
public static TRSRTransformation blockCornerToCenter(TRSRTransformation transform)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static javax.vecmath.Vector3f toVecmath(Vector3f vec)
public static javax.vecmath.Vector4f toVecmath(Vector4f vec)
public static javax.vecmath.Matrix4f toVecmath(Matrix4f m)
public static javax.vecmath.Quat4f toVecmath(Quaternion q)
public static Vector3f toMojang(javax.vecmath.Vector3f vec)
public static Vector4f toMojang(javax.vecmath.Vector4f vec)
public static Matrix4f toMojang(javax.vecmath.Matrix4f m)
public static javax.vecmath.Vector3f lerp(javax.vecmath.Tuple3f from, javax.vecmath.Tuple3f to, float progress)
public static javax.vecmath.Vector4f lerp(javax.vecmath.Tuple4f from, javax.vecmath.Tuple4f to, float progress)
public static javax.vecmath.Quat4f slerp(javax.vecmath.Quat4f from, javax.vecmath.Quat4f to, float progress)
public TRSRTransformation slerp(TRSRTransformation that, float progress)
public static TRSRTransformation getVanillaUvTransformLocalToGlobal(Direction side)
public static TRSRTransformation getVanillaUvTransformGlobalToLocal(Direction side)
public TRSRTransformation getUVLockTransform(Direction originalSide)