Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 11, 2008, 10:30:49 PM (16 years ago)
Author:
rgrieder
Message:
  • Added first basic construct of object hierarchy with physics.
  • Added a few bullet classes to OrxonoxPrereqs.h
  • Added bullet header files to the msvc projects.

No Implementation at all yet, but the game still compiles and runs. Please update the media repository.

File:
1 edited

Legend:

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

    r2087 r2178  
    3333
    3434#define OGRE_FORCE_ANGLE_TYPES
     35#include <OgreSceneNode.h>
    3536
    36 #include <OgreSceneNode.h>
     37#include "LinearMath/btMotionState.h"
     38#include "BulletDynamics/Dynamics/btRigidBody.h"
    3739
    3840#include "network/Synchronisable.h"
     
    4244namespace orxonox
    4345{
    44     class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable
     46    class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable, public btMotionState
    4547    {
    4648        public:
     
    125127                { this->node_->scale(scale, scale, scale); }
    126128
     129            void setcollisionRadius(float radius);
     130            float getcollisionRadius();
     131
     132            bool hasPhysics()  { return this->physicalBody_; }
     133            bool isKinematic() { return this->physicalBody_ && this->physicalBody_->isKinematicObject(); }
     134            bool isDynamic()   { return this->physicalBody_ && !this->physicalBody_->isStaticOrKinematicObject(); }
     135
    127136            void attach(WorldEntity* object);
    128137            void detach(WorldEntity* object);
     
    139148
    140149        protected:
     150            //virtual btCollisionShape* getCollisionShape() = 0;
     151
     152            void createPhysicalBody();
     153            virtual void attachPhysicalObject(WorldEntity* object) { }
     154
    141155            Ogre::SceneNode* node_;
     156            bool bAddedToPhysicalWorld_;
     157            btRigidBody* physicalBody_;
    142158
    143159        private:
     
    155171                { this->roll(angle); }
    156172
     173            // Bullet btMotionState related
     174            virtual void setWorldTransform(const btTransform& worldTrans)
     175            {
     176            }
     177
     178            // Bullet btMotionState related
     179            virtual void getWorldTransform(btTransform& worldTrans) const
     180            {
     181            }
     182
    157183            WorldEntity* parent_;
    158184            unsigned int parentID_;
Note: See TracChangeset for help on using the changeset viewer.