Almost removed Halibut Engine
This commit is contained in:
1 parent
2e6989afe7
commit
feef4c1453
16 files changed
+636
-426
No files matched your search
@@ -0,0 +1,123 @@
|
||||
#ifndef CAMERAS_H_INCLUDED
|
||||
#define CAMERAS_H_INCLUDED
|
||||
|
||||
#include "include/Utils/Utils.h"
|
||||
|
||||
namespace SE
|
||||
{
|
||||
|
||||
|
||||
struct TCameraInterface
|
||||
{
|
||||
vec3 CamVec;
|
||||
|
||||
vec3 CamShift;
|
||||
|
||||
TCameraInterface();
|
||||
|
||||
virtual ~TCameraInterface()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct TPanoramicCamera : public TCameraInterface
|
||||
{
|
||||
|
||||
float CamAlpha;
|
||||
float CamPhi;
|
||||
float CamDist;
|
||||
|
||||
TPanoramicCamera();
|
||||
|
||||
void MoveAlpha(float dAlpha);
|
||||
void MovePhi(float dPhi);
|
||||
void MoveDist(float dDist);
|
||||
void SetAlpha(float alpha);
|
||||
|
||||
void MoveForward();
|
||||
void MoveBackward();
|
||||
void MoveLeft();
|
||||
void MoveRight();
|
||||
|
||||
void CalcCamVec();
|
||||
|
||||
void SetCamView();
|
||||
};
|
||||
|
||||
struct TPitCamera : public TCameraInterface
|
||||
{
|
||||
vec4 CameraQuat;
|
||||
|
||||
void SetCamView();
|
||||
|
||||
void CalcCamVec();
|
||||
|
||||
void RotateByQuat(vec4 quat);
|
||||
};
|
||||
|
||||
|
||||
typedef boost::variant<TPanoramicCamera, TPitCamera> TCamera;
|
||||
|
||||
|
||||
struct TSetCameraViewVisitor : public boost::static_visitor<void>
|
||||
{
|
||||
void operator()(TPanoramicCamera& panoramicCamera)
|
||||
{
|
||||
panoramicCamera.SetCamView();
|
||||
}
|
||||
|
||||
void operator()(TPitCamera& pitCamera)
|
||||
{
|
||||
pitCamera.SetCamView();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TCalcCamVecVisitor : public boost::static_visitor<void>
|
||||
{
|
||||
void operator()(TPanoramicCamera& panoramicCamera)
|
||||
{
|
||||
panoramicCamera.CalcCamVec();
|
||||
}
|
||||
|
||||
void operator()(TPitCamera& pitCamera)
|
||||
{
|
||||
pitCamera.CalcCamVec();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TGetCamVecVisitor : public boost::static_visitor<vec3&>
|
||||
{
|
||||
vec3& operator()(TPanoramicCamera& panoramicCamera) const
|
||||
{
|
||||
return panoramicCamera.CamVec;
|
||||
}
|
||||
|
||||
vec3& operator()(TPitCamera& pitCamera) const
|
||||
{
|
||||
return pitCamera.CamVec;
|
||||
}
|
||||
};
|
||||
|
||||
struct TGetCamShiftVisitor : public boost::static_visitor<vec3&>
|
||||
{
|
||||
vec3& operator()(TPanoramicCamera& panoramicCamera) const
|
||||
{
|
||||
return panoramicCamera.CamShift;
|
||||
}
|
||||
|
||||
vec3& operator()(TPitCamera& pitCamera) const
|
||||
{
|
||||
return pitCamera.CamShift;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} //namespace SE
|
||||
|
||||
#endif
|
||||
@@ -11,127 +11,17 @@
|
||||
|
||||
#include "include/Render/RenderInterface.h"
|
||||
|
||||
#include "include/Render/SalmonRender/Cameras.h"
|
||||
|
||||
namespace SE
|
||||
{
|
||||
|
||||
struct TCameraInterface
|
||||
{
|
||||
vec3 CamVec;
|
||||
|
||||
vec3 CamShift;
|
||||
|
||||
TCameraInterface();
|
||||
|
||||
virtual ~TCameraInterface()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct TPanoramicCamera : public TCameraInterface
|
||||
{
|
||||
|
||||
float CamAlpha;
|
||||
float CamPhi;
|
||||
float CamDist;
|
||||
|
||||
TPanoramicCamera();
|
||||
|
||||
void MoveAlpha(float dAlpha);
|
||||
void MovePhi(float dPhi);
|
||||
void MoveDist(float dDist);
|
||||
void SetAlpha(float alpha);
|
||||
|
||||
void MoveForward();
|
||||
void MoveBackward();
|
||||
void MoveLeft();
|
||||
void MoveRight();
|
||||
|
||||
void CalcCamVec();
|
||||
|
||||
void SetCamView();
|
||||
};
|
||||
|
||||
struct TPitCamera : public TCameraInterface
|
||||
{
|
||||
vec4 CameraQuat;
|
||||
|
||||
void SetCamView();
|
||||
|
||||
void CalcCamVec();
|
||||
|
||||
void RotateByQuat(vec4 quat);
|
||||
};
|
||||
|
||||
|
||||
typedef boost::variant<TPanoramicCamera, TPitCamera> TCamera;
|
||||
|
||||
|
||||
struct TSetCameraViewVisitor : public boost::static_visitor<void>
|
||||
{
|
||||
void operator()(TPanoramicCamera& panoramicCamera)
|
||||
{
|
||||
panoramicCamera.SetCamView();
|
||||
}
|
||||
|
||||
void operator()(TPitCamera& pitCamera)
|
||||
{
|
||||
pitCamera.SetCamView();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TCalcCamVecVisitor : public boost::static_visitor<void>
|
||||
{
|
||||
void operator()(TPanoramicCamera& panoramicCamera)
|
||||
{
|
||||
panoramicCamera.CalcCamVec();
|
||||
}
|
||||
|
||||
void operator()(TPitCamera& pitCamera)
|
||||
{
|
||||
pitCamera.CalcCamVec();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TGetCamVecVisitor : public boost::static_visitor<vec3&>
|
||||
{
|
||||
vec3& operator()(TPanoramicCamera& panoramicCamera) const
|
||||
{
|
||||
return panoramicCamera.CamVec;
|
||||
}
|
||||
|
||||
vec3& operator()(TPitCamera& pitCamera) const
|
||||
{
|
||||
return pitCamera.CamVec;
|
||||
}
|
||||
};
|
||||
|
||||
struct TGetCamShiftVisitor : public boost::static_visitor<vec3&>
|
||||
{
|
||||
vec3& operator()(TPanoramicCamera& panoramicCamera) const
|
||||
{
|
||||
return panoramicCamera.CamShift;
|
||||
}
|
||||
|
||||
vec3& operator()(TPitCamera& pitCamera) const
|
||||
{
|
||||
return pitCamera.CamShift;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class TSalmonRendererInterface : public TRendererInterface
|
||||
{
|
||||
protected:
|
||||
|
||||
/*
|
||||
float CamAlpha;
|
||||
float CamPhi;
|
||||
float CamDist;
|
||||
vec3 CamShift;*/
|
||||
|
||||
mat4 CamModelViewMatrix;
|
||||
mat4 CamInversedModelViewMatrix;
|
||||
|
||||
@@ -167,6 +57,9 @@ public:
|
||||
void SetPerspectiveFullScreenViewport();
|
||||
void SetOrthoFullScreenViewport();
|
||||
|
||||
void SetPerspectiveProjection(float angle = pi/6.f, float zNear = 1.f, float zFar = 100.f);
|
||||
void SetOrthoProjection();
|
||||
|
||||
mat4 GetModelviewMatrix();
|
||||
|
||||
void SetPerspectiveProjectionMatrix(float angle, float aspect, float zNear, float zFar);
|
||||
|
||||
Reference in new issue
Block a user