#pragma once #include #include #include "mesh.h" #include "render_group.h" // NOTE: an entity is the basic unit of the high level renderer interface struct entity { // NOTE: glm::mat4 combines translation, scale, and rotation in a 4x4 // transform matrix. This is the equivalent of the 'model' matrix in // the model, view, projection matrix composition glm::mat4 world_transform; // TODO: should be a pointer into a global array of mesh_info(s) or // mesh_groups stored on the render_state object meMeshGroup mesh_group; // NOTE: an array of render objects with all the vertex, normal, and uv // data loaded from assimp render_object* ren_objects; uint ren_object_count; //render_group* ren_group; }; // NOTE: an entity group is an array of entities rendered with the same shader // program struct entity_group { entity* entities; uint entity_count; rg_shader_program shader_prg; }; 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* model_path, rg_shader_program& shader); void entFree(entity& e); void entSetWorldPosition(entity& e, float x, float y, float z);