public final class TRSRTransformation extends java.lang.Object implements IModelState, ITransformation
Modifier and Type | Class and Description |
---|---|
private static class |
TRSRTransformation.Cache |
Modifier and Type | Field and Description |
---|---|
private static float |
cs |
private static float |
eps |
private boolean |
full |
private static float |
g |
private static TRSRTransformation |
identity |
private javax.vecmath.Quat4f |
leftRot |
private javax.vecmath.Matrix4f |
matrix |
private javax.vecmath.Matrix3f |
normalTransform |
private javax.vecmath.Quat4f |
rightRot |
private javax.vecmath.Vector3f |
scale |
private static float |
sq2 |
private static float |
ss |
private javax.vecmath.Vector3f |
translation |
private static java.util.EnumMap<EnumFacing,TRSRTransformation> |
vanillaUvTransformGlobalToLocal |
private static java.util.EnumMap<EnumFacing,TRSRTransformation> |
vanillaUvTransformLocalToGlobal |
Constructor and Description |
---|
TRSRTransformation(EnumFacing facing)
Deprecated.
use
from(EnumFacing) |
TRSRTransformation(ItemTransformVec3f transform)
Deprecated.
|
TRSRTransformation(javax.vecmath.Matrix4f matrix) |
TRSRTransformation(ModelRotation rotation)
Deprecated.
|
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) |
private static org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> |
approxGivensQuat(float a11,
float a12,
float a22) |
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
|
private void |
checkNormalTransform() |
TRSRTransformation |
compose(TRSRTransformation b) |
boolean |
equals(java.lang.Object obj) |
static TRSRTransformation |
from(EnumFacing facing) |
static TRSRTransformation |
from(ItemTransformVec3f transform)
Deprecated.
|
static TRSRTransformation |
from(ModelRotation rotation) |
private void |
genCheck() |
javax.vecmath.Quat4f |
getLeftRot() |
javax.vecmath.Matrix4f |
getMatrix() |
static javax.vecmath.Matrix4f |
getMatrix(EnumFacing facing) |
javax.vecmath.Quat4f |
getRightRot() |
static ModelRotation |
getRotation(EnumFacing facing) |
javax.vecmath.Vector3f |
getScale() |
javax.vecmath.Vector3f |
getTranslation() |
TRSRTransformation |
getUVLockTransform(EnumFacing originalSide) |
static TRSRTransformation |
getVanillaUvTransformGlobalToLocal(EnumFacing side) |
static TRSRTransformation |
getVanillaUvTransformLocalToGlobal(EnumFacing 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) |
private static org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> |
qrGivensQuat(float a1,
float a2) |
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) |
EnumFacing |
rotate(EnumFacing facing) |
int |
rotate(EnumFacing facing,
int vertexIndex) |
static EnumFacing |
rotate(javax.vecmath.Matrix4f matrix,
EnumFacing facing) |
private static float |
rsqrt(float f) |
static javax.vecmath.Quat4f |
slerp(javax.vecmath.Quat4f from,
javax.vecmath.Quat4f to,
float progress) |
TRSRTransformation |
slerp(TRSRTransformation that,
float progress) |
private static void |
sortSingularValues(javax.vecmath.Matrix3f b,
javax.vecmath.Quat4f v) |
private static javax.vecmath.Quat4f |
stepJacobi(javax.vecmath.Matrix3f m) |
static org.apache.commons.lang3.tuple.Triple<javax.vecmath.Quat4f,javax.vecmath.Vector3f,javax.vecmath.Quat4f> |
svdDecompose(javax.vecmath.Matrix3f m) |
private static void |
swapNeg(javax.vecmath.Matrix3f m,
int i,
int j) |
static org.apache.commons.lang3.tuple.Pair<javax.vecmath.Matrix3f,javax.vecmath.Vector3f> |
toAffine(javax.vecmath.Matrix4f m) |
ItemTransformVec3f |
toItemTransform()
Deprecated.
|
static org.lwjgl.util.vector.Matrix4f |
toLwjgl(javax.vecmath.Matrix4f m) |
static org.lwjgl.util.vector.Vector3f |
toLwjgl(javax.vecmath.Vector3f vec) |
static org.lwjgl.util.vector.Vector4f |
toLwjgl(javax.vecmath.Vector4f vec) |
java.lang.String |
toString() |
static javax.vecmath.Matrix4f |
toVecmath(org.lwjgl.util.vector.Matrix4f m) |
static javax.vecmath.Vector3f |
toVecmath(org.lwjgl.util.vector.Vector3f vec) |
static javax.vecmath.Vector4f |
toVecmath(org.lwjgl.util.vector.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) |
private final javax.vecmath.Matrix4f matrix
private boolean full
private javax.vecmath.Vector3f translation
private javax.vecmath.Quat4f leftRot
private javax.vecmath.Vector3f scale
private javax.vecmath.Quat4f rightRot
private javax.vecmath.Matrix3f normalTransform
private static final TRSRTransformation identity
private static final float eps
private static final float g
private static final float cs
private static final float ss
private static final float sq2
private static final java.util.EnumMap<EnumFacing,TRSRTransformation> vanillaUvTransformLocalToGlobal
private static final java.util.EnumMap<EnumFacing,TRSRTransformation> vanillaUvTransformGlobalToLocal
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 TRSRTransformation(ItemTransformVec3f transform)
from(ItemTransformVec3f)
@Deprecated public TRSRTransformation(ModelRotation rotation)
from(ModelRotation)
@Deprecated public TRSRTransformation(EnumFacing facing)
from(EnumFacing)
@Deprecated public static TRSRTransformation from(ItemTransformVec3f transform)
public static TRSRTransformation from(ModelRotation rotation)
public static TRSRTransformation from(EnumFacing facing)
public static javax.vecmath.Matrix4f getMatrix(EnumFacing facing)
public static ModelRotation getRotation(EnumFacing facing)
public static TRSRTransformation identity()
public TRSRTransformation compose(TRSRTransformation b)
public TRSRTransformation inverse()
private void genCheck()
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)
private static float rsqrt(float f)
private static org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> approxGivensQuat(float a11, float a12, float a22)
private static final void swapNeg(javax.vecmath.Matrix3f m, int i, int j)
private static void sortSingularValues(javax.vecmath.Matrix3f b, javax.vecmath.Quat4f v)
private static org.apache.commons.lang3.tuple.Pair<java.lang.Float,java.lang.Float> qrGivensQuat(float a1, float a2)
private static javax.vecmath.Quat4f stepJacobi(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 getMatrix()
getMatrix
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
public EnumFacing rotate(EnumFacing facing)
rotate
in interface ITransformation
public static EnumFacing rotate(javax.vecmath.Matrix4f matrix, EnumFacing facing)
public static boolean isInteger(javax.vecmath.Matrix4f matrix)
public int rotate(EnumFacing facing, int vertexIndex)
rotate
in interface ITransformation
public void transformPosition(javax.vecmath.Vector4f position)
public void transformNormal(javax.vecmath.Vector3f normal)
private void checkNormalTransform()
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(org.lwjgl.util.vector.Vector3f vec)
public static javax.vecmath.Vector4f toVecmath(org.lwjgl.util.vector.Vector4f vec)
public static javax.vecmath.Matrix4f toVecmath(org.lwjgl.util.vector.Matrix4f m)
public static org.lwjgl.util.vector.Vector3f toLwjgl(javax.vecmath.Vector3f vec)
public static org.lwjgl.util.vector.Vector4f toLwjgl(javax.vecmath.Vector4f vec)
public static org.lwjgl.util.vector.Matrix4f toLwjgl(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(EnumFacing side)
public static TRSRTransformation getVanillaUvTransformGlobalToLocal(EnumFacing side)
public TRSRTransformation getUVLockTransform(EnumFacing originalSide)