16 lines
530 B
C++
16 lines
530 B
C++
// =============================================
|
|
// Aster: camera.cpp
|
|
// Copyright (c) 2020-2024 Anish Bhobe
|
|
// =============================================
|
|
|
|
#include "camera.h"
|
|
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
#include <glm/gtc/type_ptr.hpp>
|
|
|
|
Camera::Camera(const vec3 position, const vec3 direction, const f32 verticalFov, const f32 aspectRatio)
|
|
: m_Projection{glm::perspective(verticalFov, aspectRatio, 1.0f, 100.0f)}
|
|
, m_View{lookAt(position, direction + position, vec3(0, 1, 0))}
|
|
{
|
|
} |