about summary refs log tree commit diff
path: root/src/Models.h
blob: 7e6500ca0e0bfff1d23b8fa2670e0440f722d33e (plain) (blame)
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
#ifndef _MODELS_H_
#define _MODELS_H_

#include <GL/gl.h>

#include "Quaternions.h"

struct Vertex {
    XYZ position;
    XYZ normal;
    GLfloat color[3];
};

struct Model {
	struct Vertex (*faces)[3];
	unsigned short face_count;
	XYZ center;
	float radius;
};

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
struct Model loadModel(const char *);
void destroyModel(const struct Model *);
void drawModel(const struct Model *, const GLfloat *);
int segCrossModel(struct XYZ, struct XYZ, const struct Model *, struct XYZ *);
int segCrossModelTrans(struct XYZ, struct XYZ, const struct Model *,
                       struct XYZ, float, struct XYZ *);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif