lovr/src/graphics/model.h

37 lines
1000 B
C
Raw Normal View History

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"
#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;
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);
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);
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);