예제 #1
0
    void Manipulate(float delta)
    {
        delta = TKMath.ToRadians(delta);

        Vector2 origin = Position;

        foreach (EVertex v in editor.selectedVertices)
        {
            Vector2 diff = v.Position - origin;

            float sin = (float)Math.Sin(delta);
            float cos = (float)Math.Cos(delta);

            Vector2 deltaPos = new Vector2(diff.X * cos - diff.Y * sin, diff.Y * cos + diff.X * sin);
            v.Position = origin + deltaPos;
        }
    }