17.09.2020
+ Generic Scene + Generic Camera + Generic Window + Contexts for drawing and updateing + very basic 2D-implermention
This commit is contained in:
parent
9889366317
commit
589d131246
25 changed files with 383 additions and 78 deletions
22
SMCode/SM2D/Scene/Camera.cs
Normal file
22
SMCode/SM2D/Scene/Camera.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using OpenTK;
|
||||
using SM.Base.Scene;
|
||||
|
||||
namespace SM2D.Scene
|
||||
{
|
||||
public class Camera : GenericCamera
|
||||
{
|
||||
public override bool Orthographic { get; } = true;
|
||||
|
||||
public Vector2 Position;
|
||||
|
||||
public override Matrix4 ViewCalculation()
|
||||
{
|
||||
return Matrix4.LookAt(Position.X, Position.Y, -1, Position.X, Position.Y, 0, 0, 1, 0);
|
||||
}
|
||||
|
||||
public override void RecalculateWorld(float width, float height)
|
||||
{
|
||||
OrthographicWorld = Matrix4.CreateOrthographic(width, height, 0.1f, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue