Changeset 10003 for code/branches/modularships/src/orxonox
- Timestamp:
- Mar 20, 2014, 3:46:06 PM (11 years ago)
- Location:
- code/branches/modularships/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r9997 r10003 39 39 #include "core/XMLPort.h" 40 40 #include "tools/BulletConversions.h" 41 42 #include "collisionshapes/WorldEntityCollisionShape.h" 41 43 42 44 namespace orxonox … … 118 120 this->updatePublicShape(); 119 121 } 122 123 // If the shape to be attached is not a CompoundCollisionShape (thus an actual physical shape) & this is a WorldEntity's CollisionShape, 124 // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to. 125 if (!orxonox_cast<CompoundCollisionShape*>(shape) && orxonox_cast<WorldEntityCollisionShape*>(this)) 126 shape->getCollisionShape()->setUserPointer(orxonox_cast<WorldEntityCollisionShape*>(this)->getWorldEntityOwner()); 120 127 } 121 128 -
code/branches/modularships/src/orxonox/worldentities/WorldEntity.cc
r9667 r10003 46 46 #include "Scene.h" 47 47 #include "collisionshapes/WorldEntityCollisionShape.h" 48 #include <BulletCollision/CollisionShapes/btCollisionShape.h> 48 49 49 50 namespace orxonox -
code/branches/modularships/src/orxonox/worldentities/pawns/Pawn.cc
r10002 r10003 630 630 // e.g. "Box 4 is WorldEntityCollisionShape 0x126dd060" 631 631 orxout() << " " << this->getRadarName() << " is WorldEntityCollisionShape* " << ownWECS << endl; 632 // e.g. "Box 4 is btCollisionShape0x126dd060"633 orxout() << " " << this->getRadarName() << " is btCollisionShape* " << ownWECS->getCollisionShape()<< endl;632 // e.g. "Box 4 is WorldEntity 0x126dd060" 633 orxout() << " " << this->getRadarName() << " is WorldEntity* " << this << endl; 634 634 // e.g. "Box 4 is objectID 943" 635 635 orxout() << " " << this->getRadarName() << " is objectID " << this->getObjectID() << endl; 636 637 // List all attached Objects 638 orxout() << " " << this->getRadarName() << " has the following Objects attached:" << endl; 639 for (int i=0; i<10; i++) 640 orxout() << " " << i << ": " << this->getAttachedObject(i) << endl; 636 641 637 642 // print child shapes of this WECS 638 643 // printChildShapes(ownWECS, 2, 0); 639 644 printBtChildShapes((btCompoundShape*)(ownWECS->getCollisionShape()), 2, 0); 640 // printChildShapeMap(ownWECS->getShapesMap());641 645 642 646 … … 715 719 printSpaces(indent+2); orxout() << "- " << i << " - - -" << endl; 716 720 717 // For each childshape, print: 718 719 // pointer to the btCollisionShape 720 printSpaces(indent+2); orxout() << "btCollisionShape*: " << cs->getChildShape(i) << endl; 721 // For each childshape, print: (as long as it's not another CompoundCollisionShape) 722 if (!orxonox_cast<btCompoundShape*>(cs->getChildShape(i))) 723 { 724 // pointer to the btCollisionShape 725 printSpaces(indent+2); orxout() << "btCollisionShape*: " << cs->getChildShape(i) << endl; 726 727 // pointer to the btCollisionShape 728 printSpaces(indent+2); orxout() << "m_userPointer*: " << cs->getChildShape(i)->getUserPointer() << endl; 729 } 721 730 722 731 // if the childshape is a CompoundCollisionShape, print its children. 723 732 if (cs->getChildShape(i)->isCompound()) 724 {725 printSpaces(indent+2); orxout() << "This shape is compound." << endl;726 733 printBtChildShapes((btCompoundShape*)(cs->getChildShape(i)), indent+2, i); 727 } 728 729 } 730 } 731 732 void Pawn::printChildShapeMap(std::map<CollisionShape*, btCollisionShape*> map) 733 { 734 orxout() << endl; 734 735 } 735 736 } 736 737 -
code/branches/modularships/src/orxonox/worldentities/pawns/Pawn.h
r10002 r10003 236 236 void printBtChildShapes(btCompoundShape* cs, int indent, int subshape); 237 237 void printSpaces(int num); 238 void printChildShapeMap(std::map<CollisionShape*, btCollisionShape*> map);239 238 240 239 private:
Note: See TracChangeset
for help on using the changeset viewer.