-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsolid.h
86 lines (60 loc) · 1.65 KB
/
solid.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
////////////////////////////////////////////////////////////////////
///
/// @name : solid.h
/// @description : describe the solid type
/// @project : Boing
///
/// Created by Gaëtan de Villèle on 15/01/11.
/// Copyright 2011 EPSI. All rights reserved.
///
////////////////////////////////////////////////////////////////////
#ifndef SOLID
#define SOLID
#include <math.h>
#include "OpenGL/gl.h"
#include "OpenGL/glu.h"
#include "vector.h"
#include "draw.h"
//--------------------------------------------
// STRUCTURE
//--------------------------------------------
typedef struct Solid
{
// solid color (rgb)
int color[3];
// Vertices
TabVector verticesArray;
// Rayon du cercle circonscrit
float radius;
// static solid (as a boolean - 0=nonstatic)
int staticSolid;
// TRANSLATION
//------------------------------
// vecteur position
Vector position;
// vecteur position suivante
Vector nextPosition;
// vecteur vitesse
Vector speed;
// vecteur acceleration
Vector acceleration;
// ROTATION
//-------------------------------
// Les angles sont en radians
// vecteur moment/rotation
// Position en rotation (angle)
// float/int angle;
// Vecteur vitesse de rotation
// Vector rotation;
// Vecteur acceleration de la rotation
// Vector accel_rotation;
} Solid;
//--------------------------------------------
// FUNCTIONS
//--------------------------------------------
void solid_display( Solid *solid );
void solid_updatePosition( Solid *solid, int gap );
void solid_updateSpeed( Solid *solid, int gap );
void solid_updateNextPosition( Solid *solid, int gap );
float* solid_getExternalAura( Solid *solid );
#endif // SOLID