07.10.2020
+ Parent, Name and Flags to objects. ~ Improved Matrix calculations
This commit is contained in:
parent
f865496414
commit
2c00dbd31a
21 changed files with 383 additions and 42 deletions
20
SMCode/SM.Base/Utility/RotationUtility.cs
Normal file
20
SMCode/SM.Base/Utility/RotationUtility.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using OpenTK;
|
||||
|
||||
namespace SM.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Utilitys for rotations
|
||||
/// </summary>
|
||||
public class RotationUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// Angle towards an coordinate.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static float TurnTowards(Vector2 origin, Vector2 target)
|
||||
{
|
||||
return MathHelper.RadiansToDegrees((float)Math.Atan2(target.Y - origin.Y, target.X - origin.X));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue