-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcarrousel.h
111 lines (90 loc) · 2.68 KB
/
carrousel.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef CARROUSEL_H_
#define CARROUSEL_H_
#include <string>
#include <vector>
#include <osg/ShapeDrawable>
#include <osg/MatrixTransform>
#include <osgViewer/Viewer>
#include <osg/LightSource>
#include "abstracttypes.h"
namespace amussementpark {
//#######################################################################
// Clases que contienen la geometría del tiovivo
//#######################################################################
class CarrouselRoof: public osg::ShapeDrawable {
private:
DOUBLE rad, height, yPos;
void initialize();
public:
CarrouselRoof(DOUBLE rad, DOUBLE height, DOUBLE yPos);
CarrouselRoof(CarrouselRoof &);
};
class CarrouselBase: public osg::ShapeDrawable {
private:
DOUBLE rad, height, yPos;
void initialize();
public:
CarrouselBase(DOUBLE rad, DOUBLE height, DOUBLE yPos);
CarrouselBase(CarrouselBase &);
};
class HobbyHorse: public MovableObject {
private:
BOOLEAN enabled;
DOUBLE curHeight;
BOOLEAN goingUp;
osg::MatrixTransform *animationMatrix;
public:
static const DOUBLE MAX_HEIGHT;
static const DOUBLE MIN_HEIGHT;
HobbyHorse(DOUBLE x, DOUBLE y, BOOLEAN startsUp, DOUBLE angleCorrection);
void updateAnimation();
void onKeyPress();
void onCtrlKeyPress();
void onMouseClick();
};
class CarrouselLight: public osg::LightSource {
public:
CarrouselLight(INT light, DOUBLE x, DOUBLE z);
};
//#######################################################################
// Clases que representan una instancia del tiovivo en el mundo
//#######################################################################
class CarrouselUpperNode: public osg::Geode {
public:
CarrouselUpperNode(DOUBLE sizeFactor);
};
class CarrouselMiddleNode: public osg::Geode {
public:
CarrouselMiddleNode(DOUBLE sizeFactor);
};
class CarrouselBottomNode: public osg::Geode {
public:
CarrouselBottomNode(DOUBLE sizeFactor);
};
class CarrouselLightNode: public MovableObject {
private:
std::vector<osg::ShapeDrawable*> lights;
INT currentIndex;
INT currentCounter;
public:
CarrouselLightNode(DOUBLE sizeFactor);
void onKeyPress();
void onCtrlKeyPress();
void onMouseClick();
void updateAnimation();
};
class CarrouselInstance: public MovableObject {
private:
BOOLEAN enabled;
DOUBLE rotationAngle, rotationSpeed;
osg::MatrixTransform *rotation;
void initializeWithoutLights(osg::MatrixTransform *cRoot, INT horseCount, DOUBLE sizeFactor);
public:
CarrouselInstance(DOUBLE xPos, DOUBLE yPos, INT horseCount, BOOLEAN addLights, DOUBLE sizeFactor=1.0);
void updateAnimation();
void onKeyPress();
void onCtrlKeyPress();
void onMouseClick();
};
}
#endif