2024-10-07 22:15:42 +00:00
|
|
|
#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;
|
|
|
|
|
|
|
|
struct model *model;
|
|
|
|
float scale;
|
|
|
|
|
2024-10-08 17:43:14 +00:00
|
|
|
unsigned int vao;
|
|
|
|
unsigned int vbo; // vertices
|
|
|
|
unsigned int ebo; // indices
|
|
|
|
unsigned int nbo; // normals
|
2024-10-07 22:15:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct model *load_model(const char *path);
|
|
|
|
int record_path(struct object *obj);
|
|
|
|
struct object *create_object(struct object **o, float mass, struct model *model);
|
|
|
|
|
|
|
|
#endif
|