This commit is contained in:
austin committed 2020-07-01 17:40:12 -07:00
1 parent 777df2cbe7
commit 9fbd7938d0
38 files changed
+2150

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "Math/Mat44.hpp"
#include <cmath>
struct Camera
{
Mat44 projectionTransform;
static Mat44 MakeProjectionTransform(float fov, float nearClip, float farClip, unsigned int viewWidth, unsigned int viewHeight)
{
float zClipBias0 =
(farClip + nearClip)
/ (farClip - nearClip);
float zClipBias1 =
(2.0f * farClip * nearClip)
/ (farClip - nearClip);
float zoomX = 1.0f / tanf((fov / 2.0f) * (M_PI / 180.0f));
float zoomY = (zoomX * static_cast<float>(viewWidth)) / static_cast<float>(viewHeight);
Mat44 transform;
transform.m[0][0] = zoomX;
transform.m[1][1] = zoomY;
transform.m[2][2] = -zClipBias0;
transform.m[3][2] = -1;
transform.m[2][3] = -zClipBias1;
return transform;
}
};
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include "Math/Vec3.hpp"
struct Gravity
{
Vec3 force;
};
+6
View File
@@ -0,0 +1,6 @@
#pragma once
struct Player
{
};
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include "Math/Vec3.hpp"
struct Renderable
{
Vec3 color;
};
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include "Math/Vec3.hpp"
struct RigidBody
{
Vec3 velocity;
Vec3 acceleration;
};
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include "Math/Vec3.hpp"
struct Thrust
{
Vec3 force;
};
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include "Math/Vec3.hpp"
struct Transform
{
Vec3 position;
Vec3 rotation;
Vec3 scale;
};