2018-02-11 23:22:04 +00:00
|
|
|
#include "data/modelData.h"
|
2017-11-05 21:41:47 +00:00
|
|
|
#include "graphics/animator.h"
|
2017-10-21 22:20:16 +00:00
|
|
|
#include "graphics/material.h"
|
2017-03-11 22:13:49 +00:00
|
|
|
#include "graphics/mesh.h"
|
2016-11-19 09:28:01 +00:00
|
|
|
#include "graphics/texture.h"
|
2017-01-21 03:55:54 +00:00
|
|
|
#include "math/math.h"
|
2017-04-13 02:48:17 +00:00
|
|
|
#include "lib/glfw.h"
|
2016-11-19 07:41:23 +00:00
|
|
|
#include "util.h"
|
2017-11-02 02:27:58 +00:00
|
|
|
#include <stdbool.h>
|
2016-07-09 05:27:34 +00:00
|
|
|
|
2017-01-26 10:20:30 +00:00
|
|
|
#pragma once
|
2016-11-26 07:15:04 +00:00
|
|
|
|
2016-10-04 04:54:27 +00:00
|
|
|
typedef struct {
|
2016-11-19 07:41:23 +00:00
|
|
|
Ref ref;
|
2016-10-04 04:54:27 +00:00
|
|
|
ModelData* modelData;
|
2018-01-30 05:44:32 +00:00
|
|
|
Texture** textures;
|
2017-10-21 22:20:16 +00:00
|
|
|
Material** materials;
|
2017-11-26 03:02:28 +00:00
|
|
|
Material* material;
|
2017-11-05 21:41:47 +00:00
|
|
|
Animator* animator;
|
2018-01-30 05:44:32 +00:00
|
|
|
Mesh* mesh;
|
2017-11-21 02:42:29 +00:00
|
|
|
float pose[MAX_BONES][16];
|
2017-11-21 02:50:06 +00:00
|
|
|
float (*nodeTransforms)[16];
|
2017-11-02 02:27:58 +00:00
|
|
|
float aabb[6];
|
|
|
|
bool aabbDirty;
|
2016-10-04 04:54:27 +00:00
|
|
|
} Model;
|
2016-11-26 07:15:04 +00:00
|
|
|
|
2016-11-25 08:49:19 +00:00
|
|
|
Model* lovrModelCreate(ModelData* modelData);
|
2016-11-19 07:41:23 +00:00
|
|
|
void lovrModelDestroy(const Ref* ref);
|
2017-11-26 03:45:44 +00:00
|
|
|
void lovrModelDraw(Model* model, mat4 transform, int instances);
|
2017-11-05 21:41:47 +00:00
|
|
|
Animator* lovrModelGetAnimator(Model* model);
|
|
|
|
void lovrModelSetAnimator(Model* model, Animator* animator);
|
2017-11-21 02:15:10 +00:00
|
|
|
int lovrModelGetAnimationCount(Model* model);
|
2017-11-26 03:02:28 +00:00
|
|
|
Material* lovrModelGetMaterial(Model* model);
|
|
|
|
void lovrModelSetMaterial(Model* model, Material* material);
|
2017-10-15 17:26:33 +00:00
|
|
|
Mesh* lovrModelGetMesh(Model* model);
|
2017-11-02 02:27:58 +00:00
|
|
|
const float* lovrModelGetAABB(Model* model);
|