Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/contentcreation/pps/FabianLandau/mover/environments/mover.h @ 4844

Last change on this file since 4844 was 4844, checked in by landauf, 17 years ago
File size: 2.5 KB
Line 
1/*!
2 * @file mover.h
3 *  A mover is an object that moves along scripted paths, released by scripted events.
4 */
5
6#ifndef _MOVER_H
7#define _MOVER_H
8
9#include "world_entity.h"
10#include "mover_trigger.h"
11#include "mover_station.h"
12#include "mover_trigger_list.h"
13#include "mover_station_list.h"
14#include "sound_source.h"
15
16
17class Mover : public WorldEntity
18{
19    ObjectListDeclaration(Mover);
20
21    public:
22        Mover(const TiXmlElement* root = NULL);
23        virtual ~Mover();
24
25        virtual void loadParams(const TiXmlElement* root);
26        virtual void tick(float dt);
27
28        void setLoop(bool bLoop = true) { this->bLoop = bLoop; }
29        void setRepeat(int n) { this->bRepeat = true; this->repeats = n; }
30        void setWaitAfterEachStation(bool bWaitAfterEachStation = true) { this->bWaitAfterEachStation = bWaitAfterEachStation; }
31        void setOnlyMoveWhileTriggered(bool bOnlyMoveWhileTriggered = true) { this->bOnlyMoveWhileTriggered = bOnlyMoveWhileTriggered; }
32        void setAttachTrigger(bool bAttachTrigger = true) { this->bAttachTrigger = bAttachTrigger; }
33        void setTriggers(const TiXmlElement* root);
34        void setStations(const TiXmlElement* root);
35        void setReopen(bool bReopen = true) { this->bReopen = bReopen; }
36        void setReclose(bool bReclose = true) { this->bReclose = bReclose; }
37
38    private:
39        void changeState(int state);
40        int closed();
41        int open();
42        int move(float dt);
43        int wait();
44        int next();
45        int delay();
46        int stay();
47        bool reachedStationsTarget(float dt);
48
49        bool                        bLoop;
50        bool                        bRepeat;
51        int                         repeats;
52        bool                        bWaitAfterEachStation;
53        bool                        bOnlyMoveWhileTriggered;
54        bool                        bAttachTrigger;
55        bool                        bReopen;
56        bool                        bReclose;
57       
58        MoverTriggerList            *triggers;
59        MoverStationList            *stations;
60       
61        int                         state;
62        MoverStation                *station;
63        float                       time;
64        int                         repeatsToGo;
65        Vector                      originCoor;
66        Quaternion                  originDir;
67
68        OrxSound::SoundSource       soundSource_starting;
69        OrxSound::SoundSource       soundSource_moving;
70        OrxSound::SoundSource       soundSource_ending;
71};
72
73
74#endif
Note: See TracBrowser for help on using the repository browser.