Changeset 3521 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 12, 2005, 8:45:59 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3493 r3521 41 41 world_entities/environment.cc \ 42 42 world_entities/skysphere.cc \ 43 world_entities/primitive.cc \ 43 44 ai/ai.cc \ 44 45 lib/coord/p_node.cc \ … … 83 84 world_entities/shoot_rocket.h \ 84 85 world_entities/power_up.h \ 86 world_entities/primitive.h \ 85 87 ai/ai.h \ 86 88 network/synchronisable.h \ -
orxonox/trunk/src/Makefile.in
r3502 r3521 58 58 campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \ 59 59 player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \ 60 ai.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \61 helper_parent.$(OBJEXT) data_tank.$(OBJEXT) fontset.$(OBJEXT) \62 array.$(OBJEXT) objModel.$(OBJEXT) model.$(OBJEXT) \63 material.$(OBJEXT) texture.$(OBJEXT) base_entity.$(OBJEXT) \64 base_object.$(OBJEXT) ini_parser.$(OBJEXT) list.$(OBJEXT) \65 vector.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \66 glmenu_imagescreen.$(OBJEXT)60 primitive.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \ 61 null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \ 62 data_tank.$(OBJEXT) fontset.$(OBJEXT) array.$(OBJEXT) \ 63 objModel.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \ 64 texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \ 65 ini_parser.$(OBJEXT) list.$(OBJEXT) vector.$(OBJEXT) \ 66 matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) 67 67 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 68 68 orxonox_LDADD = $(LDADD) … … 86 86 @AMDEP_TRUE@ ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/orxonox.Po \ 87 87 @AMDEP_TRUE@ ./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/ skysphere.Po \88 @AMDEP_TRUE@ ./$(DEPDIR)/primitive.Po ./$(DEPDIR)/skysphere.Po \ 89 89 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \ 90 90 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \ … … 231 231 world_entities/environment.cc \ 232 232 world_entities/skysphere.cc \ 233 world_entities/primitive.cc \ 233 234 ai/ai.cc \ 234 235 lib/coord/p_node.cc \ … … 273 274 world_entities/shoot_rocket.h \ 274 275 world_entities/power_up.h \ 276 world_entities/primitive.h \ 275 277 ai/ai.h \ 276 278 network/synchronisable.h \ … … 392 394 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@ 393 395 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ 396 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive.Po@am__quote@ 394 397 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@ 395 398 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@ … … 527 530 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 528 531 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o skysphere.obj `if test -f 'world_entities/skysphere.cc'; then $(CYGPATH_W) 'world_entities/skysphere.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/skysphere.cc'; fi` 532 533 primitive.o: world_entities/primitive.cc 534 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive.o -MD -MP -MF "$(DEPDIR)/primitive.Tpo" -c -o primitive.o `test -f 'world_entities/primitive.cc' || echo '$(srcdir)/'`world_entities/primitive.cc; \ 535 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/primitive.Tpo" "$(DEPDIR)/primitive.Po"; else rm -f "$(DEPDIR)/primitive.Tpo"; exit 1; fi 536 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/primitive.cc' object='primitive.o' libtool=no @AMDEPBACKSLASH@ 537 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/primitive.Po' tmpdepfile='$(DEPDIR)/primitive.TPo' @AMDEPBACKSLASH@ 538 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 539 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive.o `test -f 'world_entities/primitive.cc' || echo '$(srcdir)/'`world_entities/primitive.cc 540 541 primitive.obj: world_entities/primitive.cc 542 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive.obj -MD -MP -MF "$(DEPDIR)/primitive.Tpo" -c -o primitive.obj `if test -f 'world_entities/primitive.cc'; then $(CYGPATH_W) 'world_entities/primitive.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/primitive.cc'; fi`; \ 543 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/primitive.Tpo" "$(DEPDIR)/primitive.Po"; else rm -f "$(DEPDIR)/primitive.Tpo"; exit 1; fi 544 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/primitive.cc' object='primitive.obj' libtool=no @AMDEPBACKSLASH@ 545 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/primitive.Po' tmpdepfile='$(DEPDIR)/primitive.TPo' @AMDEPBACKSLASH@ 546 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 547 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive.obj `if test -f 'world_entities/primitive.cc'; then $(CYGPATH_W) 'world_entities/primitive.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/primitive.cc'; fi` 529 548 530 549 ai.o: ai/ai.cc -
orxonox/trunk/src/lib/coord/p_node.cc
r3511 r3521 22 22 23 23 #include "p_node.h" 24 24 #include "null_parent.h" 25 25 26 26 using namespace std; … … 259 259 {} 260 260 261 262 263 261 /** 264 262 \brief adds a child and makes this node to a parent … … 282 280 void PNode::addChild (PNode* pNode, parentingMode mode) 283 281 { 284 pNode->mode = mode; 285 pNode->parent = this; 286 this->children->add (pNode); 282 if( pNode->parent == NULL ) 283 { 284 pNode->mode = mode; 285 pNode->parent = this; 286 this->children->add (pNode); 287 } 288 else 289 { 290 PRINTF(1)("PNode::addChild() - this node has already been added - closed Loop MARK \n"); 291 } 287 292 } 288 293 … … 295 300 { 296 301 this->children->remove (pNode); 302 pNode->parent = NULL; 297 303 } 298 304 … … 302 308 \param parent the Parent to set 303 309 */ 310 /* 304 311 void PNode::setParent (PNode* parent) 305 312 { 306 313 parent->addChild(this); 307 314 } 315 */ 308 316 309 317 /** … … 368 376 } 369 377 else 370 this->absCoordinate = parent->getAbsCoor 378 this->absCoordinate = parent->getAbsCoor() + this->relCoordinate; /* update the current absCoordinate */ 371 379 } 372 380 } 373 381 374 if( this->mode == ROTATION &&this->mode == ALL)382 if( this->mode == ROTATION || this->mode == ALL) 375 383 { 376 384 if( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/) 377 385 { 378 386 /* if you have set the absolute coordinates this overrides all other changes */ 379 this->relDirection = this->absDirection - parent->getAbsDir 387 this->relDirection = this->absDirection - parent->getAbsDir(); 380 388 } 381 389 else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/) 382 390 { 383 391 /* update the current absDirection - remember * means rotation around sth.*/ 384 this->absDirection = parent->getAbsDir 392 this->absDirection = parent->getAbsDir() * this->relDirection; 385 393 } 386 394 } 387 // }388 395 PNode* pn = this->children->enumerate(); 389 396 while( pn != NULL) … … 457 464 return this->objectName; 458 465 } 466 -
orxonox/trunk/src/lib/coord/p_node.h
r3488 r3521 64 64 void addChild (PNode* pNode, parentingMode mode); 65 65 void removeChild (PNode* pNode); 66 void setParent (PNode* parent);66 //void setParent (PNode* parent); 67 67 void parentCoorChanged (); 68 68 void parentDirChanged (); … … 79 79 void debug (); 80 80 81 protected: 81 82 float timeStamp; //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated 82 83 char* objectName; //!< The name of the Object -
orxonox/trunk/src/story_entities/world.cc
r3507 r3521 22 22 #include "camera.h" 23 23 #include "environment.h" 24 #include "primitive.h" 24 25 #include "p_node.h" 25 26 #include "null_parent.h" … … 232 233 this->glmis->step(); 233 234 235 236 WorldEntity* env = new Environment(); 237 env->setName ("env"); 238 this->spawn(env); 239 this->trackManager->setBindSlave(env); 240 234 241 Vector* es = new Vector (50, 2, 0); 235 242 Quaternion* qs = new Quaternion (); 236 WorldEntity* env = new Environment(); 237 env->setName ("env"); 238 this->spawn(env, es, qs); 239 243 WorldEntity* pr = new Primitive(PSPHERE); 244 pr->setName("primitive"); 245 this->spawn(pr, this->localPlayer, es, qs, ROTATION); 246 247 240 248 /*monitor progress*/ 241 249 this->glmis->step(); 242 243 trackManager->setBindSlave(env);244 250 245 251 break; … … 896 902 897 903 904 /** 905 \brief add and spawn a new entity to this world 906 \param entity to be added 907 \param entity to be added to (PNode) 908 \param At what relative coordinates to add this entity. 909 \param In which relative direction should it look. 910 */ 911 void World::spawn(WorldEntity* entity, PNode* parentNode, 912 Vector* relCoor, Quaternion* relDir, 913 parentingMode mode) 914 { 915 916 if( parentNode != NULL && entity->parent == NULL) 917 { 918 parentNode->addChild (entity); 919 920 entity->setRelCoor (relCoor); 921 entity->setRelDir (relDir); 922 923 this->entities->add (entity); 924 925 entity->postSpawn (); 926 } 927 } 928 929 898 930 899 931 /** -
orxonox/trunk/src/story_entities/world.h
r3475 r3521 9 9 #include "stdincl.h" 10 10 #include "story_entity.h" 11 11 #include "p_node.h" 12 12 13 13 class TrackManager; … … 19 19 class Light; 20 20 class FontSet; 21 21 22 22 23 //! The game world … … 51 52 void spawn (WorldEntity* entity); 52 53 void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); 53 54 void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, 55 parentingMode mode); 54 56 55 57
Note: See TracChangeset
for help on using the changeset viewer.