Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2008, 4:16:52 PM (15 years ago)
Author:
rgrieder
Message:

Finally merged physics stuff. Target is physics_merge because I'll have to do some testing first.

Location:
code/branches/physics_merge
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics_merge

  • code/branches/physics_merge/src/util

  • code/branches/physics_merge/src/util/Exception.cc

  • code/branches/physics_merge/src/util/Exception.h

    r2420 r2442  
    8282                  const char* filename, const char* functionName)                   \
    8383                  : Exception(description, lineNumber, filename, functionName)      \
    84         {                                                                           \
    85             /* Let the catcher decide whether to display the message below level 4  \
    86                Note: Don't place this code in Exception c'tor because getTypeName() \
    87                is still pure virtual at that time. */                               \
    88             COUT(4) << this->getFullDescription() << std::endl;                     \
    89         }                                                                           \
     84        { }                                                                         \
    9085                                                                                    \
    9186        ExceptionName##Exception(const std::string& description)                    \
    9287                  : Exception(description)                                          \
    93         { COUT(4) << this->getFullDescription() << std::endl; }                     \
     88        { }                                                                         \
    9489                                                                                    \
    9590        ~ExceptionName##Exception() throw() { }                                     \
     
    10398    CREATE_ORXONOX_EXCEPTION(FileNotFound);
    10499    CREATE_ORXONOX_EXCEPTION(Argument);
     100    CREATE_ORXONOX_EXCEPTION(PhysicsViolation);
     101    CREATE_ORXONOX_EXCEPTION(ParseError);
    105102    CREATE_ORXONOX_EXCEPTION(PluginsNotFound);
    106103    CREATE_ORXONOX_EXCEPTION(InitialisationFailed);
     
    111108}
    112109
    113 #define ThrowException(Type, Description) \
    114     throw Type##Exception(Description, __LINE__, __FILE__, __FUNCTIONNAME__)
     110    /**
     111    @brief
     112        Helper function that creates an exception, displays the message, but doesn't throw it.
     113    */
     114    template <class T>
     115    inline const T& InternalHandleException(const T& exception)
     116    {
     117        // let the catcher decide whether to display the message below level 4
     118        COUT(4) << exception.getFullDescription() << std::endl;
     119        return exception;
     120    }
     121
     122#define ThrowException(type, description) \
     123    throw InternalHandleException(type##Exception(description, __LINE__, __FILE__, __FUNCTIONNAME__))
    115124
    116125    // define an assert macro that can display a message
  • code/branches/physics_merge/src/util/Math.h

    r2171 r2442  
    6363namespace orxonox
    6464{
    65     typedef Ogre::Radian Radian;
    66     typedef Ogre::Degree Degree;
    67     typedef Ogre::Vector2 Vector2;
    68     typedef Ogre::Vector3 Vector3;
    69     typedef Ogre::Vector4 Vector4;
    70     typedef Ogre::Matrix3 Matrix3;
    71     typedef Ogre::Matrix4 Matrix4;
    72     typedef Ogre::Quaternion Quaternion;
    73     typedef Ogre::ColourValue ColourValue;
     65    using Ogre::Radian;
     66    using Ogre::Degree;
     67    using Ogre::Vector2;
     68    using Ogre::Vector3;
     69    using Ogre::Vector4;
     70    using Ogre::Matrix3;
     71    using Ogre::Matrix4;
     72    using Ogre::Quaternion;
     73    using Ogre::ColourValue;
     74
     75    // Also define our own transform space enum
     76    namespace TransformSpace
     77    {
     78        /**
     79        @brief
     80            Enumeration denoting the spaces which a transform can be relative to.
     81        */
     82        enum Space
     83        {
     84            /// Transform is relative to the local space
     85            Local,
     86            /// Transform is relative to the space of the parent node
     87            Parent,
     88            /// Transform is relative to world space
     89            World
     90        };
     91    }
    7492
    7593    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
     
    174192    inline T zeroise()
    175193    {
    176         BOOST_STATIC_ASSERT(sizeof(T) == 0);
    177         return T();
     194        // Default, raise a compiler error without including large boost header cascade.
     195        T temp();
     196        *********temp; // If you reach this code, you abused zeroise()!
     197        return temp;
    178198    }
    179199
  • code/branches/physics_merge/src/util/SignalHandler.cc

  • code/branches/physics_merge/src/util/SignalHandler.h

Note: See TracChangeset for help on using the changeset viewer.