[Orxonox-commit 5542] r10205 - code/branches/presentationFS14/src/orxonox/collisionshapes

landauf at orxonox.net landauf at orxonox.net
Mon Jan 26 00:22:57 CET 2015


Author: landauf
Date: 2015-01-26 00:22:57 +0100 (Mon, 26 Jan 2015)
New Revision: 10205

Modified:
   code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.cc
Log:
the previous commit was not correct. re-added the call to setUserPointer, but I may have found a better place for it.

Modified: code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.cc	2015-01-25 22:32:17 UTC (rev 10204)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.cc	2015-01-25 23:22:57 UTC (rev 10205)
@@ -120,10 +120,19 @@
         // TODO: Why?
         WorldEntityCollisionShape* parentWECCS = orxonox_cast<WorldEntityCollisionShape*>(newParent);
         if (parentWECCS)
+        {
             this->parentID_ = parentWECCS->getWorldEntityOwner()->getObjectID();
-        // Else it is set to the objectID of the CompoundCollisionShape.
+
+            // If this shape is not a CompoundCollisionShape (thus an actual physical shape) & the parent is a WorldEntity's CollisionShape,
+            // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to.
+            if (!orxonox_cast<CompoundCollisionShape*>(this))
+                this->getCollisionShape()->setUserPointer(parentWECCS->getWorldEntityOwner());
+        }
         else
+        {
+            // Else it is set to the objectID of the CompoundCollisionShape.
             this->parentID_ = newParent->getObjectID();
+        }
 
         return true;
     }




More information about the Orxonox-commit mailing list