Ejemplo n.º 1
0
    public static void UnityMatrix2PsxMatrix(Matrix4x4 unityWorldToCameraMatrix, Int16[,] psxRotation, Int32[] psxTranslation)
    {
        Matrix4x4 matrix4x = unityWorldToCameraMatrix;

        psxRotation[0, 0] = PSX.FloatToFp12(matrix4x.m00);
        psxRotation[0, 1] = PSX.FloatToFp12(-matrix4x.m01);
        psxRotation[0, 2] = PSX.FloatToFp12(matrix4x.m02);
        psxRotation[1, 0] = PSX.FloatToFp12(-matrix4x.m10);
        psxRotation[1, 1] = PSX.FloatToFp12(matrix4x.m11);
        psxRotation[1, 2] = PSX.FloatToFp12(-matrix4x.m12);
        psxRotation[2, 0] = PSX.FloatToFp12(-matrix4x.m20);
        psxRotation[2, 1] = PSX.FloatToFp12(matrix4x.m21);
        psxRotation[2, 2] = PSX.FloatToFp12(-matrix4x.m22);
        psxTranslation[0] = (Int32)matrix4x.m03;
        psxTranslation[1] = -(Int32)matrix4x.m13;
        psxTranslation[2] = -(Int32)matrix4x.m23;
    }
Ejemplo n.º 2
0
 public static Int16 AngleDegreeToFp12(Single f)
 {
     return(PSX.FloatToFp12(f / 360f));
 }