Changeset 3306 in orxonox.OLD for orxonox/branches/parenting
- Timestamp:
- Dec 30, 2004, 12:32:43 AM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/null_parent.cc
r3302 r3306 64 64 this->absCoordinate = this->relCoordinate; 65 65 this->absDirection = parent->getAbsDir () * this->relDirection; 66 67 66 68 67 PNode* pn = this->children->enumerate (); -
orxonox/branches/parenting/src/world.cc
r3302 r3306 257 257 258 258 //Berechnung von normalen Vektoren 259 259 260 260 for(int i=1;i<sizeX-2;i+=1) 261 261 for(int j=1;j<sizeY-2 ;j+=1) … … 454 454 WorldEntity* entity; 455 455 456 ((WorldEntity*)this->nullParent)->processDraw ();457 458 /*456 //((WorldEntity*)this->nullParent)->processDraw (); 457 458 459 459 entity = this->entities->enumerate(); 460 460 while( entity != NULL ) … … 463 463 entity = this->entities->nextElement(); 464 464 } 465 */465 466 466 467 467 // draw debug coord system … … 540 540 541 541 this->nullParent->update (seconds); 542 this->nullParent->processTick (seconds);542 //this->nullParent->processTick (seconds); 543 543 544 544 entity = entities->enumerate(); … … 791 791 void World::spawn(WorldEntity* entity) 792 792 { 793 Location zeroloc; 794 Location* loc = NULL; 795 WorldEntity* owner; 796 797 if( this->nullParent != NULL) 793 if( this->nullParent != NULL && entity->parent == NULL) 798 794 this->nullParent->addChild (entity); 799 795 800 /* 801 entities->add (entity); 802 zeroloc.dist = 0; 803 zeroloc.part = 0; 804 zeroloc.pos = Vector(); 805 zeroloc.rot = Quaternion(); 806 loc = &zeroloc; 807 entity->init (loc, owner); 808 if (entity->bFree) 809 { 810 this->track[loc->part].mapCoords( loc, entity->getPlacement()); 811 } 812 */ 796 this->entities->add (entity); 797 813 798 entity->postSpawn (); 814 799 } … … 820 805 \param location where to add 821 806 */ 822 void World::spawn(WorldEntity* entity, Location* loc) 823 { 824 if( this->nullParent != NULL) 807 void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir) 808 { 809 entity->setAbsCoor (absCoor); 810 entity->setAbsDir (absDir); 811 812 if( this->nullParent != NULL && entity->parent == NULL) 825 813 this->nullParent->addChild (entity); 826 814 827 //Location zeroLoc;828 WorldEntity* owner;829 815 this->entities->add (entity); 830 /* 831 if( loc == NULL) 832 { 833 zeroLoc.dist = 0; 834 zeroLoc.part = 0; 835 zeroLoc.pos = Vector(); 836 zeroLoc.rot = Quaternion(); 837 loc = &zeroLoc; 838 } 839 */ 840 //entity->init (loc, owner); 841 /* 842 if (entity->bFree) 843 { 844 this->track[loc->part].mapCoords( loc, entity->getPlacement()); 845 } 846 */ 816 847 817 entity->postSpawn (); 848 //return entity; 849 } 850 851 852 /** 853 \brief add and spawn a new entity to this world 854 \param entity to be added 855 \param place where to be added 856 */ 857 void World::spawn(WorldEntity* entity, Placement* plc) 858 { 859 if( this->nullParent != NULL) 860 this->nullParent->addChild (entity); 861 862 /* 863 Placement zeroPlc; 864 WorldEntity* owner; 865 if( plc == NULL) 866 { 867 zeroPlc.r = Vector(); 868 zeroPlc.w = Quaternion(); 869 plc = &zeroPlc; 870 } 871 */ 872 this->entities->add (entity); 873 //entity->init (plc, owner); 874 entity->postSpawn (); 875 //return entity; 876 } 818 } 819 877 820 878 821 -
orxonox/branches/parenting/src/world.h
r3276 r3306 54 54 55 55 void spawn (WorldEntity* entity); 56 void spawn (WorldEntity* entity, Location* loc); 57 void spawn (WorldEntity* entity, Placement* plc); 56 void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); 58 57 59 58 tList<WorldEntity>* entities;
Note: See TracChangeset
for help on using the changeset viewer.