Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (16 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/worldentities/WorldEntity.h

    r3077 r3196  
    3333#include "OrxonoxPrereqs.h"
    3434
    35 #ifdef NDEBUG
    36 #include <OgreSceneNode.h>
    37 #else
    38 #include <OgrePrerequisites.h>
     35#ifdef ORXONOX_RELEASE
     36#  include <OgreSceneNode.h>
    3937#endif
    40 #include "LinearMath/btMotionState.h"
     38#include <LinearMath/btMotionState.h>
    4139
    4240#include "util/Math.h"
     41#include "util/OgreForwardRefs.h"
    4342#include "core/BaseObject.h"
    4443#include "network/synchronisable/Synchronisable.h"
     
    7574
    7675        public:
     76            // Define our own transform space enum to avoid Ogre includes here
     77            /**
     78            @brief
     79                Enumeration denoting the spaces which a transform can be relative to.
     80            */
     81            enum TransformSpace
     82            {
     83                //! Transform is relative to the local space
     84                Local,
     85                //! Transform is relative to the space of the parent node
     86                Parent,
     87                //! Transform is relative to world space
     88                World
     89            };
     90
     91        public:
    7792            WorldEntity(BaseObject* creator);
    7893            virtual ~WorldEntity();
     
    97112            const Vector3& getWorldPosition() const;
    98113
    99             void translate(const Vector3& distance, TransformSpace::Enum relativeTo = TransformSpace::Parent);
    100             inline void translate(float x, float y, float z, TransformSpace::Enum relativeTo = TransformSpace::Parent)
     114            void translate(const Vector3& distance, TransformSpace relativeTo = WorldEntity::Parent);
     115            inline void translate(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Parent)
    101116                { this->translate(Vector3(x, y, z), relativeTo); }
    102117
     
    114129            const Quaternion& getWorldOrientation() const;
    115130
    116             void rotate(const Quaternion& rotation, TransformSpace::Enum relativeTo = TransformSpace::Local);
    117             inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     131            void rotate(const Quaternion& rotation, TransformSpace relativeTo = WorldEntity::Local);
     132            inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    118133                { this->rotate(Quaternion(angle, axis), relativeTo); }
    119134
    120             inline void yaw(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     135            inline void yaw(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    121136                { this->rotate(Quaternion(angle, Vector3::UNIT_Y), relativeTo); }
    122             inline void pitch(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     137            inline void pitch(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    123138                { this->rotate(Quaternion(angle, Vector3::UNIT_X), relativeTo); }
    124             inline void roll(const Degree& angle, TransformSpace::Enum relativeTo = TransformSpace::Local)
     139            inline void roll(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
    125140                { this->rotate(Quaternion(angle, Vector3::UNIT_Z), relativeTo); }
    126141
    127             void lookAt(const Vector3& target, TransformSpace::Enum relativeTo = TransformSpace::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    128             void setDirection(const Vector3& direction, TransformSpace::Enum relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    129             inline void setDirection(float x, float y, float z, TransformSpace::Enum relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
     142            void lookAt(const Vector3& target, TransformSpace relativeTo = WorldEntity::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     143            void setDirection(const Vector3& direction, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     144            inline void setDirection(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
    130145                { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); }
    131146
     
    157172                { return this->children_; }
    158173
    159             void attachOgreObject(Ogre::MovableObject* object);
    160             void detachOgreObject(Ogre::MovableObject* object);
     174            void attachOgreObject(Ogre::MovableObject*  object);
     175            void attachOgreObject(Ogre::BillboardSet*   object);
     176            void attachOgreObject(Ogre::Camera*         object);
     177            void attachOgreObject(Ogre::Entity*         object);
     178            void attachOgreObject(Ogre::ParticleSystem* object);
     179
     180            void detachOgreObject(Ogre::MovableObject*  object);
     181            void detachOgreObject(Ogre::BillboardSet*   object);
     182            void detachOgreObject(Ogre::Camera*         object);
     183            void detachOgreObject(Ogre::Entity*         object);
     184            void detachOgreObject(Ogre::ParticleSystem* object);
     185
    161186            Ogre::MovableObject* detachOgreObject(const Ogre::String& name);
    162187
     
    427452
    428453    // Inline heavily used functions for release builds. In debug, we better avoid including OgreSceneNode here.
    429 #ifdef NDEBUG
     454#ifdef ORXONOX_RELEASE
    430455    inline const Vector3& WorldEntity::getPosition() const
    431456        { return this->node_->getPosition(); }
Note: See TracChangeset for help on using the changeset viewer.