Changeset 3966 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 26, 2005, 12:23:38 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 deleted
- 17 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3869 r3966 8 8 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics 9 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer 10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/particles 10 11 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui 11 12 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang … … 69 70 lib/graphics/importer/material.cc \ 70 71 lib/graphics/importer/texture.cc \ 72 lib/graphics/particles/particle_engine.cc \ 73 lib/graphics/particles/particle_system.cc \ 74 lib/graphics/particles/particle_emitter.cc \ 71 75 lib/lang/base_entity.cc \ 72 76 lib/lang/base_object.cc \ … … 125 129 lib/graphics/light.h \ 126 130 lib/graphics/text_engine.h \ 131 lib/graphics/particles/particle_engine.h \ 132 lib/graphics/particles/particle_system.h \ 133 lib/graphics/particles/particle_emitter.h \ 127 134 lib/data/data_tank.h \ 128 135 lib/lang/base_entity.h \ -
orxonox/trunk/src/Makefile.in
r3869 r3966 68 68 text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \ 69 69 primitive_model.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \ 70 texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \ 70 texture.$(OBJEXT) particle_engine.$(OBJEXT) \ 71 particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \ 72 base_entity.$(OBJEXT) base_object.$(OBJEXT) \ 71 73 ini_parser.$(OBJEXT) list.$(OBJEXT) resource_manager.$(OBJEXT) \ 72 74 vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) … … 96 98 @AMDEP_TRUE@ ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \ 97 99 @AMDEP_TRUE@ ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \ 100 @AMDEP_TRUE@ ./$(DEPDIR)/particle_emitter.Po \ 101 @AMDEP_TRUE@ ./$(DEPDIR)/particle_engine.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/particle_system.Po \ 98 103 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po \ 99 104 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ … … 237 242 target_vendor = @target_vendor@ 238 243 MAINSRCDIR = . 239 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/g ui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common244 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common 240 245 AM_LDFLAGS = $(MWINDOWS) 241 246 orxonox_SOURCES = orxonox.cc \ … … 279 284 lib/graphics/importer/material.cc \ 280 285 lib/graphics/importer/texture.cc \ 286 lib/graphics/particles/particle_engine.cc \ 287 lib/graphics/particles/particle_system.cc \ 288 lib/graphics/particles/particle_emitter.cc \ 281 289 lib/lang/base_entity.cc \ 282 290 lib/lang/base_object.cc \ … … 335 343 lib/graphics/light.h \ 336 344 lib/graphics/text_engine.h \ 345 lib/graphics/particles/particle_engine.h \ 346 lib/graphics/particles/particle_system.h \ 347 lib/graphics/particles/particle_emitter.h \ 337 348 lib/data/data_tank.h \ 338 349 lib/lang/base_entity.h \ … … 454 465 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox.Po@am__quote@ 455 466 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@ 467 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_emitter.Po@am__quote@ 468 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_engine.Po@am__quote@ 469 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particle_system.Po@am__quote@ 456 470 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ 457 471 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ … … 1017 1031 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1018 1032 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f 'lib/graphics/importer/texture.cc'; then $(CYGPATH_W) 'lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/importer/texture.cc'; fi` 1033 1034 particle_engine.o: lib/graphics/particles/particle_engine.cc 1035 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_engine.o -MD -MP -MF "$(DEPDIR)/particle_engine.Tpo" -c -o particle_engine.o `test -f 'lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_engine.cc; \ 1036 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi 1037 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_engine.cc' object='particle_engine.o' libtool=no @AMDEPBACKSLASH@ 1038 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@ 1039 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1040 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.o `test -f 'lib/graphics/particles/particle_engine.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_engine.cc 1041 1042 particle_engine.obj: lib/graphics/particles/particle_engine.cc 1043 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_engine.obj -MD -MP -MF "$(DEPDIR)/particle_engine.Tpo" -c -o particle_engine.obj `if test -f 'lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_engine.cc'; fi`; \ 1044 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_engine.Tpo" "$(DEPDIR)/particle_engine.Po"; else rm -f "$(DEPDIR)/particle_engine.Tpo"; exit 1; fi 1045 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_engine.cc' object='particle_engine.obj' libtool=no @AMDEPBACKSLASH@ 1046 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_engine.Po' tmpdepfile='$(DEPDIR)/particle_engine.TPo' @AMDEPBACKSLASH@ 1047 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1048 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_engine.obj `if test -f 'lib/graphics/particles/particle_engine.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_engine.cc'; fi` 1049 1050 particle_system.o: lib/graphics/particles/particle_system.cc 1051 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_system.o -MD -MP -MF "$(DEPDIR)/particle_system.Tpo" -c -o particle_system.o `test -f 'lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_system.cc; \ 1052 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi 1053 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_system.cc' object='particle_system.o' libtool=no @AMDEPBACKSLASH@ 1054 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@ 1055 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1056 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.o `test -f 'lib/graphics/particles/particle_system.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_system.cc 1057 1058 particle_system.obj: lib/graphics/particles/particle_system.cc 1059 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_system.obj -MD -MP -MF "$(DEPDIR)/particle_system.Tpo" -c -o particle_system.obj `if test -f 'lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_system.cc'; fi`; \ 1060 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_system.Tpo" "$(DEPDIR)/particle_system.Po"; else rm -f "$(DEPDIR)/particle_system.Tpo"; exit 1; fi 1061 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_system.cc' object='particle_system.obj' libtool=no @AMDEPBACKSLASH@ 1062 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_system.Po' tmpdepfile='$(DEPDIR)/particle_system.TPo' @AMDEPBACKSLASH@ 1063 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1064 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_system.obj `if test -f 'lib/graphics/particles/particle_system.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_system.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_system.cc'; fi` 1065 1066 particle_emitter.o: lib/graphics/particles/particle_emitter.cc 1067 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_emitter.o -MD -MP -MF "$(DEPDIR)/particle_emitter.Tpo" -c -o particle_emitter.o `test -f 'lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_emitter.cc; \ 1068 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi 1069 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_emitter.cc' object='particle_emitter.o' libtool=no @AMDEPBACKSLASH@ 1070 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@ 1071 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1072 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.o `test -f 'lib/graphics/particles/particle_emitter.cc' || echo '$(srcdir)/'`lib/graphics/particles/particle_emitter.cc 1073 1074 particle_emitter.obj: lib/graphics/particles/particle_emitter.cc 1075 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particle_emitter.obj -MD -MP -MF "$(DEPDIR)/particle_emitter.Tpo" -c -o particle_emitter.obj `if test -f 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi`; \ 1076 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particle_emitter.Tpo" "$(DEPDIR)/particle_emitter.Po"; else rm -f "$(DEPDIR)/particle_emitter.Tpo"; exit 1; fi 1077 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib/graphics/particles/particle_emitter.cc' object='particle_emitter.obj' libtool=no @AMDEPBACKSLASH@ 1078 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particle_emitter.Po' tmpdepfile='$(DEPDIR)/particle_emitter.TPo' @AMDEPBACKSLASH@ 1079 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1080 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f 'lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) 'lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/particles/particle_emitter.cc'; fi` 1019 1081 1020 1082 base_entity.o: lib/lang/base_entity.cc … … 1268 1330 1269 1331 distdir: $(DISTFILES) 1270 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/ lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities1332 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/particles $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities 1271 1333 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 1272 1334 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ -
orxonox/trunk/src/defs/debug.h
r3875 r3966 63 63 #define DEBUG_MODULE_LOAD 0 64 64 65 #define DEBUG_MODULE_IMPORTER 165 #define DEBUG_MODULE_IMPORTER 3 66 66 #define DEBUG_MODULE_TRACK_MANAGER 0 67 67 #define DEBUG_MODULE_GARBAGE_COLLECTOR 0 … … 72 72 #define DEBUG_MODULE_FONT 1 73 73 #define DEBUG_MODULE_ANIM 1 74 #define DEBUG_MODULE_PARTICLE 4 74 75 75 76 #define DEBUG_MODULE_NULL_PARENT 0 -
orxonox/trunk/src/lib/coord/null_parent.cc
r3809 r3966 54 54 this->parent = this; 55 55 this->mode = PNODE_ALL; 56 *this->absCoordinate = absCoordinate;56 this->absCoordinate = absCoordinate; 57 57 this->setName("NullParent"); 58 58 } … … 80 80 { 81 81 82 PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate ->x, this->absCoordinate->y, this->absCoordinate->z);83 *this->absCoordinate = *this->relCoordinate;84 *this->absDirection = parent->getAbsDir () * *this->relDirection;82 PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 83 this->absCoordinate = this->relCoordinate; 84 this->absDirection = parent->getAbsDir () * this->relDirection; 85 85 86 86 tIterator<PNode>* iterator = this->children->getIterator(); -
orxonox/trunk/src/lib/coord/p_node.cc
r3860 r3966 60 60 this->init(parent); 61 61 62 *this->absCoordinate = absCoordinate;62 this->absCoordinate = absCoordinate; 63 63 64 64 if (likely(parent != NULL)) 65 65 { 66 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor();66 this->relCoordinate = this->absCoordinate - parent->getAbsCoor(); 67 67 parent->addChild (this); 68 68 } 69 else70 this->relCoordinate = new Vector();71 69 } 72 70 … … 89 87 delete []this->objectName; 90 88 91 delete this->relCoordinate;92 delete this->absCoordinate;93 delete this->relDirection;94 delete this->absDirection;95 delete this->lastAbsCoordinate;96 delete this->diffCoordinate;97 89 } 98 90 … … 108 100 this->objectName = NULL; 109 101 this->time = 1.0; /* set time to 1 to make divisions by zero impossible */ 110 111 this->absCoordinate = new Vector();112 this->relCoordinate = new Vector();113 this->absDirection = new Quaternion();114 this->relDirection = new Quaternion();115 this->lastAbsCoordinate = new Vector();116 this->diffCoordinate = new Vector();117 102 } 118 103 … … 158 143 { 159 144 this->bRelCoorChanged = true; 160 *this->relCoordinate = relCoord;145 this->relCoordinate = relCoord; 161 146 } 162 147 … … 182 167 { 183 168 this->bAbsCoorChanged = true; 184 *this->absCoordinate = absCoord;169 this->absCoordinate = absCoord; 185 170 } 186 171 … … 211 196 if( unlikely(this->bAbsCoorChanged)) 212 197 { 213 *this->absCoordinate = *this->absCoordinate +shift;198 this->absCoordinate += shift; 214 199 } 215 200 else 216 201 { 217 *this->relCoordinate = *this->relCoordinate +shift;202 this->relCoordinate += shift; 218 203 this->bRelCoorChanged = true; 219 204 } … … 241 226 { 242 227 this->bRelCoorChanged = true; 243 *this->relDirection = relDir;228 this->relDirection = relDir; 244 229 } 245 230 … … 264 249 { 265 250 this->bAbsDirChanged = true; 266 *this->absDirection = absDir;251 this->absDirection = absDir; 267 252 } 268 253 … … 293 278 { 294 279 this->bRelDirChanged = true; 295 *this->relDirection = *this->relDirection * shift;280 this->relDirection = this->relDirection * shift; 296 281 } 297 282 … … 303 288 float PNode::getSpeed() const 304 289 { 305 *this->diffCoordinate = *this->absCoordinate - *this->lastAbsCoordinate; 306 return this->diffCoordinate->len() / this->time; 307 } 308 290 return (this->absCoordinate - this->lastAbsCoordinate).len() / this->time; 291 } 292 293 /** 294 \returns the Velocity of the PNode 295 */ 296 Vector PNode::getVelocity() const 297 { 298 return (this->absCoordinate - this->lastAbsCoordinate) / this->time; 299 } 309 300 310 301 /** … … 432 423 void PNode::update (float dt) 433 424 { 434 *this->lastAbsCoordinate = *this->absCoordinate;425 this->lastAbsCoordinate = this->absCoordinate; 435 426 this->time = dt; 436 PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate ->x, this->absCoordinate->y, this->absCoordinate->z);427 PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 437 428 438 429 … … 442 433 { 443 434 /* if you have set the absolute coordinates this overrides all other changes */ 444 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();435 this->relCoordinate = this->absCoordinate - parent->getAbsCoor (); 445 436 } 446 437 if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) … … 455 446 } 456 447 else */ 457 *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate; /* update the current absCoordinate */448 this->absCoordinate = parent->getAbsCoor() + this->relCoordinate; /* update the current absCoordinate */ 458 449 } 459 450 } … … 464 455 { 465 456 /* if you have set the absolute coordinates this overrides all other changes */ 466 *this->relDirection = *this->absDirection - parent->getAbsDir();457 this->relDirection = this->absDirection - parent->getAbsDir(); 467 458 } 468 459 else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 469 460 { 470 461 /* update the current absDirection - remember * means rotation around sth.*/ 471 *this->absDirection = parent->getAbsDir() * *this->relDirection;462 this->absDirection = parent->getAbsDir() * this->relDirection; 472 463 } 473 464 } … … 478 469 { 479 470 /* if you have set the absolute coordinates this overrides all other changes */ 480 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();471 this->relCoordinate = this->absCoordinate - parent->getAbsCoor (); 481 472 } 482 473 else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) … … 486 477 *this->absCoordinate = *this->relCoordinate; 487 478 else*/ 488 *this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(*this->relCoordinate); /* update the current absCoordinate */479 this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate); /* update the current absCoordinate */ 489 480 } 490 481 } … … 540 531 { 541 532 PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n", 542 this->absCoordinate ->x,543 this->absCoordinate ->y,544 this->absCoordinate ->z);533 this->absCoordinate.x, 534 this->absCoordinate.y, 535 this->absCoordinate.z); 545 536 } 546 537 … … 551 542 for debug purposes realy usefull, not used to work properly 552 543 */ 553 void PNode::setName (c har* newName)544 void PNode::setName (const char* newName) 554 545 { 555 546 this->objectName = new char[strlen(newName)+1]; … … 561 552 \brief gets the name of the node 562 553 */ 563 c har* PNode::getName ()554 const char* PNode::getName () 564 555 { 565 556 return this->objectName; -
orxonox/trunk/src/lib/coord/p_node.h
r3813 r3966 57 57 58 58 59 inline Vector*getRelCoor () const { return this->relCoordinate; }59 inline const Vector& getRelCoor () const { return this->relCoordinate; } 60 60 void setRelCoor (const Vector& relCoord); 61 inline Vector getAbsCoor () const { return *this->absCoordinate; }61 inline const Vector& getAbsCoor () const { return this->absCoordinate; } 62 62 void setAbsCoor (const Vector& absCoord); 63 63 void shiftCoor (const Vector& shift); 64 64 65 inline Quaternion getRelDir () const { return *this->relDirection; }65 inline const Quaternion& getRelDir () const { return this->relDirection; } 66 66 void setRelDir (const Quaternion& relDir); 67 inline Quaternion getAbsDir () const { return *this->absDirection; }67 inline const Quaternion& getAbsDir () const { return this->absDirection; } 68 68 void setAbsDir (const Quaternion& absDir); 69 69 void shiftDir (const Quaternion& shift); 70 70 71 71 float getSpeed() const; 72 Vector getVelocity() const; 72 73 73 74 void addChild (PNode* pNode, int parentingMode = DEFAULT_MODE); … … 85 86 void processTick (float dt); 86 87 87 void setName (c har* newName);88 c har* getName ();88 void setName (const char* newName); 89 const char* getName (); 89 90 90 91 … … 99 100 bool bRelDirChanged; //!< If Relative Direction has changed since last time we checked 100 101 101 Vector *relCoordinate; //!< coordinates relative to the parent102 Vector *absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) )103 Quaternion *relDirection; //!< direction relative to the parent104 Quaternion *absDirection; //!< absolute direvtion in the world ( from (0,0,1) )102 Vector relCoordinate; //!< coordinates relative to the parent 103 Vector absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) ) 104 Quaternion relDirection; //!< direction relative to the parent 105 Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) ) 105 106 106 107 int mode; //!< the mode of the binding … … 109 110 void init(PNode* parent); 110 111 111 Vector *lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate112 Vector *diffCoordinate; //!< this is stored here for performance reasons, difference to the last vector112 Vector lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate 113 Vector diffCoordinate; //!< this is stored here for performance reasons, difference to the last vector 113 114 float time; //!< time since last update 114 115 }; -
orxonox/trunk/src/lib/graphics/importer/material.cc
r3914 r3966 88 88 89 89 // setting the transparency 90 if (this->transparency == 1.0) 91 { 92 glDisable(GL_BLEND); 93 } 94 else 90 if (this->transparency < 1.0) 95 91 { 96 92 glEnable(GL_BLEND); … … 98 94 glBlendFunc(GL_SRC_ALPHA, GL_ONE); 99 95 } 96 else 97 { 98 glDisable(GL_BLEND); 99 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 100 } 101 100 102 101 103 // setting illumination Model … … 109 111 glEnable(GL_TEXTURE_2D); 110 112 glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture()); 113 114 /* This allows alpha blending of 2D textures with the scene */ 115 if (this->diffuseTexture->hasAlpha()) 116 { 117 glEnable(GL_BLEND); 118 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 119 } 111 120 } 112 121 else -
orxonox/trunk/src/lib/graphics/importer/texture.cc
r3905 r3966 25 25 Texture::Texture(const char* imageName) 26 26 { 27 bAlpha = false; 27 28 this->texture = 0; 28 29 if (imageName) … … 112 113 if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { 113 114 SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha); 115 this->bAlpha = true; 114 116 } 115 117 … … 119 121 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 120 122 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 121 /* glTexImage2D(GL_TEXTURE_2D, 123 // build the Texture 124 glTexImage2D(GL_TEXTURE_2D, 122 125 0, 123 126 GL_RGBA, … … 127 130 GL_UNSIGNED_BYTE, 128 131 image->pixels); 129 */132 // build the MipMaps 130 133 gluBuild2DMipmaps(GL_TEXTURE_2D, 131 3,134 GL_RGBA, 132 135 w, 133 136 h, … … 135 138 GL_UNSIGNED_BYTE, 136 139 image->pixels); 137 140 138 141 SDL_FreeSurface(image); /* No longer needed */ 139 142 -
orxonox/trunk/src/lib/graphics/importer/texture.h
r3905 r3966 23 23 char* searchTextureInPaths(const char* texName) const; 24 24 void swap(unsigned char &a, unsigned char &b); 25 26 bool bAlpha; //!< if the texture has an alpha channel. 25 27 public: 26 28 Texture(const char* imageName = NULL); … … 30 32 inline GLuint getTexture(void) {return this->texture;} 31 33 GLuint loadTexToGL (SDL_Surface* surface); 34 inline bool hasAlpha(void) {return bAlpha;} 32 35 33 36 bool loadImage(const char* imageName); -
orxonox/trunk/src/lib/math/vector.cc
r3860 r3966 100 100 */ 101 101 102 Vector *Vector::getNormalized()102 Vector Vector::getNormalized() 103 103 { 104 104 float l = len(); 105 105 if(unlikely(l != 1.0)) 106 106 { 107 return this;107 return *this; 108 108 } 109 109 else if(unlikely(l == 0.0)) 110 110 { 111 return 0;111 return *this; 112 112 } 113 113 114 return new Vector(x / l, y /l, z / l);114 return *this / l; 115 115 } 116 116 … … 172 172 \brief Outputs the values of the Vector 173 173 */ 174 void Vector::debug(void) 174 void Vector::debug(void) const 175 175 { 176 176 PRINT(0)("Vector Debug information\n"); … … 438 438 \param to to where 439 439 \param t the time this transformation should take 440 \param res The approximation-density 441 */ 442 void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res) 440 441 \returns the Result of the smooth move 442 */ 443 Quaternion Quaternion::quatSlerp(const Quaternion& from, const Quaternion& to, float t) 443 444 { 444 445 float tol[4]; … … 446 447 DELTA = 0.2; 447 448 448 cosom = from ->v.x * to->v.x + from->v.y * to->v.y + from->v.z * to->v.z + from->w * to->w;449 cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w; 449 450 450 451 if( cosom < 0.0 ) 451 452 { 452 453 cosom = -cosom; 453 tol[0] = -to ->v.x;454 tol[1] = -to ->v.y;455 tol[2] = -to ->v.z;456 tol[3] = -to ->w;454 tol[0] = -to.v.x; 455 tol[1] = -to.v.y; 456 tol[2] = -to.v.z; 457 tol[3] = -to.w; 457 458 } 458 459 else 459 460 { 460 tol[0] = to ->v.x;461 tol[1] = to ->v.y;462 tol[2] = to ->v.z;463 tol[3] = to ->w;461 tol[0] = to.v.x; 462 tol[1] = to.v.y; 463 tol[2] = to.v.z; 464 tol[3] = to.w; 464 465 } 465 466 466 467 //if( (1.0 - cosom) > DELTA ) 467 468 //{ 468 469 470 471 472 473 474 else469 omega = acos(cosom); 470 sinom = sin(omega); 471 scale0 = sin((1.0 - t) * omega) / sinom; 472 scale1 = sin(t * omega) / sinom; 473 //} 474 /* 475 else 475 476 { 476 477 477 scale0 = 1.0 - t; 478 scale1 = t; 478 479 } 479 */ 480 res->v.x = scale0 * from->v.x + scale1 * tol[0]; 481 res->v.y = scale0 * from->v.y + scale1 * tol[1]; 482 res->v.z = scale0 * from->v.z + scale1 * tol[2]; 483 res->w = scale0 * from->w + scale1 * tol[3]; 480 */ 481 482 483 /* 484 Quaternion res; 485 res.v.x = scale0 * from.v.x + scale1 * tol[0]; 486 res.v.y = scale0 * from.v.y + scale1 * tol[1]; 487 res.v.z = scale0 * from.v.z + scale1 * tol[2]; 488 res.w = scale0 * from.w + scale1 * tol[3]; 489 */ 490 return Quaternion(scale0 * from.w + scale1 * tol[3], 491 Vector(scale0 * from.v.x + scale1 * tol[0], 492 scale0 * from.v.y + scale1 * tol[1], 493 scale0 * from.v.z + scale1 * tol[2])); 484 494 } 485 495 -
orxonox/trunk/src/lib/math/vector.h
r3860 r3966 31 31 32 32 inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); } 33 inline const Vector& operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;} 33 34 inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); } 35 inline const Vector& operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;} 34 36 inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; } 37 inline const Vector& operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;} 35 38 inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); } 39 inline const Vector& operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;} 36 40 Vector operator/ (float f) const; 41 inline const Vector& operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;} 42 inline const Vector& operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;} 37 43 float dot (const Vector& v) const; 38 inline Vector cross (const Vector& v) const { 44 inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); } 39 45 void scale(const Vector& v); 40 46 inline float len() const { return sqrt (x*x+y*y+z*z); } … … 50 56 z = z / l; 51 57 } 52 Vector *getNormalized();58 Vector getNormalized(); 53 59 Vector abs(); 54 60 55 void debug() ;61 void debug() const; 56 62 }; 57 63 … … 76 82 Quaternion (float roll, float pitch, float yaw); 77 83 Quaternion operator/ (const float& f) const; 84 inline const Quaternion operator/= (const float& f) {*this = *this / f; return *this;} 78 85 Quaternion operator* (const float& f) const; 86 inline const Quaternion operator*= (const float& f) {*this = *this * f; return *this;} 79 87 Quaternion operator* (const Quaternion& q) const; 88 inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this;} 80 89 inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); } 90 inline const Quaternion& operator+= (const Quaternion& q) {this->v += q.v; this->w += q.w; return *this;} 81 91 inline Quaternion operator- (const Quaternion& q) const { return Quaternion(q.v - v, q.w - w); } 92 inline const Quaternion& operator-= (const Quaternion& q) {this->v -= q.v; this->w -= q.w; return *this;} 93 inline Quaternion operator= (const Quaternion& q) {this->v = q.v; this->w = q.w; return *this;} 82 94 Quaternion conjugate () const { Quaternion r(*this); 83 95 r.v = Vector() - r.v; … … 87 99 float norm () const; 88 100 void matrix (float m[4][4]) const; 89 void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);101 Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t); 90 102 91 103 void debug(); -
orxonox/trunk/src/orxonox.cc
r3790 r3966 36 36 37 37 #include <string.h> 38 int verbose = 3;38 int verbose = 4; 39 39 40 40 using namespace std; -
orxonox/trunk/src/track_manager.cc
r3882 r3966 312 312 PNode* tmpNode = (PNode*)node; 313 313 314 if (tmpNode->getRelCoor() ->z < 0)314 if (tmpNode->getRelCoor().z < 0) 315 315 return 0; 316 316 else … … 333 333 PNode* tmpNode = (PNode*)node; 334 334 335 Vector nodeRelCoord = *tmpNode->getRelCoor();335 Vector nodeRelCoord = tmpNode->getRelCoor(); 336 336 float minDist = 100000000; 337 337 int childNumber = 0; -
orxonox/trunk/src/track_node.cc
r3607 r3966 41 41 42 42 43 TrackNode::TrackNode ( Vector*absCoordinate)43 TrackNode::TrackNode (const Vector& absCoordinate) 44 44 { 45 45 this->parent = NullParent::getInstance(); 46 46 this->trackManager = TrackManager::getInstance(); 47 47 this->setMode(PNODE_ALL); 48 this-> absCoordinate = absCoordinate;48 this->setAbsCoor(absCoordinate); 49 49 } 50 50 -
orxonox/trunk/src/track_node.h
r3836 r3966 22 22 public: 23 23 TrackNode (); 24 TrackNode ( Vector*absCoordinate);24 TrackNode (const Vector& absCoordinate); 25 25 26 26 virtual ~TrackNode (); -
orxonox/trunk/src/world_entities/camera.cc
r3869 r3966 139 139 if (tmpFovy > .001) 140 140 this->fovy += (this->toFovy - this->fovy) * dt; 141 Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;141 Vector tmpPos = (this->toRelCoor - this->getRelCoor()) * dt; 142 142 if (tmpPos.len() >= .001) 143 143 { 144 tmpPos = tmpPos + *this->getRelCoor();144 tmpPos = tmpPos + this->getRelCoor(); 145 145 this->setRelCoor(tmpPos); 146 146 } -
orxonox/trunk/src/world_entities/player.cc
r3881 r3966 188 188 //orthDirection = orthDirection.cross (direction); 189 189 190 if( this->bUp && this->getRelCoor() ->x < 20)190 if( this->bUp && this->getRelCoor().x < 20) 191 191 accel = accel+(direction*acceleration); 192 if( this->bDown && this->getRelCoor() ->x > -5)192 if( this->bDown && this->getRelCoor().x > -5) 193 193 accel = accel-(direction*acceleration); 194 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor() ->z*2)194 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2) 195 195 accel = accel - (orthDirection*acceleration); 196 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor() ->z*2)196 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 197 197 accel = accel + (orthDirection*acceleration); 198 198 if( this->bAscend )
Note: See TracChangeset
for help on using the changeset viewer.