DPSF by Daniel Schroeder

<PackageReference Include="DPSF" Version="2.5.0" />

.NET API 168,448 bytes

 PivotPoint2D

public class PivotPoint2D
Class to hold and update an object's 2D Pivot Point (point to rotate around), Pivot Velocity, and Pivot Acceleration. This class requires a Position2D object, and optionally a Orientation2D object, that should be affected by rotations around the Pivot Point.
public Vector2 PivotPoint

The 2D Pivot Point that the object should rotate around.

NOTE: This only has effect when Rotational Pivot Velocity / Acceleration are used.

The object's Rotational Acceleration around the Pivot Point (Position change).

NOTE: Rotations are specified in radians.

The object's Rotational Velocity around the Pivot Point (Position change).

NOTE: Rotations are specified in radians.

public Orientation2D OrientationData { get; set; }

Get / Set the Orientation2D object that the Pivot Point should affect

public Position2D PositionData { get; set; }

Get / Set the Position2D object that the Pivot Point should affect

public bool RotateOrientationToo { get; set; }

Specify if the Update() function should Rotate the object's Orientation too when it rotates the object around the Pivot Point

public PivotPoint2D(PivotPoint2D cPivotPointToCopy)

Copy Constructor

public PivotPoint2D(Position2D cPosition)

Explicit Constructor. Set the Position2D object that should be affected by rotations around this Pivot Point.

public PivotPoint2D(Position2D cPosition, Orientation2D cOrientation)

Explicit Constructor. Set the Position2D and Orientation2D objects that should be affected by rotational around this Pivot Point.

public static Vector2 RotatePosition(float fRotation, Vector2 sPivotPoint, Vector2 sPosition)

Returns the new Position after Rotating the given Position around the specified Pivot Point

public static void RotatePositionAndOrientation(float fRotation, Vector2 sPivotPoint, ref Vector2 srPosition, ref float frOrientation)

Rotates the given Position and Orientation around the Pivot Point, changing the Position and Orientation

public static void RotatePositionAndOrientationVector3(float fRotation, Vector3 sPivotPoint, ref Vector3 srPosition, ref float frOrientation)

Rotates the given Position and Orientation around the Pivot Point, changing the Position and Orientation.

NOTE: The Pivot Point and Position's Z-values are ignored.

NOTE: This function is provided for convenience when using 3D Vectors in 2D coordinate systems.

public static Vector3 RotatePositionVector3(float fRotation, Vector3 sPivotPoint, Vector3 sPosition)

Returns the new Position after Rotating the given Position around the specified Pivot Point.

NOTE: The Pivot Point and Position's Z-values are ignored.

This function is provided for convenience when using 3D Vectors in 2D coordinate systems.

public void CopyFrom(PivotPoint2D cPivotPointToCopy)

Copies the given PivotPoint2D object's data into this object's data

public void RotatePosition(float fRotation, Vector2 sPivotPoint)

Rotates the object around the specified Pivot Point, changing its Position, without changing its Orientation.

public void RotatePositionAndOrientation(float fRotation, Vector2 sPivotPoint)

Rotates the object about its center, changing its Orientation, as well as around the specified Pivot Point, changing its Position

public void RotatePositionAndOrientationVector3(float fRotation, Vector3 sPivotPoint)

Rotates the object about its center, changing its Orientation, as well as around the specified 3D Pivot Point, changing its 2D Position.

NOTE: The Pivot Point's Z-value is ignored.

NOTE: This function is provided for convenience when using 3D Vectors in 2D coordinate systems.

public void RotatePositionVector3(float fRotation, Vector3 sPivotPoint)

Rotates the object around the specified Pivot Point, changing its Position, without changing its Orientation.

NOTE: The Pivot Point's Z-value is ignored.

NOTE: This function is provided for convenience when using 3D Vectors in 2D coordinate systems.

public void Update(float fElapsedTimeInSeconds)

Update the Position and Orientation according to the Pivot Rotational Velocity / Acceleration