smrendererv3/SMCode/SM2D/Scene/Camera.cs
Michel Fedde beb9c19081 28.10.2020
SM.Core:
+ Particle System
+ scriptable system for scripts

~ Moved Texts- and Particles-namespace to SM.Base.Drawing
~ Changed how you tell the stopwatch to pause. (From method to property)
~ Fixed Randomize.GetFloat(min, max)
~ Now automaticly adds the DrawingBase.Transformation to DrawContext.ModelMatrix. No need to change DrawContext.Instances[0], anymore.

SM.OGL:
+ "one-file-shader"-support

SM2D:
+ DrawParticles (Control for Texture and Color not there yet)

~ Changed coordnate system to upper-right as (1,1)
~ Changed default shader to "one-file-shader"
2020-10-28 18:19:15 +01:00

27 lines
No EOL
649 B
C#

#region usings
using OpenTK;
using SM.Base.Scene;
using SM.Base.Types;
#endregion
namespace SM2D.Scene
{
public class Camera : GenericCamera
{
public CVector2 Position = new CVector2(0);
public override bool Orthographic { get; } = true;
protected override Matrix4 ViewCalculation()
{
return Matrix4.LookAt(Position.X, Position.Y, 2, Position.X, Position.Y, 0, 0, 1, 0);
}
public override void RecalculateWorld(Vector2 world, float aspect)
{
OrthographicWorld =
Matrix4.CreateOrthographic(world.X, world.Y, 0.1f, 100f);
}
}
}