1 | |
---|
2 | |
---|
3 | #ifndef _Waypoint_H__ |
---|
4 | #define _Waypoint_H__ |
---|
5 | |
---|
6 | #include "OrxonoxPrereqs.h" |
---|
7 | #include "StaticEntity.h" |
---|
8 | #include "overlays/OverlaysPrereqs.h" |
---|
9 | |
---|
10 | #include <map> |
---|
11 | #include <string> |
---|
12 | |
---|
13 | #include "util/OgreForwardRefs.h" |
---|
14 | #include "tools/interfaces/Tickable.h" |
---|
15 | #include "interfaces/RadarListener.h" |
---|
16 | #include "overlays/OrxonoxOverlay.h" |
---|
17 | |
---|
18 | namespace orxonox |
---|
19 | { |
---|
20 | /** |
---|
21 | @brief |
---|
22 | The StaticEntity is the simplest derivative of the @ref orxonox::WorldEntity class. This means all StaticEntity instances also have |
---|
23 | a position in space, a mass, a scale, a frication, ... because every StaticEntity is a WorldEntity. You can attach StaticEntities to eachother ike @ref orxonox::WorldEntity WorldEntities. |
---|
24 | |
---|
25 | In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why |
---|
26 | it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the |
---|
27 | function @see setPosition to changee it. |
---|
28 | |
---|
29 | A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal. |
---|
30 | */ |
---|
31 | |
---|
32 | class _OrxonoxExport Waypoint : public StaticEntity, public RadarListener |
---|
33 | { |
---|
34 | public: |
---|
35 | Waypoint(Context* context); |
---|
36 | virtual ~Waypoint(); |
---|
37 | |
---|
38 | virtual void addObject(RadarViewable* object) override; |
---|
39 | virtual void removeObject(RadarViewable* viewable) override; |
---|
40 | virtual void objectChanged(RadarViewable* viewable) override; |
---|
41 | |
---|
42 | using StaticEntity::setPosition; |
---|
43 | using StaticEntity::setOrientation; |
---|
44 | |
---|
45 | virtual void setPosition(const Vector3& position) override; |
---|
46 | virtual void setOrientation(const Quaternion& orientation) override; |
---|
47 | |
---|
48 | virtual void positionChanged() override { } |
---|
49 | virtual void radarTick(float dt) override {} |
---|
50 | |
---|
51 | virtual inline float getRadarSensitivity() const override |
---|
52 | { return 1.0f; } |
---|
53 | |
---|
54 | inline unsigned int getMarkerLimit() const |
---|
55 | { return this->markerLimit_; } |
---|
56 | |
---|
57 | static void selectClosestTarget(); |
---|
58 | static void selectNextTarget(); |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | private: |
---|
63 | void registerVariables(); |
---|
64 | //virtual bool isCollisionTypeLegal(CollisionType type) const override; |
---|
65 | |
---|
66 | // network callbacks |
---|
67 | inline void positionChanged() |
---|
68 | { this->setPosition(this->getPosition()); } |
---|
69 | inline void orientationChanged() |
---|
70 | { this->setOrientation(this->getOrientation()); } |
---|
71 | |
---|
72 | // Bullet btMotionState related |
---|
73 | virtual void setWorldTransform(const btTransform& worldTrans) override; |
---|
74 | virtual void getWorldTransform(btTransform& worldTrans) const override; |
---|
75 | }; |
---|
76 | } |
---|
77 | |
---|
78 | #endif /* _StaticEntity_H__ */ |
---|