WIP crafter.math
This commit is contained in:
parent
98b775e33e
commit
84099f07ed
11 changed files with 139 additions and 310 deletions
|
|
@ -1,26 +1,15 @@
|
|||
module;
|
||||
|
||||
#include <cstdint>
|
||||
#define GLM_FORCE_RADIANS
|
||||
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||
#define GLM_ENABLE_EXPERIMENTAL
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/matrix_inverse.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include "VulkanBuffer.h"
|
||||
#include "camera.hpp"
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
module Crafter.Graphics;
|
||||
import Crafter.Math;
|
||||
using namespace Crafter;
|
||||
|
||||
Camera::Camera() {
|
||||
old::Camera camera;
|
||||
camera.type = old::Camera::CameraType::firstperson;
|
||||
camera.setPerspective(90.0f, 16 / 9, 0.1f, 512.0f);
|
||||
camera.setRotation(glm::vec3(180.0f, 150, 0));
|
||||
camera.setTranslation(glm::vec3(-100.0f, -130.0f, -100.0f));
|
||||
|
||||
Camera::Camera(float fov, float aspectRatio, float near, float far) {
|
||||
projection = Matrix<float, 4, 4, 1>::Projection(fov, aspectRatio, near, far);
|
||||
view = Matrix<float, 4, 4, 1>::Idenity();
|
||||
projectionView = camera.matrices.perspective*camera.matrices.view;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue