Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2008, 9:38:30 PM (15 years ago)
Author:
rgrieder
Message:

Changed the way setPosition, setVelocity, setOrientation and setAngularVelocity is handled in MobileEntity and upwards.
This allows to introduce a lost feature: Position of an enemy ship on the client can't be set anymore at all (local changes were allowed before).

File:
1 edited

Legend:

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

    r2426 r2427  
    4747            void registerVariables();
    4848
    49             using WorldEntity::setPosition;
    50             using WorldEntity::setOrientation;
     49            virtual void setPosition(const Vector3& position);
     50            virtual void setOrientation(const Quaternion& orientation);
    5151
    52             void setPosition(const Vector3& position);
    53             void setOrientation(const Quaternion& orientation);
    54 
    55             void setVelocity(const Vector3& velocity);
     52            virtual void setVelocity(const Vector3& velocity);
    5653            inline void setVelocity(float x, float y, float z)
    5754                { this->setVelocity(Vector3(x, y, z)); }
     
    5956                { return this->linearVelocity_; }
    6057
    61             void setAngularVelocity(const Vector3& velocity);
     58            virtual void setAngularVelocity(const Vector3& velocity);
    6259            inline void setAngularVelocity(float x, float y, float z)
    6360                { this->setAngularVelocity(Vector3(x, y, z)); }
     
    8885
    8986        protected:
     87            // Bullet btMotionState related
     88            virtual void setWorldTransform(const btTransform& worldTrans);
     89            void getWorldTransform(btTransform& worldTrans) const;
     90
    9091            Vector3 linearAcceleration_;
    9192            Vector3 linearVelocity_;
     
    9495
    9596        private:
    96             virtual void positionChanged       (bool bContinuous) = 0;
    97             virtual void orientationChanged    (bool bContinuous) = 0;
    98             virtual void linearVelocityChanged (bool bContinuous) { }
    99             virtual void angularVelocityChanged(bool bContinuous) { }
    100 
    10197            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
    102 
    103             // Bullet btMotionState related
    104             void setWorldTransform(const btTransform& worldTrans);
    105             void getWorldTransform(btTransform& worldTrans) const;
    10698    };
    10799}
Note: See TracChangeset for help on using the changeset viewer.