Example #1
0
        //-------------------------------------//
        public ty_Matrix3x2 getSliceTransformMatrix(int ObjectIndex, int LayerIndex)
        {
            ty_Matrix3x2 tmpA = new ty_Matrix3x2();
            ty_Matrix3x2 tmpB = new ty_Matrix3x2();

            if ((ObjectIndex < 0) || (ObjectIndex >= m_List.Count))
            {
                return(tmpA);
            }

            ty_part tmpPart = m_List[ObjectIndex];

            float a = (float)(tmpPart.rotation * 2 * Math.PI / 360.0);

            //- toDo : rotation und skalierung!
            tmpA.m00 = Math.Cos(a); tmpA.m10 = -Math.Sin(a);
            tmpA.m01 = Math.Sin(a); tmpA.m11 = Math.Cos(a);

            tmpA.m20 = 0;
            tmpA.m21 = 0;



            tmpB.m00 = 1; tmpB.m10 = 0;
            tmpB.m01 = 0; tmpB.m11 = 1;

            tmpB.m20 = (float)tmpPart.x;
            tmpB.m21 = (float)tmpPart.y;


            ty_Matrix3x2 resultMat = ty_Matrix3x2.MatrixMult(tmpB, tmpA);


            return(resultMat);
        }
Example #2
0
        //-------------------------------------------------------//
        public static ty_Matrix3x2 MatrixMult(ty_Matrix3x2 A, ty_Matrix3x2 B)
        {
            ty_Matrix3x2 C = new ty_Matrix3x2();

            C.m00 = A.m00 * B.m00 + A.m10 * B.m01 + A.m20 * 0;
            C.m10 = A.m00 * B.m10 + A.m10 * B.m11 + A.m20 * 0;
            C.m20 = A.m00 * B.m20 + A.m10 * B.m21 + A.m20 * 1;

            C.m01 = A.m01 * B.m00 + A.m11 * B.m01 + A.m21 * 0;
            C.m11 = A.m01 * B.m10 + A.m11 * B.m11 + A.m21 * 0;
            C.m21 = A.m01 * B.m20 + A.m11 * B.m21 + A.m21 * 1;

            return(C);
        }
Example #3
0
        //-------------------------------------//
        public ty_Matrix3x2 getSliceTransformMatrix(int ObjectIndex, int LayerIndex)
        {
            ty_Matrix3x2 tmp = new ty_Matrix3x2();;

            return(tmp);
        }