ctaza/entity.hpp

43 lines
707 B
C++

#pragma once
#include "u.hpp"
#include "components.hpp"
#include "mesh.hpp"
#include <memory>
struct Entity {
struct : Component {
glm::vec3 pos;
float &x = pos.x;
float &y = pos.y;
float &z = pos.z;
} position;
struct : Component {
Mesh *mesh;
} mesh;
struct : Component {
u64 max;
u64 current;
} health;
struct : Component {
AABB box;
} collision;
struct : Component {
glm::vec3 col;
float &r = col.r;
float &g = col.g;
float &b = col.b;
} colour;
struct : Component {
float strength;
glm::vec3 diffuse;
} point_light;
~Entity();
};