Changeset 10001 for code/branches/modularships/src
- Timestamp:
- Mar 13, 2014, 3:52:23 PM (11 years ago)
- Location:
- code/branches/modularships/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/collisionshapes/CollisionShape.h
r9997 r10001 170 170 void notifyDetached(); // Notifies the CollisionShape of being detached from a CompoundCollisionShape. 171 171 172 inline unsigned int get parentID()172 inline unsigned int getParentID() 173 173 { return this->parentID_; } 174 175 inline CompoundCollisionShape* getParent() 176 { return this->parent_; } 174 177 175 178 protected: -
code/branches/modularships/src/orxonox/collisionshapes/CompoundCollisionShape.h
r9997 r10001 73 73 int getNumChildShapes(); 74 74 75 inline std::map<CollisionShape*, btCollisionShape*> getShapesMap() 76 { 77 return attachedShapes_; 78 } 79 75 80 private: 76 81 void updatePublicShape(); -
code/branches/modularships/src/orxonox/worldentities/pawns/Pawn.cc
r9997 r10001 51 51 52 52 #include "collisionshapes/WorldEntityCollisionShape.h" 53 #include <BulletCollision/CollisionShapes/btCollisionShape.h> 53 54 54 55 namespace orxonox … … 278 279 void Pawn::customDamage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 279 280 { 281 orxout() << "damage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl; 282 280 283 int collisionShapeIndex = this->isMyCollisionShape(cs); 281 284 orxout() << collisionShapeIndex << endl; … … 284 287 if (originator) 285 288 damage *= originator->getDamageMultiplier(); 286 287 orxout() << "damage(): Custom collision detected on " << this->getRadarName() << ", CS: " << cs << endl;288 289 289 290 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) … … 624 625 625 626 // e.g. "Box 4: Searching for CS 0x1ad49200" 626 orxout() << this->getRadarName() << ": Searching for CS" << cs << endl;627 orxout() << this->getRadarName() << ": Searching for btCS* " << cs << endl; 627 628 // e.g. "Box 4 is WorldEntityCollisionShape 0x126dd060" 628 orxout() << " " << this->getRadarName() << " is WorldEntityCollisionShape " << ownWECS << endl; 629 orxout() << " " << this->getRadarName() << " is WorldEntityCollisionShape* " << ownWECS << endl; 630 // e.g. "Box 4 is btCollisionShape 0x126dd060" 631 orxout() << " " << this->getRadarName() << " is btCollisionShape* " << ownWECS->getCollisionShape() << endl; 629 632 // e.g. "Box 4 is objectID 943" 630 633 orxout() << " " << this->getRadarName() << " is objectID " << this->getObjectID() << endl; 631 634 632 635 // print child shapes of this WECS 633 printChildShapes(ownWECS, 2, 0); 636 // printChildShapes(ownWECS, 2, 0); 637 printChildShapeMap(ownWECS->getShapesMap()); 638 634 639 635 640 // end … … 640 645 void Pawn::printChildShapes(CompoundCollisionShape* cs, int indent, int subshape) 641 646 { 647 for (int i=0; i < cs->getNumChildShapes(); i++) 648 { 649 orxout() << "" << endl; 650 } 651 /* 642 652 // e.g. " Childshape 1 (WECS 0x126dc8c0) has 2 childshapes:" 643 printSpaces(indent); orxout() << "Childshape " << subshape << " (WECS " << cs << ") has " << cs->getNumChildShapes() << " childshapes:" << endl; 653 printSpaces(indent); orxout() << "Childshape " << subshape << " (CS* " << cs << ") has " << cs->getNumChildShapes() << " childshapes:" << endl; 654 655 // e.g. "Box 4 is WorldEntityCollisionShape 0x126dd060" 656 printSpaces(indent); orxout() << "Childshape " << subshape << " is btCollisionShape* " << cs->getCollisionShape() << endl; 644 657 645 658 for (int i=0; i < cs->getNumChildShapes(); i++) 646 659 { 660 printSpaces(indent+2); orxout() << "- " << i << " - - -" << endl; 661 printSpaces(indent+2); orxout() << "This Shape is a "; 662 if (orxonox_cast<WorldEntityCollisionShape*>(cs->getAttachedShape(i))) 663 orxout() << "WECS "; 664 if (orxonox_cast<CompoundCollisionShape*>(cs->getAttachedShape(i))) 665 orxout() << "CCS "; 666 if (orxonox_cast<CollisionShape*>(cs->getAttachedShape(i))) 667 orxout() << "CS "; 668 orxout() << endl; 669 647 670 // For each childshape, print: 671 672 // parentID of the CollisionShape 673 printSpaces(indent+2); orxout() << "ParentID: " << cs->getAttachedShape(i)->getObjectID() << endl; 674 675 // parentID of the CollisionShape 676 printSpaces(indent+2); orxout() << "ParentID: " << cs->getAttachedShape(i)->getParentID() << endl; 677 678 // parent of the CollisionShape 679 printSpaces(indent+2); orxout() << "ParentCCS*: " << cs->getAttachedShape(i)->getParent() << endl; 680 648 681 // pointer to the btCollisionShape 649 printSpaces(indent+2); orxout() << " Bt-Childshape " << i << ": " << cs->getAttachedShape(i)->getCollisionShape() << endl;682 printSpaces(indent+2); orxout() << "btCollisionShape*: " << cs->getAttachedShape(i)->getCollisionShape() << endl; 650 683 651 684 // pointer to the CollisionShape 652 printSpaces(indent+2); orxout() << "Orx-Childshape " << i << ": " << cs->getAttachedShape(i) << endl; 653 654 // parentID of the CollisionShape 655 printSpaces(indent+2); orxout() << "ParentID of CS " << i << ": " << cs->getAttachedShape(i)->getparentID() << endl; 685 printSpaces(indent+2); orxout() << "CollisionShape*: " << cs->getAttachedShape(i) << endl; 686 687 if (cs->getAttachedShape(i)->getCollisionShape() != NULL) 688 { 689 // pointer to the user of the btCollisionShape 690 printSpaces(indent+2); orxout() << "bt: getUserPointer: " << cs->getAttachedShape(i)->getCollisionShape()->getUserPointer() << endl; 691 692 // 693 printSpaces(indent+2); orxout() << "bt: isCompound: " << cs->getAttachedShape(i)->getCollisionShape()->isCompound() << endl; 694 } 656 695 657 696 // if the childshape is a CompoundCollisionShape, print its children. … … 660 699 printChildShapes((CompoundCollisionShape*)(cs->getAttachedShape(i)), indent+2, i); 661 700 } 662 } 701 */ 702 } 703 } 704 705 void Pawn::printChildShapeMap(std::map<CollisionShape*, btCollisionShape*> map) 706 { 707 orxout() << endl; 663 708 } 664 709 -
code/branches/modularships/src/orxonox/worldentities/pawns/Pawn.h
r9997 r10001 235 235 void printChildShapes(CompoundCollisionShape* cs, int indent, int subshape); 236 236 void printSpaces(int num); 237 void printChildShapeMap(std::map<CollisionShape*, btCollisionShape*> map); 237 238 238 239 private:
Note: See TracChangeset
for help on using the changeset viewer.