Nez.Portable/Physics/Shapes/Polygon.cs
/// <summary>
/// rotates the originalPoints and copys the rotated values to rotatedPoints
/// </summary>
/// <param name="radians">Radians.</param>
/// <param name="originalPoints">Original points.</param>
/// <param name="rotatedPoints">Rotated points.</param>
rotates the originalPoints and copys the rotated values to rotatedPoints
rotates the originalPoints and copys the rotated values to rotatedPoints
public static void rotatePolygonVerts(float radians, Vector2[] originalPoints, Vector2[] rotatedPoints)
        {
            var cos = Mathf.cos(radians);
            var sin = Mathf.sin(radians);
            for (var i = 0; i < originalPoints.Length; i++)
            {
                var position = originalPoints[i];
                rotatedPoints[i] = new Vector2(
                    position.X * cos + position.Y * -sin,
                    position.X * sin + position.Y * cos);
            }
        }
public static void rotatePolygonVerts ( float radians , Vector2 [ ] originalPoints , Vector2 [ ] rotatedPoints ) { var cos = Mathf . cos ( radians ) ; var sin = Mathf . sin ( radians ) ; for ( var i = 0 ; i < originalPoints . Length ; i ++ ) { var position = originalPoints [ i ] ; rotatedPoints [ i ] = new Vector2 ( position . X * cos + position . Y * - sin , position . X * sin + position . Y * cos ) ; } }
rotates the originalPoints and copys the rotated values to rotatedPoints
rotates the originalPoints and copys the rotated values to rotatedPoints
radians
float
None
originalPoints
Vector2[]
None
rotatedPoints
Vector2[]
None