[Orxonox-commit 81] r2780 - trunk/src/orxonox/objects/worldentities

rgrieder at orxonox.net rgrieder at orxonox.net
Thu Mar 12 19:36:12 CET 2009


Author: rgrieder
Date: 2009-03-12 18:36:12 +0000 (Thu, 12 Mar 2009)
New Revision: 2780

Modified:
   trunk/src/orxonox/objects/worldentities/MobileEntity.cc
Log:
Checking whether a function really does what you think might sometimes help ;)
Bullet stores the transformation as matrix, not as vector and quaternion like ogre.

This little fix equals a speed gain of about 1.4% in dedicated mode without clients and 30 bots.

Modified: trunk/src/orxonox/objects/worldentities/MobileEntity.cc
===================================================================
--- trunk/src/orxonox/objects/worldentities/MobileEntity.cc	2009-03-12 16:13:34 UTC (rev 2779)
+++ trunk/src/orxonox/objects/worldentities/MobileEntity.cc	2009-03-12 18:36:12 UTC (rev 2780)
@@ -181,7 +181,8 @@
     {
         // We use a dynamic body. So we translate our node accordingly.
         this->node_->setPosition(Vector3(worldTrans.getOrigin().x(), worldTrans.getOrigin().y(), worldTrans.getOrigin().z()));
-        this->node_->setOrientation(Quaternion(worldTrans.getRotation().w(), worldTrans.getRotation().x(), worldTrans.getRotation().y(), worldTrans.getRotation().z()));
+        btQuaternion temp(worldTrans.getRotation());
+        this->node_->setOrientation(Quaternion(temp.w(), temp.x(), temp.y(), temp.z()));
         this->linearVelocity_.x = this->physicalBody_->getLinearVelocity().x();
         this->linearVelocity_.y = this->physicalBody_->getLinearVelocity().y();
         this->linearVelocity_.z = this->physicalBody_->getLinearVelocity().z();




More information about the Orxonox-commit mailing list