Changeset 3649 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Mar 24, 2005, 5:13:20 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r3648 r3649 269 269 270 270 271 #include "list.h"272 #include "world_entity.h"273 #include "vector.h"274 #include <asm/msr.h>275 #include <linux/timex.h>276 277 278 #define LIST_MAX 10000279 #define VECTOR_MAX 1000000280 #define ITERATIONS 10000281 271 282 272 /** … … 321 311 } 322 312 313 323 314 int startOrxonox(int argc, char** argv) 324 315 { … … 337 328 338 329 } 330 331 332 #include "list.h" 333 #include "world_entity.h" 334 #include "vector.h" 335 #include "player.h" 336 #include "primitive.h" 337 #include <asm/msr.h> 338 #include <linux/timex.h> 339 340 341 #define LIST_MAX 10000 342 #define VECTOR_MAX 1000000 343 #define ITERATIONS 10000 339 344 340 345 … … 351 356 dt = end - ini; 352 357 353 int type = 0;358 int type = -1; 354 359 /* type -1 == all 355 360 type 0 == framework … … 360 365 { 361 366 /* framework test*/ 367 368 printf("Generating Objects:\n"); 369 /* ************WorldEntity class test************** */ 362 370 WorldEntity* w = NULL; 363 371 int i = 0; … … 371 379 372 380 rdtscl(end); 381 delete w; 373 382 mittel += (end - ini - dt); 374 383 } 375 384 float mi = mittel / (float)ITERATIONS; 376 printf("Generate a WorldEntity objec [cycles]t: \t%f\n", mi); 377 378 385 printf(" Generate a WorldEntity objec [cycles]: \t%f\n", mi); 386 387 mittel = 0; 388 for(i = 0; i < ITERATIONS; ++i) 389 { 390 rdtscl(ini); 391 392 WorldEntity* w = new Primitive(P_SPHERE); 393 394 rdtscl(end); 395 delete w; 396 mittel += (end - ini - dt); 397 } 398 mi = mittel / (float)ITERATIONS; 399 printf(" Generate a Primitive objec [cycles]:\t\t%f\n", mi); 400 401 printf("\nCalling function inline &| virtual\n"); 379 402 mittel = 0; 380 403 w = new WorldEntity(); 404 for(i = 0; i < ITERATIONS; ++i) 405 { 406 rdtscl(ini); 407 408 w->tick(0.0f); 409 410 rdtscl(end); 411 mittel += (end - ini - dt); 412 } 413 //delete w; 414 mi = mittel / (float)ITERATIONS; 415 printf(" virt funct tick() of WE [cycles]: \t\t%f\n", mi); 416 417 418 mittel = 0; 419 WorldEntity wo; 420 for(i = 0; i < ITERATIONS; ++i) 421 { 422 rdtscl(ini); 423 424 wo.tick(0.0f); 425 426 rdtscl(end); 427 mittel += (end - ini - dt); 428 } 429 //delete w; 430 mi = mittel / (float)ITERATIONS; 431 printf(" inl virt funct tick() of WE v2 [cycles]: \t%f\n", mi); 432 433 434 tList<WorldEntity>* list = new tList<WorldEntity>(); 435 436 437 /* ************Primitvie class test************** */ 438 list = new tList<WorldEntity>(); 439 440 441 442 mittel = 0; 443 w = new Primitive(P_SPHERE); 381 444 for(i = 0; i < ITERATIONS; ++i) 382 445 { … … 389 452 } 390 453 mi = mittel / (float)ITERATIONS; 391 printf("Call an empty function of WE [cycles]t: \t%f\n", mi); 392 393 tList<WorldEntity>* list = new tList<WorldEntity>(); 394 395 396 // generating list 397 for(i = 0; i < LIST_MAX; ++i) 398 { 399 w = new WorldEntity(); 400 list->add(w); 401 } 402 403 404 // reuse list 405 w = list->enumerate(); 406 while( w != NULL) 407 { 408 w->tick(0.0f); 409 w = list->nextElement(); 410 } 454 printf("Call function tick() of Prim [cycles]:\t\t%f\n", mi); 455 411 456 412 457 } -
orxonox/trunk/src/world_entities/primitive.cc
r3616 r3649 149 149 \param time in sec 150 150 */ 151 void Primitive::tick (float time)151 inline void Primitive::tick (float time) 152 152 { 153 153 // Vector v(0.0, 0.0, 1.0); … … 159 159 \brief drawing function of the object 160 160 */ 161 void Primitive::draw ()161 inline void Primitive::draw () 162 162 { 163 163 glMatrixMode(GL_MODELVIEW); -
orxonox/trunk/src/world_entities/world_entity.cc
r3608 r3649 170 170 Handle all stuff that should update with time inside this method (movement, animation, etc.) 171 171 */ 172 void WorldEntity::tick(float time)172 inline void WorldEntity::tick(float time) 173 173 { 174 174 } … … 180 180 This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn. 181 181 */ 182 void WorldEntity::draw()182 inline void WorldEntity::draw() 183 183 {} 184 184
Note: See TracChangeset
for help on using the changeset viewer.