Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2008, 11:02:18 PM (16 years ago)
Author:
rgrieder
Message:

A little tweak and physics seems to work over the network ;)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2459 r2474  
    276276    {
    277277        if (!this->bControlled_)
    278             this->setPosition(this->server_position_);
     278            MobileEntity::setPosition(this->server_position_);
    279279    }
    280280
     
    282282    {
    283283        if (!this->bControlled_)
    284             this->setVelocity(this->server_linear_velocity_);
     284            MobileEntity::setVelocity(this->server_linear_velocity_);
    285285    }
    286286
     
    288288    {
    289289        if (!this->bControlled_)
    290             this->setOrientation(this->server_orientation_);
     290            MobileEntity::setOrientation(this->server_orientation_);
    291291    }
    292292
     
    294294    {
    295295        if (!this->bControlled_)
    296             this->setAngularVelocity(this->server_angular_velocity_);
     296            MobileEntity::setAngularVelocity(this->server_angular_velocity_);
    297297    }
    298298
     
    314314        if (this->server_overwrite_ == this->client_overwrite_)
    315315        {
    316             this->setPosition(this->client_position_);
    317             // The call above increments the overwrite. This is not desired to reduce traffic
    318             --this->server_overwrite_;
     316            MobileEntity::setPosition(this->client_position_);
     317            this->server_position_ = this->getPosition();
    319318        }
    320319    }
     
    324323        if (this->server_overwrite_ == this->client_overwrite_)
    325324        {
    326             this->setVelocity(this->client_linear_velocity_);
    327             // The call above increments the overwrite. This is not desired to reduce traffic
    328             --this->server_overwrite_;
     325            MobileEntity::setVelocity(this->client_linear_velocity_);
     326            this->server_linear_velocity_ = this->getVelocity();
    329327        }
    330328    }
     
    334332        if (this->server_overwrite_ == this->client_overwrite_)
    335333        {
    336             this->setOrientation(this->client_orientation_);
    337             // The call above increments the overwrite. This is not desired to reduce traffic
    338             --this->server_overwrite_;
     334            MobileEntity::setOrientation(this->client_orientation_);
     335            this->server_orientation_ = this->getOrientation();
    339336        }
    340337    }
     
    344341        if (this->server_overwrite_ == this->client_overwrite_)
    345342        {
    346             this->setAngularVelocity(this->client_angular_velocity_);
    347             // The call above increments the overwrite. This is not desired to reduce traffic
    348             --this->server_overwrite_;
     343            MobileEntity::setAngularVelocity(this->client_angular_velocity_);
     344            this->server_angular_velocity_ = this->getAngularVelocity();
    349345        }
    350346    }
Note: See TracChangeset for help on using the changeset viewer.