Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/worldentities/StaticEntity.h @ 12161

Last change on this file since 12161 was 11071, checked in by landauf, 9 years ago

merged branch cpp11_v3 back to trunk

  • Property svn:eol-style set to native
File size: 2.9 KB
Line 
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
36namespace 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            virtual void setPosition(const Vector3& position) override;
60            virtual void setOrientation(const Quaternion& orientation) override;
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__ */
Note: See TracBrowser for help on using the repository browser.