Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2008, 12:36:46 PM (17 years ago)
Author:
rgrieder
Message:

Still getting physics and its implications straight:

  • Removed PositionableEntity —> StaticEntity is now the way to go. They cannot be translated in any way during physics simulation. The trick will be to remove them and add them again to Bullet. This however is not yet implemented.
  • Forgot a few consts in WorldEntity
  • Fixed a bug with infinite masses
  • WE throws exception if you try to apply physics when the SceneNode is not in the root space of the Scene.
  • Moved velocity_ to MovableEntity
  • Outside world reference of WE/ME are now always the non-physical values. getPosition() will always return node_→getPosition() and when setting it, both RigidBody and SceneNode are translated. This accounts for velocity, orientation and position.
File:
1 edited

Legend:

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

    r2298 r2300  
    168168            std::set<WorldEntity*> children_;
    169169
    170             /////////////
    171             // Physics //
    172             /////////////
     170
     171        /////////////
     172        // Physics //
     173        /////////////
    173174
    174175        public:
     
    181182            };
    182183
    183             bool hasPhysics() { return getCollisionType() != None; }
    184 
    185             CollisionType getCollisionType() { return this->collisionType_; }
     184            bool hasPhysics() const { return getCollisionType() != None; }
     185
     186            CollisionType getCollisionType() const { return this->collisionType_; }
    186187            void setCollisionType(CollisionType type);
    187188
    188189            void setCollisionTypeStr(const std::string& type);
    189             std::string getCollisionTypeStr();
    190 
    191             bool isStatic()    { return getCollisionType() == Static   ; }
    192             bool isKinematic() { return getCollisionType() == Kinematic; }
    193             bool isDynamic()   { return getCollisionType() == Dynamic  ; }
     190            std::string getCollisionTypeStr() const;
     191
     192            bool isStatic()    const { return getCollisionType() == Static   ; }
     193            bool isKinematic() const { return getCollisionType() == Kinematic; }
     194            bool isDynamic()   const { return getCollisionType() == Dynamic  ; }
    194195
    195196            void setMass(float mass);
    196             float getMass();
     197            float getMass() const;
    197198
    198199            void setCollisionRadius(float radius);
    199             float getCollisionRadius();
     200            float getCollisionRadius() const;
    200201
    201202        protected:
     
    203204            //virtual void attachPhysicalObject(WorldEntity* object);
    204205
    205             virtual bool isCollisionTypeLegal(CollisionType type) = 0;
    206             bool checkPhysics();
     206            virtual bool isCollisionTypeLegal(CollisionType type) const = 0;
     207            bool checkPhysics() const;
    207208            void updateCollisionType();
    208209
Note: See TracChangeset for help on using the changeset viewer.