Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2008, 9:38:30 PM (17 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.cc

    r2426 r2427  
    8383                this->linearVelocity_.y += this->linearAcceleration_.y * dt;
    8484                this->linearVelocity_.z += this->linearAcceleration_.z * dt;
    85                 linearVelocityChanged(true);
    8685                this->node_->translate(this->linearVelocity_ * dt);
    87                 positionChanged(true);
    8886
    8987                // Angular part
     
    9290                this->angularVelocity_.y += angularAcceleration_.y * dt;
    9391                this->angularVelocity_.z += angularAcceleration_.z * dt;
    94                 angularVelocityChanged(true);
    9592                // Calculate new orientation with quaternion derivative. This is about 30% faster than with angle/axis method.
    9693                float mult = dt * 0.5;
     
    10097                newOrientation.normalise();
    10198                this->node_->setOrientation(newOrientation);
    102                 orientationChanged(true);
    10399            }
    104100        }
     
    115111
    116112        this->node_->setPosition(position);
    117         positionChanged(false);
    118113    }
    119114
     
    128123
    129124        this->node_->setOrientation(orientation);
    130         orientationChanged(false);
    131125    }
    132126
     
    137131
    138132        this->linearVelocity_ = velocity;
    139         linearVelocityChanged(false);
    140133    }
    141134
     
    146139
    147140        this->angularVelocity_ = velocity;
    148         angularVelocityChanged(false);
    149141    }
    150142
     
    190182        this->angularVelocity_.y = this->physicalBody_->getAngularVelocity().y();
    191183        this->angularVelocity_.z = this->physicalBody_->getAngularVelocity().z();
    192         linearVelocityChanged(true);
    193         angularVelocityChanged(true);
    194         positionChanged(true);
    195         orientationChanged(true);
    196184    }
    197185
Note: See TracChangeset for help on using the changeset viewer.