Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/npcs/mover.h @ 10648

Last change on this file since 10648 was 10643, checked in by bknecht, 18 years ago

improvements by landauf on bsp, rotor and wireframe (does build, should work)

File size: 2.6 KB
RevLine 
[10423]1/*!
2 * @file mover.h
3 *  Mover is an object which moves from its origin to relatively given coordinates
4 *  within a given action-time as soon as the player enters the action-radius.
5 */
6
7#ifndef _MOVER_H
8#define _MOVER_H
9
10/* INCLUDES */
11#include "world_entity.h"
12
[10487]13#include "sound_buffer.h"
14#include "sound_source.h"
15
[10423]16//! A Class to handle a Mover
17class Mover : public WorldEntity
18{
[10487]19    ObjectListDeclaration(Mover);
20    public:
21        typedef enum MoverState {
22            Closed        = 0,
23            Opening       = 1,
24            Open          = 2,
25            Closing       = 3,
26            Locked        = 4
27        };
[10423]28
[10487]29        Mover(const TiXmlElement* root = NULL);
30        virtual ~Mover();
[10423]31
[10487]32        virtual void loadParams(const TiXmlElement* root);
[10423]33
[10487]34        void setTargetCoordinates(float x, float y, float z) { this->targetCoordinates = Vector(x,y,z); }
35        void setActionRadius(float radius) { this->actionRadius = radius; }
36        void setActionTime(float time) { this->actionTime = time; }
[10643]37        void setStayOpenTime(float time) { this->stayOpenTime = time; }
[10487]38        void setOpeningSoundFile(const std::string& fileName);
39        void setOpenedSoundFile(const std::string& fileName);
40        void setMovingSoundFile(const std::string& fileName);
41        void setClosingSoundFile(const std::string& fileName);
42        void setClosedSoundFile(const std::string& fileName);
[10423]43
[10487]44        virtual void tick(float dt);
[10423]45
[10487]46    private:
47        bool checkOpen(float dt);
48        bool checkClosed(float dt);
49        bool checkPlayerInActionRadius();
50   
51        OrxSound::SoundSource       soundSource_starting;
52        OrxSound::SoundSource       soundSource_moving;
53        OrxSound::SoundSource       soundSource_ending;
54        OrxSound::SoundBuffer       soundBuffer_opening;
55        OrxSound::SoundBuffer       soundBuffer_opened;
56        OrxSound::SoundBuffer       soundBuffer_moving;
57        OrxSound::SoundBuffer       soundBuffer_closing;
58        OrxSound::SoundBuffer       soundBuffer_closed;
[10423]59
[10487]60        Vector                      targetCoordinates;          //!< the target coordinates
61        Vector                      originCoordinates;          //!< the origin coordinates
62        float                       actionRadius;               //!< the action-radius
63        float                       actionTime;                 //!< the action-time
64        int                         state;                      //!< the state of the mover
[10643]65        float                       stayOpenTime;               //!< waiting time while opened
66        float                       openTime;                   //!< time since opened
[10423]67};
68
69#endif  /* _MOVER_H */
70
71
72
Note: See TracBrowser for help on using the repository browser.