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.
45 lines
960 B
45 lines
960 B
|
|
#pragma once |
|
|
|
#include <glm/glm.hpp> |
|
|
|
#include "animation.h" |
|
#include "util.h" |
|
#include "util_image.h" |
|
|
|
|
|
// NOTE: wrapper tinygltf https://github.com/syoyo/tinygltf |
|
// https://github.com/KhronosGroup/glTF |
|
|
|
struct mesh |
|
{ |
|
uint num_vertices; |
|
uint num_indices; |
|
glm::vec3* vertices; |
|
glm::vec3* normals; |
|
uint* indices; |
|
// FIXME: will have to use vec2 here to be able to use memcpy |
|
// this will break render_object::initGLFLoatBuffer logic which expects |
|
// vec3 |
|
glm::vec3* texture_coords; |
|
glm::mat4 xform; |
|
}; |
|
|
|
#define MAX_PATH_SIZE 256 |
|
struct model |
|
{ |
|
uint num_meshes; |
|
model* next; |
|
char* filepath; |
|
uint64_t filepath_hash; |
|
mesh* meshes; // NOTE: fixed sized array |
|
// NOTE: pointer to a texture in render_state->textures |
|
util_image* diffuse_texture; |
|
// FIXME: node_animation has a pointer to a render_object. need to decouple |
|
// that somehow |
|
//node_animation* node_anim; |
|
}; |
|
|
|
model* |
|
assetLoadFromFile(memory_arena* arena, const char* filename); |
|
|
|
|