Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2008, 1:25:16 AM (15 years ago)
Author:
rgrieder
Message:

Finally managed to work out some physics. According to my tests, collisions with simple spheres should work with dynamic/kinematic/static objects. There are currently only a limited number of XML parameters, but we're surely going to extend that. Furthermore there is some more thinking to be done concerning changes of btRigidBody properties when it's already added to the world.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/orxonox/objects/Scene.h

    r2192 r2292  
    3535#include "core/BaseObject.h"
    3636#include "util/Math.h"
     37#include "objects/Tickable.h"
    3738
    38 #include "ogrebullet/Dynamics/OgreBulletDynamics.h"
     39#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
    3940
    4041namespace orxonox
    4142{
    42     class _OrxonoxExport Scene : public BaseObject, public network::Synchronisable
     43    class _OrxonoxExport Scene : public BaseObject, public network::Synchronisable, public Tickable
    4344    {
    4445        public:
     
    5556
    5657            inline btDiscreteDynamicsWorld* getPhysicalWorld() const
    57                 { return this->dynamicsWorld_; }
     58                { return this->physicalWorld_; }
    5859
    5960            void setSkybox(const std::string& skybox);
     
    6970                { return this->bShadows_; }
    7071
     72            inline const Vector3& getWorldAabbMax()
     73            {
     74                this->physicalWorld_->getBroadphase();
     75            }
     76
     77            inline bool hasPhysics()
     78                { return this->physicalWorld_ != 0; }
     79            void setPhysicalWorld(bool wantsPhysics, const Vector3& worldAabbMin, const Vector3& worldAabbMax);
     80
     81            void tick(float dt);
     82
    7183        private:
    7284            void addObject(BaseObject* object);
     
    8193            Ogre::SceneNode*       rootSceneNode_;
    8294
    83             btDiscreteDynamicsWorld* dynamicsWorld_;
    84             btSequentialImpulseConstraintSolver* solver_;
    85             btDefaultCollisionConfiguration* collisionConfiguration_;
    86             btCollisionDispatcher* dispatcher_;
    87             // Point auf Bullet btDynamics world && solver
     95            btDiscreteDynamicsWorld* physicalWorld_;
    8896
    8997            std::string            skybox_;
Note: See TracChangeset for help on using the changeset viewer.