mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 23:20:27 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
37
server/tso.common/Rendering/Framework/Camera/OrthographicCamera.cs
Executable file
37
server/tso.common/Rendering/Framework/Camera/OrthographicCamera.cs
Executable file
|
@ -0,0 +1,37 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace FSO.Common.Rendering.Framework.Camera
|
||||
{
|
||||
/// <summary>
|
||||
/// Orthographic camera for the game. Used for rendering lots.
|
||||
/// </summary>
|
||||
public class OrthographicCamera : BasicCamera
|
||||
{
|
||||
public OrthographicCamera(GraphicsDevice device, Vector3 Position, Vector3 Target, Vector3 Up)
|
||||
: base(device, Position, Target, Up)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void CalculateProjection()
|
||||
{
|
||||
var device = m_Device;
|
||||
var aspect = device.Viewport.AspectRatio * AspectRatioMultiplier;
|
||||
|
||||
var ratioX = m_ProjectionOrigin.X / device.Viewport.Width;
|
||||
var ratioY = m_ProjectionOrigin.Y / device.Viewport.Height;
|
||||
|
||||
var projectionX = 0.0f - (1.0f * ratioX);
|
||||
var projectionY = (1.0f * ratioY);
|
||||
|
||||
m_Projection = Matrix.CreateOrthographicOffCenter(
|
||||
projectionX, projectionX + 1.0f,
|
||||
((projectionY - 1.0f) / aspect), (projectionY) / aspect,
|
||||
NearPlane, FarPlane
|
||||
);
|
||||
|
||||
var zoom = 1 / m_Zoom;
|
||||
m_Projection = m_Projection * Matrix.CreateScale(zoom);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue