-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject.h
48 lines (36 loc) · 990 Bytes
/
object.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef OBJECT_H
#define OBJECT_H
#include <cglm/cglm.h>
#define MAX_PATHS 2000
struct model {
float *vertices;
unsigned int *indices;
float *normals;
long vertices_num;
long indices_num;
long normals_num;
};
struct object {
vec4 translation_force;
vec4 position;
vec3 color;
float mass;
void *next;
float *paths;
int paths_num;
int paths_max;
struct model *model;
float scale;
unsigned int vao; // array object for the actual object
unsigned int vbo; // buffer for vertices
unsigned int ebo; // buffer for indices
unsigned int nbo; // buffer for normals
unsigned int pvao; // array object for paths
unsigned int pbo; // buffer for paths
};
extern struct object *objects;
//int load_model_to_object(const char *path, struct object *obj);
struct model *load_model(const char *path);
int record_path(struct object *obj);
struct object *create_object(float mass, struct model *model);
#endif