07.10.2020

+ Parent, Name and Flags to objects.

~ Improved Matrix calculations
This commit is contained in:
Michel Fedde 2020-10-08 12:25:20 +02:00
parent f865496414
commit 2c00dbd31a
21 changed files with 383 additions and 42 deletions

View file

@ -95,6 +95,16 @@ namespace SM.Base
MouseState = Mouse.GetState()
};
Update(e, ref context);
}
/// <summary>
/// Updates the system.
/// </summary>
/// <param name="e"></param>
/// <param name="context"></param>
protected virtual void Update(FrameEventArgs e, ref UpdateContext context)
{
Stopwatch.PerformTicks(context);
}
@ -152,14 +162,24 @@ namespace SM.Base
ViewportCamera = new TCamera();
}
/// <inheritdoc />
protected override void Update(FrameEventArgs e, ref UpdateContext context)
{
base.Update(e, ref context);
CurrentScene?.Update(context);
}
/// <inheritdoc />
protected override void OnRenderFrame(FrameEventArgs e)
{
SMRenderer.CurrentFrame++;
Deltatime.RenderDelta = (float)e.Time;
DrawContext drawContext = new DrawContext()
{
World = ViewportCamera.World,
View = ViewportCamera.CalculateViewMatrix(),
ModelMaster = Matrix4.Identity,
Instances = new[] { new Instance {ModelMatrix = Matrix4.Identity, TexturePosition = Vector2.Zero, TextureScale = Vector2.One } },
Mesh = Plate.Object,
ForceViewport = ForceViewportCamera,