18.09.2020
+ Textures ~ Changed 2D coordnate system to lower right as XY+
This commit is contained in:
parent
589d131246
commit
a603ecc417
26 changed files with 267 additions and 16 deletions
19
SMCode/SM2D/Types/Transformation.cs
Normal file
19
SMCode/SM2D/Types/Transformation.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using OpenTK;
|
||||
using SM.Base.Scene;
|
||||
|
||||
namespace SM2D.Types
|
||||
{
|
||||
public class Transformation : GenericTransformation
|
||||
{
|
||||
public Vector2 Position;
|
||||
public Vector2 Size = new Vector2(50);
|
||||
public float Rotation;
|
||||
|
||||
public override Matrix4 GetMatrix()
|
||||
{
|
||||
return Matrix4.CreateScale(Size.X, Size.Y, 1) *
|
||||
Matrix4.CreateRotationZ(MathHelper.DegreesToRadians(Rotation)) *
|
||||
Matrix4.CreateTranslation(Position.X, Position.Y, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue