07.10.2020
+ Parent, Name and Flags to objects. ~ Improved Matrix calculations
This commit is contained in:
parent
f865496414
commit
2c00dbd31a
21 changed files with 383 additions and 42 deletions
|
|
@ -24,6 +24,10 @@ namespace SM.Base.Contexts
|
|||
/// </summary>
|
||||
public Matrix4 View;
|
||||
/// <summary>
|
||||
/// The master model matrix.
|
||||
/// </summary>
|
||||
public Matrix4 ModelMaster;
|
||||
/// <summary>
|
||||
/// The drawing instances.
|
||||
/// <para>If there is only one, it's index 0</para>
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace SM.Base.Contexts
|
|||
/// <summary>
|
||||
/// The delta time.
|
||||
/// </summary>
|
||||
public float Deltatime => Defaults.DefaultDeltatime.DeltaTime;
|
||||
public float Deltatime => SMRenderer.DefaultDeltatime.DeltaTime;
|
||||
|
||||
/// <summary>
|
||||
/// The current keyboard state.
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue