Transform implements Cloneable, Savable, Externalizable, ReadOnlyTransform, Poolable { @Override public Transform invert(final Transform store) { Transform result = store; if (result == null) { result = new Transform(); } if (_identity) { result.setIdentity(); return result; } final Matrix3 newMatrix = result._matrix.set(_matrix); if (_rotationMatrix) { if (_uniformScale) { final double sx = _scale.getX(); newMatrix.transposeLocal(); if (sx != 1.0) { newMatrix.multiplyLocal(1.0 / sx); } } else { newMatrix.multiplyDiagonalPost(_scale, newMatrix).invertLocal(); } } else { newMatrix.invertLocal(); } result._matrix.applyPost(_translation, result._translation).negateLocal(); result.updateFlags(_rotationMatrix); return result; } Transform();  Transform(final ReadOnlyTransform source); protected  Transform(final ReadOnlyMatrix3 matrix, final ReadOnlyVector3 scale, final ReadOnlyVector3 translation,
    final boolean identity, final boolean rotationMatrix, final boolean uniformScale); @Override ReadOnlyMatrix3 getMatrix(); @Override ReadOnlyVector3 getTranslation(); @Override ReadOnlyVector3 getScale(); @Override boolean isIdentity(); @Override boolean isRotationMatrix(); @Override boolean isUniformScale(); Transform setIdentity(); Transform setRotation(final ReadOnlyMatrix3 rotation); Transform setRotation(final ReadOnlyQuaternion rotation); Transform setTranslation(final ReadOnlyVector3 translation); Transform setTranslation(final double x, final double y, final double z); Transform setScale(final ReadOnlyVector3 scale); Transform setScale(final double x, final double y, final double z); Transform setScale(final double uniformScale); Transform set(final ReadOnlyTransform source); Transform translate(final double x, final double y, final double z); Transform translate(final ReadOnlyVector3 vec); @Override Vector3 applyForward(final Vector3 point); @Override Vector3 applyForward(final ReadOnlyVector3 point, final Vector3 store); @Override Vector3 applyInverse(final Vector3 point); @Override Vector3 applyInverse(final ReadOnlyVector3 point, final Vector3 store); @Override Vector3 applyForwardVector(final Vector3 vector); @Override Vector3 applyForwardVector(final ReadOnlyVector3 vector, final Vector3 store); @Override Vector3 applyInverseVector(final Vector3 vector); @Override Vector3 applyInverseVector(final ReadOnlyVector3 vector, final Vector3 store); @Override Transform multiply(final ReadOnlyTransform transformBy, final Transform store); @Override Transform invert(final Transform store); @Override Matrix4 getHomogeneousMatrix(final Matrix4 store); @Override void getGLApplyMatrix(final DoubleBuffer store); @Override void getGLApplyMatrix(final FloatBuffer store); Transform fromHomogeneousMatrix(final ReadOnlyMatrix4 matrix); static boolean isValid(final ReadOnlyTransform transform); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object o); @Override boolean strictEquals(final Object o); @Override Transform clone(); @Override Class<? extends Transform> getClassTag(); @Override void write(final OutputCapsule capsule); @Override void read(final InputCapsule capsule); @Override void readExternal(final ObjectInput in); @Override void writeExternal(final ObjectOutput out); final static Transform fetchTempInstance(); final static void releaseTempInstance(final Transform trans); static final double ALLOWED_DEVIANCE; static final ReadOnlyTransform IDENTITY; }
@Test public void testInvert() { final Transform trans1 = new Transform(); trans1.setRotation(new Matrix3().applyRotationZ(3 * MathUtils.QUARTER_PI)); final Transform trans2 = trans1.invert(null); assertEquals(Transform.IDENTITY, trans1.multiply(trans2, null)); trans1.setIdentity().invert(trans1); assertEquals(Transform.IDENTITY, trans1); }