You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
698 B
39 lines
698 B
|
|
#pragma once |
|
|
|
#include <glm/glm.hpp> |
|
#include <glm/gtc/matrix_transform.hpp> |
|
|
|
#include "mesh.h" |
|
#include "render_group.h" |
|
|
|
struct Entity |
|
{ |
|
glm::mat4 world_transform; |
|
glm::vec3 scale; |
|
glm::vec3 translation; |
|
glm::vec4 rotation; |
|
|
|
meMeshGroup mesh_group; |
|
render_group* ren_group; |
|
|
|
char model_filename[256]; |
|
}; |
|
|
|
inline void |
|
entTranslate(Entity& e, glm::vec3 v) |
|
{ |
|
e.world_transform = glm::translate(e.world_transform, v); |
|
} |
|
|
|
inline void |
|
entScale(Entity& e, glm::vec3 v) |
|
{ |
|
e.world_transform = glm::scale(e.world_transform, v); |
|
} |
|
|
|
bool entInit(Entity& e, const char* data_dir, rg_shader_program& shader); |
|
|
|
void entFree(Entity& e); |
|
|
|
void entSetWorldPosition(Entity& e, float x, float y, float z);
|
|
|