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
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/physics_merge

  • code/branches/physics_merge/src/orxonox/tools/BillboardSet.cc

    r2171 r2442  
    3434
    3535#include <OgreSceneManager.h>
     36#include <OgreBillboardSet.h>
    3637#include <OgreBillboard.h>
    3738
  • code/branches/physics_merge/src/orxonox/tools/BillboardSet.h

    r2087 r2442  
    3333
    3434#include <string>
    35 #include <OgreBillboardSet.h>
     35#include <OgrePrerequisites.h>
    3636
    3737#include "util/Math.h"
  • code/branches/physics_merge/src/orxonox/tools/BulletConversions.h

    r2440 r2442  
    3737#include "LinearMath/btVector3.h"
    3838
    39 // Vector3 to btVector3
    40 template <>
    41 struct ConverterExplicit<orxonox::Vector3, btVector3>
     39namespace orxonox
    4240{
    43     static bool convert(btVector3* output, const orxonox::Vector3& input)
     41    // Vector3 to btVector3
     42    template <>
     43    struct ConverterExplicit<orxonox::Vector3, btVector3>
    4444    {
    45         output->setX(input.x);
    46         output->setY(input.y);
    47         output->setZ(input.z);
    48         return true;
    49     }
    50 };
     45        static bool convert(btVector3* output, const orxonox::Vector3& input)
     46        {
     47            output->setX(input.x);
     48            output->setY(input.y);
     49            output->setZ(input.z);
     50            return true;
     51        }
     52    };
    5153
    52 // btVector3 to Vector3
    53 template <>
    54 struct ConverterExplicit<btVector3, orxonox::Vector3>
    55 {
    56     static bool convert(orxonox::Vector3* output, const btVector3& input)
     54    // btVector3 to Vector3
     55    template <>
     56    struct ConverterExplicit<btVector3, orxonox::Vector3>
    5757    {
    58         output->x = input.x();
    59         output->y = input.y();
    60         output->z = input.z();
    61         return true;
    62     }
    63 };
     58        static bool convert(orxonox::Vector3* output, const btVector3& input)
     59        {
     60            output->x = input.x();
     61            output->y = input.y();
     62            output->z = input.z();
     63            return true;
     64        }
     65    };
    6466
    65 // Quaternion to btQuaternion
    66 template <>
    67 struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
    68 {
    69     static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
     67    // Quaternion to btQuaternion
     68    template <>
     69    struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
    7070    {
    71         output->setW(input.w);
    72         output->setX(input.x);
    73         output->setY(input.y);
    74         output->setZ(input.z);
    75         return true;
    76     }
    77 };
     71        static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
     72        {
     73            output->setW(input.w);
     74            output->setX(input.x);
     75            output->setY(input.y);
     76            output->setZ(input.z);
     77            return true;
     78        }
     79    };
    7880
    79 // btQuaternion to Vector3
    80 template <>
    81 struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
    82 {
    83     static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
     81    // btQuaternion to Vector3
     82    template <>
     83    struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
    8484    {
    85         output->w = input.w();
    86         output->x = input.x();
    87         output->y = input.y();
    88         output->z = input.z();
    89         return true;
    90     }
    91 };
     85        static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
     86        {
     87            output->w = input.w();
     88            output->x = input.x();
     89            output->y = input.y();
     90            output->z = input.z();
     91            return true;
     92        }
     93    };
     94}
    9295
    9396#endif /* _BulletConversions_H__ */
  • code/branches/physics_merge/src/orxonox/tools/Mesh.cc

    r2171 r2442  
    3131
    3232#include <sstream>
     33#include <OgreEntity.h>
    3334#include <OgreSceneManager.h>
    3435#include <cassert>
  • code/branches/physics_merge/src/orxonox/tools/Mesh.h

    r2087 r2442  
    3333
    3434#include <string>
    35 #include <OgreEntity.h>
     35#include <OgrePrerequisites.h>
    3636
    3737namespace orxonox
  • code/branches/physics_merge/src/orxonox/tools/ParticleInterface.cc

    r2171 r2442  
    5757
    5858        this->scenemanager_ = scenemanager;
    59         this->sceneNode_ = 0;
    6059        this->particleSystem_ = 0;
    6160
     
    8786        {
    8887            this->particleSystem_->removeAllEmitters();
    89             this->detachFromSceneNode();
    9088            this->scenemanager_->destroyParticleSystem(this->particleSystem_);
    91         }
    92     }
    93 
    94     void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)
    95     {
    96         if (this->sceneNode_)
    97             this->detachFromSceneNode();
    98 
    99         if (this->particleSystem_)
    100         {
    101             this->sceneNode_ = sceneNode;
    102             this->sceneNode_->attachObject(this->particleSystem_);
    103         }
    104     }
    105 
    106     void ParticleInterface::detachFromSceneNode()
    107     {
    108         if (this->sceneNode_)
    109         {
    110             if (this->particleSystem_)
    111                 this->sceneNode_->detachObject(this->particleSystem_);
    112             this->sceneNode_ = 0;
    11389        }
    11490    }
  • code/branches/physics_merge/src/orxonox/tools/ParticleInterface.h

    r2087 r2442  
    3333
    3434#include <string>
    35 #include <OgreParticleEmitter.h>
     35#include <OgrePrerequisites.h>
    3636
    3737#include "core/OrxonoxClass.h"
     
    5353            inline Ogre::ParticleSystem* getParticleSystem() const
    5454                { return this->particleSystem_; }
    55 
    56             void addToSceneNode(Ogre::SceneNode* sceneNode);
    57             void detachFromSceneNode();
    5855
    5956            Ogre::ParticleEmitter* createNewEmitter();
     
    9693            static unsigned int       counter_s;
    9794
    98             Ogre::SceneNode*          sceneNode_;
    9995            Ogre::ParticleSystem*     particleSystem_;
    10096            bool                      bVisible_;
Note: See TracChangeset for help on using the changeset viewer.