Java 类net.minecraftforge.client.model.TRSRTransformation 实例源码

项目:Factorization    文件:RenderUtil.java   
public static TRSRTransformation getMatrix(FzOrientation fzo) {
    Quaternion fzq = Quaternion.fromOrientation(fzo.getSwapped());
    javax.vecmath.Matrix4f trans = newMat();
    javax.vecmath.Matrix4f rot = newMat();
    javax.vecmath.Matrix4f r90 = newMat();

    r90.setRotation(new AxisAngle4f(0, 1, 0, (float) Math.PI / 2));

    trans.setTranslation(new javax.vecmath.Vector3f(0.5F, 0.5F, 0.5F));
    javax.vecmath.Matrix4f iTrans = new javax.vecmath.Matrix4f(trans);
    iTrans.invert();
    rot.setRotation(fzq.toJavax());
    rot.mul(r90);

    trans.mul(rot);
    trans.mul(iTrans);

    return new TRSRTransformation(trans);
}