Add Input class
- Add Input class used to poll mouse and key button states - Add additional example systems to the Scene
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "copium/ecs/System.h"
|
||||
#include "copium/example/Components.h"
|
||||
|
||||
namespace Copium
|
||||
{
|
||||
class CameraFollowPlayerSystem : public System<PlayerC, TransformC>
|
||||
{
|
||||
public:
|
||||
void RunEntity(Entity entity, PlayerC& player, TransformC& transform) override
|
||||
{
|
||||
TransformC& cameraTransform = player.camera.GetComponent<TransformC>();
|
||||
glm::vec2 wantedPos = transform.position + transform.size * 0.5f;
|
||||
cameraTransform.position -= (cameraTransform.position - wantedPos) * 0.10f;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user