Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
Added rotation origin
Browse files Browse the repository at this point in the history
  • Loading branch information
craftersmine committed Feb 27, 2019
1 parent a583aa5 commit 0bf4803
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions craftersmine.EtherEngine.Core/Transform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public sealed class Transform
public int Width { get; set; }
public int Height { get; set; }

public int RotationOriginX { get; set; }
public int RotationOriginY { get; set; }
public float RotationAngle { get; set; }

public void Rotate(float angle)
Expand All @@ -24,5 +26,11 @@ public void Rotate(float angle)
if (RotationAngle >= 360.0f)
RotationAngle = RotationAngle - 360.0f;
}

public void ResetRotationOrigin()
{
RotationOriginX = Width / 2 + RendererX;
RotationOriginY = Height / 2 + RendererY;
}
}
}

0 comments on commit 0bf4803

Please sign in to comment.