1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Fabian 'x3n' Landau |
---|
24 | * Reto Grieder |
---|
25 | * Co-authors: |
---|
26 | * ... |
---|
27 | * |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef _StaticEntity_H__ |
---|
31 | #define _StaticEntity_H__ |
---|
32 | |
---|
33 | #include "OrxonoxPrereqs.h" |
---|
34 | #include "WorldEntity.h" |
---|
35 | |
---|
36 | namespace orxonox |
---|
37 | { |
---|
38 | /** |
---|
39 | @brief |
---|
40 | The StaticEntity is the simplest derivative of the @ref orxonox::WorldEntity class. This means all StaticEntity instances also have |
---|
41 | 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. |
---|
42 | |
---|
43 | In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why |
---|
44 | it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the |
---|
45 | function @see setPosition to changee it. |
---|
46 | |
---|
47 | A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal. |
---|
48 | */ |
---|
49 | |
---|
50 | class _OrxonoxExport StaticEntity : public WorldEntity |
---|
51 | { |
---|
52 | public: |
---|
53 | StaticEntity(Context* context); |
---|
54 | virtual ~StaticEntity(); |
---|
55 | |
---|
56 | using WorldEntity::setPosition; |
---|
57 | using WorldEntity::setOrientation; |
---|
58 | |
---|
59 | void setPosition(const Vector3& position); |
---|
60 | void setOrientation(const Quaternion& orientation); |
---|
61 | |
---|
62 | private: |
---|
63 | void registerVariables(); |
---|
64 | bool isCollisionTypeLegal(CollisionType type) const; |
---|
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 | void setWorldTransform(const btTransform& worldTrans); |
---|
74 | void getWorldTransform(btTransform& worldTrans) const; |
---|
75 | }; |
---|
76 | } |
---|
77 | |
---|
78 | #endif /* _StaticEntity_H__ */ |
---|