Changeset 8279
- Timestamp:
- Apr 21, 2011, 2:17:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.cc
r8244 r8279 222 222 if( item->getVelocity().dotProduct(normal) > 0 ) // greife nur ein, falls 223 223 { 224 float dampingFactor = 0.5; 225 224 226 normal.normalise(); 225 227 Vector3 velocity = item->getVelocity(); … … 229 231 /* 230 232 Vector3 rotationAxis = velocity.crossProduct(normal); 231 Ogre::Radian angle = velocity.angleBetween(normal);233 Ogre::Radian angle = 2 * velocity.angleBetween(normal); 232 234 item->setOrientation(Ogre::Quaternion::Quaternion(angle, rotationAxis)); 233 235 */ 234 item->setAcceleration(acceleration); 235 item->setVelocity(velocity); 236 /* 237 Ogre::Quaternion orientation = item->getOrientation(); 238 orientation = -1.0 * orientation; 239 item->setOrientation(orientation); 240 */ 241 //item->setOrientation(item->getOrientation().UnitInverse() ); 242 243 item->lookAt( velocity + this->getPosition() ); 244 245 item->setAcceleration(acceleration * dampingFactor); 246 item->setVelocity(velocity * dampingFactor); 236 247 } 237 248 }
Note: See TracChangeset
for help on using the changeset viewer.