| 367 | static idVec3 *testend; |
| 368 | |
| 369 | void idCollisionModelManagerLocal::DebugOutput( const idVec3 &origin ) { |
| 370 | int i, k; |
| 371 | unsigned int t; |
| 372 | char buf[128]; |
| 373 | idVec3 end; |
| 374 | idAngles boxAngles; |
| 375 | idMat3 modelAxis, boxAxis; |
| 376 | idBounds bounds; |
| 377 | trace_t trace; |
| 378 | |
| 379 | if ( !cm_testCollision.GetBool() ) { |
| 380 | return; |
| 381 | } |
| 382 | |
| 383 | testend = (idVec3 *) Mem_Alloc( cm_testTimes.GetInteger() * sizeof(idVec3) ); |
| 384 | |
| 385 | if ( cm_testReset.GetBool() || ( cm_testWalk.GetBool() && !start.Compare( start ) ) ) { |
| 386 | total_translation = total_rotation = 0; |
| 387 | min_translation = min_rotation = 999999; |
| 388 | max_translation = max_rotation = 0; |
| 389 | num_translation = num_rotation = 0; |
| 390 | cm_testReset.SetBool( false ); |
| 391 | } |
| 392 | |
| 393 | if ( cm_testWalk.GetBool() ) { |
| 394 | start = origin; |
| 395 | cm_testOrigin.SetString( va( "%1.2f %1.2f %1.2f", start[0], start[1], start[2] ) ); |
| 396 | } else { |
| 397 | sscanf( cm_testOrigin.GetString(), "%f %f %f", &start[0], &start[1], &start[2] ); |
| 398 | } |
| 399 | |
| 400 | sscanf( cm_testBox.GetString(), "%f %f %f %f %f %f", &bounds[0][0], &bounds[0][1], &bounds[0][2], |
| 401 | &bounds[1][0], &bounds[1][1], &bounds[1][2] ); |
| 402 | sscanf( cm_testBoxRotation.GetString(), "%f %f %f", &boxAngles[0], &boxAngles[1], &boxAngles[2] ); |
| 403 | boxAxis = boxAngles.ToMat3(); |
| 404 | modelAxis.Identity(); |
| 405 | |
| 406 | idTraceModel itm( bounds ); |
| 407 | idRandom random( 0 ); |
| 408 | idTimer timer; |
| 409 | |
| 410 | if ( cm_testRandomMany.GetBool() ) { |
| 411 | // if many traces in one random direction |
| 412 | for ( i = 0; i < 3; i++ ) { |
| 413 | testend[0][i] = start[i] + random.CRandomFloat() * cm_testLength.GetFloat(); |
| 414 | } |
| 415 | for ( k = 1; k < cm_testTimes.GetInteger(); k++ ) { |
| 416 | testend[k] = testend[0]; |
| 417 | } |
| 418 | } else { |
| 419 | // many traces each in a different random direction |
| 420 | for ( k = 0; k < cm_testTimes.GetInteger(); k++ ) { |
| 421 | for ( i = 0; i < 3; i++ ) { |
| 422 | testend[k][i] = start[i] + random.CRandomFloat() * cm_testLength.GetFloat(); |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 |
no test coverage detected