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/MovableEntity.h

    r2421 r2427  
    2222 *   Author:
    2323 *      Fabian 'x3n' Landau
     24 *      Reto Grieder
    2425 *   Co-authors:
    2526 *      ...
     
    4445
    4546            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46             virtual void tick(float dt);
    4747            void registerVariables();
     48
     49            using WorldEntity::setPosition;
     50            using WorldEntity::setOrientation;
     51
     52            inline void setPosition(const Vector3& position)
     53                { MobileEntity::setPosition(position); this->overwrite_position_ = this->getPosition(); }
     54            inline void setOrientation(const Quaternion& orientation)
     55                { MobileEntity::setOrientation(orientation); this->overwrite_orientation_ = this->getOrientation(); }
    4856
    4957        private:
     
    5765                { this->setAngularVelocity(this->angularVelocity_); }
    5866
    59             void overwritePosition();
    60             void overwriteOrientation();
     67            inline void overwritePosition()
     68                { this->setPosition(this->overwrite_position_); }
     69            inline void overwriteOrientation()
     70                { this->setOrientation(this->overwrite_orientation_); }
    6171
    62             void positionChanged(bool bContinuous);
    63             void orientationChanged(bool bContinuous);
    64 
    65             Vector3 overwrite_position_;
     72            Vector3    overwrite_position_;
    6673            Quaternion overwrite_orientation_;
    6774            Timer<MovableEntity>* continuousResynchroTimer_;
Note: See TracChangeset for help on using the changeset viewer.