- Timestamp:
- Dec 13, 2008, 9:38:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/MobileEntity.cc
r2426 r2427 83 83 this->linearVelocity_.y += this->linearAcceleration_.y * dt; 84 84 this->linearVelocity_.z += this->linearAcceleration_.z * dt; 85 linearVelocityChanged(true);86 85 this->node_->translate(this->linearVelocity_ * dt); 87 positionChanged(true);88 86 89 87 // Angular part … … 92 90 this->angularVelocity_.y += angularAcceleration_.y * dt; 93 91 this->angularVelocity_.z += angularAcceleration_.z * dt; 94 angularVelocityChanged(true);95 92 // Calculate new orientation with quaternion derivative. This is about 30% faster than with angle/axis method. 96 93 float mult = dt * 0.5; … … 100 97 newOrientation.normalise(); 101 98 this->node_->setOrientation(newOrientation); 102 orientationChanged(true);103 99 } 104 100 } … … 115 111 116 112 this->node_->setPosition(position); 117 positionChanged(false);118 113 } 119 114 … … 128 123 129 124 this->node_->setOrientation(orientation); 130 orientationChanged(false);131 125 } 132 126 … … 137 131 138 132 this->linearVelocity_ = velocity; 139 linearVelocityChanged(false);140 133 } 141 134 … … 146 139 147 140 this->angularVelocity_ = velocity; 148 angularVelocityChanged(false);149 141 } 150 142 … … 190 182 this->angularVelocity_.y = this->physicalBody_->getAngularVelocity().y(); 191 183 this->angularVelocity_.z = this->physicalBody_->getAngularVelocity().z(); 192 linearVelocityChanged(true);193 angularVelocityChanged(true);194 positionChanged(true);195 orientationChanged(true);196 184 } 197 185
Note: See TracChangeset
for help on using the changeset viewer.