-
Notifications
You must be signed in to change notification settings - Fork 1
/
physicEngine.h
62 lines (38 loc) · 1.35 KB
/
physicEngine.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
/*
* physicEngine.h
* Boing
*
* Created by Gaëtan de Villèle on 15/01/11.
* Copyright 2011 EPSI. All rights reserved.
*
*/
#ifndef PHYSIC_ENGINE
#define PHYSIC_ENGINE
#include <math.h>
#include "OpenGL/gl.h"
#include "OpenGL/glu.h"
#include "vector.h"
#include "solid.h"
// Indication de la taille de la fenetre
void physicEngine_setWindowSize( int win_x_min, int win_x_max, int win_y_min, int win_y_max );
// 1 - Calcul des nouvelles positions
void physicEngine_computeNextPositions( int gap );
// 2 - Elimination des solids hors champ
void physicEngine_removeUselessSolids();
// 3 - Detection des collisions
void physicEngine_detectCollisions();
// 4 - Mise à jour de l'état des solides
void physicEngine_updateSolidsState( int gap );
// 5 - Affichage des solids
void physicEngine_display();
// Collision des enveloppes externes
int physicEngine_detectExternCollision( Solid* i, Solid* j );
// Créer un rectangle
void physicEngine_create_rect( Vector position, Vector speed, Vector acceleration, float width, float height, int staticSolid );
// Ajouter un solid au moteur
void physicEngine_create_polygon( Vector position, Vector speed, Vector acceleration, int sides, float radius, int staticSolid );
// Supprimer un solid
void physicEngine_removeSolid(int index);
// Libération de la mémoire
void physicEngine_free();
#endif // PHYSIC_ENGINE