Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2008, 12:36:46 PM (15 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/MovableEntity.h

    r2298 r2300  
    6767            void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    6868
     69            void setVelocity(const Vector3& velocity);
     70            inline void setVelocity(float x, float y, float z)
     71                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
     72            inline const Vector3& getVelocity() const
     73                { return this->velocity_; }
     74
     75        protected:
     76            Vector3 velocity_;
    6977
    7078        private:
    7179            //void attachPhysicalObject(WorldEntity* object);
    7280
    73             virtual void internalSetVelocity(const Vector3& velocity) { }
    7481            virtual void positionChanged() { }
    7582            virtual void orientationChanged() { }
    76             virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type);
     83            virtual void velocityChanged() { }
     84
     85            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
    7786
    7887            // Bullet btMotionState related
Note: See TracChangeset for help on using the changeset viewer.