mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Fixed editorcamera stuttering, Added editor icons
This commit is contained in:
@@ -219,8 +219,8 @@ namespace GlitchyEngine.World
|
||||
|
||||
float rotY = mouseDelta.X * _cameraRotationSpeedX;
|
||||
float rotX = mouseDelta.Y * _cameraRotationSpeedY;
|
||||
|
||||
if (MouseCooldown == 0 && rotY != 0 && rotX != 0)
|
||||
|
||||
if (MouseCooldown == 0)
|
||||
{
|
||||
Vector3 rotationEuler = RotationEuler + Vector3(rotX, rotY, 0);
|
||||
_rotation = Quaternion.FromEulerAngles(rotationEuler.Y, rotationEuler.X, rotationEuler.Z);
|
||||
@@ -298,7 +298,8 @@ namespace GlitchyEngine.World
|
||||
|
||||
private void UpdateProjection() mut
|
||||
{
|
||||
_projection = Matrix.InfinitePerspectiveProjection(_fovY, _aspectRatio, _nearPlane);
|
||||
//_projection = Matrix.InfinitePerspectiveProjection(_fovY, _aspectRatio, _nearPlane);
|
||||
_projection = Matrix.PerspectiveProjection(_fovY, _aspectRatio, _nearPlane, 10000);
|
||||
}
|
||||
|
||||
public void OnViewportResize(uint32 sizeX, uint32 sizeY) mut
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEditor(GameTime gameTime, EditorCamera camera, RenderTarget2D viewportTarget)
|
||||
public void UpdateEditor(GameTime gameTime, EditorCamera camera, RenderTarget2D viewportTarget, delegate void() DebugDraw3D, delegate void() DrawDebug2D)
|
||||
{
|
||||
Debug.Profiler.ProfileRendererFunction!();
|
||||
|
||||
@@ -132,16 +132,26 @@ namespace GlitchyEngine.World
|
||||
Renderer.Submit(light.SceneLight, transform.WorldTransform);
|
||||
}
|
||||
|
||||
DebugDraw3D();
|
||||
|
||||
Renderer.EndScene();
|
||||
|
||||
// TODO: alphablending
|
||||
|
||||
// Sprite renderer
|
||||
Renderer2D.BeginScene(camera);
|
||||
Renderer2D.BeginScene(camera, .BackToFront);
|
||||
|
||||
for (var (entity, transform, sprite) in _ecsWorld.Enumerate<TransformComponent, SpriterRendererComponent>())
|
||||
{
|
||||
Renderer2D.DrawQuad(transform.WorldTransform, sprite.Sprite, sprite.Color);
|
||||
}
|
||||
|
||||
Renderer2D.EndScene();
|
||||
|
||||
Renderer2D.BeginScene(camera, .BackToFront);
|
||||
|
||||
DrawDebug2D();
|
||||
|
||||
Renderer2D.EndScene();
|
||||
|
||||
viewportTarget.ReleaseRef();
|
||||
|
||||
Reference in New Issue
Block a user