Files
LifeProject/LifeGraphics/Camera.cpp
T

28 lines
687 B
C++
Raw Normal View History

2025-05-13 02:46:21 +03:00
#include "camera/Camera.h"
//////////////////////////////////////////////////////////////////////////
namespace LifeGraphics
{
Camera::Camera()
{
freeCam = true;
isViewValid = false;
isProjValid = false;
fDir = LifeMath::float3(0, 0, -1);
fov = 3.1415926535f / 4.0f;
nearPlane = 0.1f;
farPlane = 400.0f;
viewAspect = 1.0f;
eye = LifeMath::float3(0, 0, 0);
up = LifeMath::float3(0, 1, 0);
at = LifeMath::float3(0, 0, 1);
right = LifeMath::float3(1, 0, 0);
Mat4x4LookAtLH(eye, at, up, viewMatrix);
Mat4x4PerspectiveFOV(fov, viewAspect, nearPlane, farPlane, projectionMatrix);
frustum = Frustum(viewMatrix * projectionMatrix);
}
Camera::~Camera()
{
}
}