Changeset 10001 for code/branches/modularships
- Timestamp:
- Mar 13, 2014, 3:52:23 PM (11 years ago)
- Location:
- code/branches/modularships
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/data/levels/emptyLevel.oxw
r9997 r10001 49 49 </MovableEntity> 50 50 51 <Pawn health=1000 initialhealth=1000 maxhealth=1000 position="0,-100, 0" direction="0,0,0" collisionType=dynamic mass=1000 name=box radarname = "Box 4" >51 <Pawn health=1000 initialhealth=1000 maxhealth=1000 position="0,-100,-100" direction="0,0,0" collisionType=dynamic mass=1000 name=box radarname = "Pawn 0" > 52 52 <attached> 53 <Model position="0,0,0" mesh="crate.mesh" scale3D=" 3,3,3" />54 <Model position="0,- 30,0" mesh="cube.mesh" scale3D="15,15,15" />55 <StaticEntity position="0,- 60,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >53 <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" /> 54 <Model position="0,-60,0" mesh="cube.mesh" scale3D="30,30,30" /> 55 <StaticEntity position="0,-120,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 > 56 56 <attached> 57 <Model position="0,0,0" mesh="c ube.mesh" scale3D="15,15,15" />58 <Model position="0,0, 30" mesh="cube.mesh" scale3D="15,15,15" />57 <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" /> 58 <Model position="0,0,60" mesh="cube.mesh" scale3D="30,30,30" /> 59 59 </attached> 60 60 <collisionShapes> 61 <BoxCollisionShape position="0,0,0" halfExtents=" 15,15,15" />62 <BoxCollisionShape position="0,0, 30" halfExtents="15,15,15" />61 <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" /> 62 <BoxCollisionShape position="0,0,60" halfExtents="30,30,30" /> 63 63 </collisionShapes> 64 64 </StaticEntity> 65 65 </attached> 66 66 <collisionShapes> 67 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 68 <BoxCollisionShape position="0,-30,0" halfExtents="15,15,15" /> 67 <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" /> 68 <BoxCollisionShape position="0,-60,0" halfExtents="30,30,30" /> 69 </collisionShapes> 70 </Pawn> 71 72 <Pawn health=1000 initialhealth=1000 maxhealth=1000 position="0,-100,100" direction="0,0,0" collisionType=dynamic mass=1000 name=box radarname = "Pawn 1" > 73 <attached> 74 <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" /> 75 <Model position="0,-60,0" mesh="cube.mesh" scale3D="30,30,30" /> 76 </attached> 77 <collisionShapes> 78 <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" /> 79 <BoxCollisionShape position="0,-60,0" halfExtents="30,30,30" /> 69 80 </collisionShapes> 70 81 </Pawn> -
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.