[2072] | 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 |
---|
[2304] | 24 | * Reto Grieder |
---|
[2072] | 25 | * Co-authors: |
---|
| 26 | * ... |
---|
| 27 | * |
---|
| 28 | */ |
---|
| 29 | |
---|
[2151] | 30 | #ifndef _StaticEntity_H__ |
---|
| 31 | #define _StaticEntity_H__ |
---|
[2072] | 32 | |
---|
| 33 | #include "OrxonoxPrereqs.h" |
---|
| 34 | #include "WorldEntity.h" |
---|
| 35 | |
---|
| 36 | namespace orxonox |
---|
| 37 | { |
---|
[10437] | 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. |
---|
[11052] | 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. |
---|
[10437] | 48 | */ |
---|
| 49 | |
---|
[2151] | 50 | class _OrxonoxExport StaticEntity : public WorldEntity |
---|
[2072] | 51 | { |
---|
| 52 | public: |
---|
[9667] | 53 | StaticEntity(Context* context); |
---|
[2151] | 54 | virtual ~StaticEntity(); |
---|
[2072] | 55 | |
---|
| 56 | using WorldEntity::setPosition; |
---|
| 57 | using WorldEntity::setOrientation; |
---|
| 58 | |
---|
[11071] | 59 | virtual void setPosition(const Vector3& position) override; |
---|
| 60 | virtual void setOrientation(const Quaternion& orientation) override; |
---|
[2292] | 61 | |
---|
| 62 | private: |
---|
[7163] | 63 | void registerVariables(); |
---|
[11071] | 64 | virtual bool isCollisionTypeLegal(CollisionType type) const override; |
---|
[2292] | 65 | |
---|
[2426] | 66 | // network callbacks |
---|
[2374] | 67 | inline void positionChanged() |
---|
| 68 | { this->setPosition(this->getPosition()); } |
---|
| 69 | inline void orientationChanged() |
---|
| 70 | { this->setOrientation(this->getOrientation()); } |
---|
| 71 | |
---|
[2292] | 72 | // Bullet btMotionState related |
---|
[11071] | 73 | virtual void setWorldTransform(const btTransform& worldTrans) override; |
---|
| 74 | virtual void getWorldTransform(btTransform& worldTrans) const override; |
---|
[2072] | 75 | }; |
---|
| 76 | } |
---|
| 77 | |
---|
[2151] | 78 | #endif /* _StaticEntity_H__ */ |
---|