-
Notifications
You must be signed in to change notification settings - Fork 0
/
box.h
52 lines (35 loc) · 940 Bytes
/
box.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
#ifndef _BOX_H_
#define _BOX_H_
#include "point.h"
#include "math.h"
#include <GL/glu.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
// Box - permet representar una capsa aliniada amb els eixos
// (ex. capsa englobant)
class Box
{
private:
void Render(double r, double g, double b);
public:
GLUquadricObj *quadObj;
double radi;
Box(const Point& minimum=Point(), const Point& maximum=Point());
// update - expandeix la capsa per que inclogui el punt donat
void update(const Point& p);
// init - inicialitza la capsa amb el punt donat
void init(const Point& p);
// atributs
Point minb, maxb; // extrems mÃnim i mà xim de la capsa
void Render();
void RenderEsfera();
void minToCenter(); // posa el mÃnim de la caixa on era el centre
bool hasCollisions(Box& b);
Point getCenter();
double getHorizRadius();
};
#endif