Implementing ECS SystemBase and updating slang

This commit is contained in:
Dynamitos
2022-11-15 12:19:11 +01:00
parent 05bc31a2b4
commit f635ee2100
106 changed files with 1083 additions and 1675 deletions
+54
View File
@@ -0,0 +1,54 @@
#pragma once
#include "Component.h"
#include "Math/Matrix.h"
#include "Graphics/GraphicsResources.h"
#include "Transform.h"
namespace Seele
{
namespace Component
{
struct Camera
{
REQUIRE_COMPONENT(Transform)
Camera();
~Camera();
Math::Matrix4 getViewMatrix()
{
assert (!bNeedsViewBuild);
return viewMatrix;
}
Math::Matrix4 getProjectionMatrix()
{
assert (!bNeedsProjectionBuild);
return projectionMatrix;
}
Math::Vector getCameraPosition()
{
return getTransform().getPosition();
}
void setViewport(Gfx::PViewport viewport);
void mouseMove(float deltaX, float deltaY);
void mouseScroll(float x);
void moveX(float amount);
void moveY(float amount);
float aspectRatio;
float fieldOfView;
void buildViewMatrix();
void buildProjectionMatrix();
private:
bool bNeedsViewBuild;
bool bNeedsProjectionBuild;
Gfx::PViewport viewport;
//Transforms relative to actor
Math::Matrix4 viewMatrix;
Math::Matrix4 projectionMatrix;
float yaw;
float pitch;
};
} // namespace Component
} // namespace Seele