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)); } }
public void SetRotation(float r) { if (rotation != r) { this.CallTransform(Matrix.CreateRotateTransform( rotation = (r / 180f * MathUtils.PI), this.center[0], this.center[1])); } }
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); }