public virtual void SetRotation(float r, float x, float y) { if (rotation != r) { this.CallTransform(Matrix3.CreateRotateTransform(rotation = (r / 180f * MathUtils.PI), x, y)); } }
public virtual void SetRotation(float r) { if (rotation != r) { this.CallTransform(Matrix3.CreateRotateTransform(rotation = (r / 180f * MathUtils.PI), this.center[0], this.center[1])); } }
public static Matrix3 CreateRotateTransform(float angle, float x, float y) { Matrix3 temp = Matrix3.CreateRotateTransform(angle); float sinAngle = temp.val[3]; float oneMinusCosAngle = 1.0f - temp.val[4]; temp.val[2] = x * oneMinusCosAngle + y * sinAngle; temp.val[5] = y * oneMinusCosAngle - x * sinAngle; return(temp); }