+ Time controls (Stopwatch, Timers, Intervals) + Added smmeries to everything in SM.Base ~ Renamed Vectors to CVectors.
23 lines
No EOL
656 B
C#
23 lines
No EOL
656 B
C#
using OpenTK;
|
|
using SM.Base.Scene;
|
|
using SM.Base.Types;
|
|
|
|
namespace SM2D.Scene
|
|
{
|
|
public class Camera : GenericCamera
|
|
{
|
|
public override bool Orthographic { get; } = true;
|
|
|
|
public CVector2 Position = new CVector2(0);
|
|
|
|
protected override Matrix4 ViewCalculation()
|
|
{
|
|
return Matrix4.LookAt(Position.X, Position.Y, 2, Position.X, Position.Y, 0, 0, 1, 0);
|
|
}
|
|
|
|
public override void RecalculateWorld(OpenTK.Vector2 world, float aspect)
|
|
{
|
|
OrthographicWorld = Matrix4.CreateOrthographicOffCenter(-world.X / 2, world.X / 2, world.Y / 2, -world.Y / 2, 0.1f, 4f);
|
|
}
|
|
}
|
|
} |