Implementing ECS SystemBase and updating slang
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user