예제 #1
0
 public void SetRotation(float r, float x_0, float y_1)
 {
     if (rotation != r)
     {
         this.CallTransform(Matrix.CreateRotateTransform(
                                rotation = (r / 180f * MathUtils.PI), x_0, y_1));
     }
 }
예제 #2
0
 public void SetRotation(float r)
 {
     if (rotation != r)
     {
         this.CallTransform(Matrix.CreateRotateTransform(
                                rotation = (r / 180f * MathUtils.PI), this.center[0],
                                this.center[1]));
     }
 }
예제 #3
0
파일: Matrix.cs 프로젝트: vb0067/LGame
        public static Matrix CreateRotateTransform(float angle, float x, float y)
        {
            Matrix temp             = Matrix.CreateRotateTransform(angle);
            float  sinAngle         = temp.matrixs[3];
            float  oneMinusCosAngle = 1.0f - temp.matrixs[4];

            temp.matrixs[2] = x * oneMinusCosAngle + y * sinAngle;
            temp.matrixs[5] = y * oneMinusCosAngle - x * sinAngle;
            return(temp);
        }