working crafter math
This commit is contained in:
parent
84099f07ed
commit
809617e6c4
4 changed files with 21 additions and 20 deletions
|
|
@ -3,13 +3,19 @@ module;
|
|||
#include <cstdint>
|
||||
#include "VulkanBuffer.h"
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <iostream>
|
||||
#include <format>
|
||||
|
||||
module Crafter.Graphics;
|
||||
import Crafter.Math;
|
||||
using namespace Crafter;
|
||||
|
||||
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;
|
||||
projection = MatrixRowMajor<float, 4, 4, 1>::Perspective(fov, aspectRatio, near, far);
|
||||
view = MatrixRowMajor<float, 4, 4, 1>::Rotation(0, 0, ToRadian(180.0f))*MatrixRowMajor<float, 4, 4, 1>::Translation(1.0f, 0.0f, -10.0f);
|
||||
Update();
|
||||
}
|
||||
|
||||
void Camera::Update() {
|
||||
projectionView = projection*view;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue