budnhead/org.budnhead/graphics/GLSceneOrientation.cs

44 lines
731 B
C#
Raw Normal View History

2017-04-25 22:01:18 +02:00
using System;
using OpenTK;
using OpenTK.Graphics.OpenGL;
2017-05-09 23:41:50 +02:00
namespace org.budnhead.graphics
2017-04-25 22:01:18 +02:00
{
public class GLSceneOrientation
{
protected Matrix4
_mCamera,
_mProjection;
2017-04-25 22:01:18 +02:00
public GLSceneOrientation()
{
_mCamera = Matrix4.Identity;
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
MathHelper.PiOver4,
1.0f,
50.0f,
100000.0f
);
2017-04-25 22:01:18 +02:00
}
public Matrix4 mCamera(){
return this._mCamera;
}
public Matrix4 mProjection(){
return this._mProjection;
}
public virtual void setViewport(int width, int height){
float aspect = width / height;
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
MathHelper.PiOver2,
aspect,
2017-05-26 15:48:09 +02:00
50.0f,
100000.0f
);
}
2017-04-25 22:01:18 +02:00
}
}