DPSF by Daniel Schroeder

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

.NET API 168,448 bytes


public class Orientation2D
Class to hold and update an object's 2D Orientation, Rotational Velocity, and Rotational Acceleration
public float Orientation

The object's Rotation (in radians) (i.e. How much it is currently rotated)

The object's Rotational Acceleration (in radians)

public float RotationalVelocity

The object's Rotational Velocity (in radians)

public Orientation2D()

Default Constructor

public Orientation2D(Orientation2D cOrienationToCopy)

Copy Constructor

public static float GetRotationTo(float fCurrentRotation, float fDesiredRotation)

Returns the Rotation needed to rotate the object from the Current Rotation to the Desired Rotation

public static float Rotate(float fRotationToApply, float fCurrentOrientation)

Returns the new Orientation after applying the given Rotation

public virtual void CopyFrom(Orientation2D cOrientationToCopy)

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

public void Rotate(float fRotation)

Applies the given Rotation to the object's Orientation

public virtual void Update(float fElapsedTimeInSeconds)

Update the Orientation and Rotational Velocity according to the Rotational Acceleration