R_CullAliasModel
(entity_t e)
| 458 | * R_CullAliasModel |
| 459 | */ |
| 460 | boolean R_CullAliasModel(entity_t e) { |
| 461 | qfiles.Md2Model paliashdr = (qfiles.Md2Model) currentmodel.extradata; |
| 462 | |
| 463 | if ((e.frame >= paliashdr.num_frames) || (e.frame < 0)) { |
| 464 | Com.Printf(Defines.PRINT_ALL, "R_CullAliasModel " |
| 465 | + currentmodel.name + ": no such frame " + e.frame + '\n'); |
| 466 | e.frame = 0; |
| 467 | } |
| 468 | if ((e.oldframe >= paliashdr.num_frames) || (e.oldframe < 0)) { |
| 469 | Com.Printf(Defines.PRINT_ALL, "R_CullAliasModel " |
| 470 | + currentmodel.name + ": no such oldframe " + e.oldframe |
| 471 | + '\n'); |
| 472 | e.oldframe = 0; |
| 473 | } |
| 474 | |
| 475 | qfiles.Md2Frame pframe = paliashdr.frames[e.frame]; |
| 476 | qfiles.Md2Frame poldframe = paliashdr.frames[e.oldframe]; |
| 477 | |
| 478 | /* |
| 479 | * * compute axially aligned mins and maxs |
| 480 | */ |
| 481 | if (pframe == poldframe) { |
| 482 | for (int i = 0; i < 3; i++) { |
| 483 | mins[i] = pframe.translate[i]; |
| 484 | maxs[i] = mins[i] + pframe.scale[i] * 255; |
| 485 | } |
| 486 | } else { |
| 487 | float thismaxs, oldmaxs; |
| 488 | for (int i = 0; i < 3; i++) { |
| 489 | thismaxs = pframe.translate[i] + pframe.scale[i] * 255; |
| 490 | |
| 491 | oldmaxs = poldframe.translate[i] + poldframe.scale[i] * 255; |
| 492 | |
| 493 | if (pframe.translate[i] < poldframe.translate[i]) |
| 494 | mins[i] = pframe.translate[i]; |
| 495 | else |
| 496 | mins[i] = poldframe.translate[i]; |
| 497 | |
| 498 | if (thismaxs > oldmaxs) |
| 499 | maxs[i] = thismaxs; |
| 500 | else |
| 501 | maxs[i] = oldmaxs; |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | /* |
| 506 | * * compute a full bounding box |
| 507 | */ |
| 508 | float[] tmp; |
| 509 | for (int i = 0; i < 8; i++) { |
| 510 | tmp = bbox[i]; |
| 511 | if ((i & 1) != 0) |
| 512 | tmp[0] = mins[0]; |
| 513 | else |
| 514 | tmp[0] = maxs[0]; |
| 515 | |
| 516 | if ((i & 2) != 0) |
| 517 | tmp[1] = mins[1]; |
no test coverage detected