| 471 | } |
| 472 | |
| 473 | void PH_DBG_Render() |
| 474 | { |
| 475 | if (ph_dbg_draw_mask.test(phDbgDrawZDisable)) |
| 476 | CHK_DX(HW.pDevice->SetRenderState(D3DRS_ZENABLE, 0)); |
| 477 | HUD().Font().pFontStat->OutSet(550, 250); |
| 478 | |
| 479 | if (ph_dbg_draw_mask.test(phDbgDrawEnabledAABBS)) |
| 480 | { |
| 481 | PHOBJ_DBG_I i, e; |
| 482 | if (!draw_frame) |
| 483 | { |
| 484 | i = dbg_draw_objects0.begin(); |
| 485 | e = dbg_draw_objects0.end(); |
| 486 | } |
| 487 | else |
| 488 | { |
| 489 | i = dbg_draw_objects1.begin(); |
| 490 | e = dbg_draw_objects1.end(); |
| 491 | } |
| 492 | for (; e != i; ++i) |
| 493 | { |
| 494 | SPHObjDBGDraw& ds = *i; |
| 495 | Level().debug_renderer().draw_aabb(ds.AABB_center, ds.AABB.x, ds.AABB.y, ds.AABB.z, D3DCOLOR_XRGB(255, 0, 0)); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | DBG_PHAbstructRender(); |
| 500 | |
| 501 | #ifdef DRAW_CONTACTS |
| 502 | |
| 503 | if (ph_dbg_draw_mask.test(phDbgDrawContacts)) |
| 504 | { |
| 505 | CONTACT_I i, e; |
| 506 | if (!draw_frame) |
| 507 | { |
| 508 | i = Contacts0.begin(); |
| 509 | e = Contacts0.end(); |
| 510 | } |
| 511 | else |
| 512 | { |
| 513 | i = Contacts1.begin(); |
| 514 | e = Contacts1.end(); |
| 515 | } |
| 516 | |
| 517 | for (; i != e; i++) |
| 518 | { |
| 519 | SPHContactDBGDraw& c = *i; |
| 520 | bool is_cyl = c.geomClass == dCylinderClassUser; |
| 521 | Level().debug_renderer().draw_aabb(c.pos, .01f, .01f, .01f, D3DCOLOR_XRGB(255 * is_cyl, 0, 255 * !is_cyl)); |
| 522 | Fvector dir; |
| 523 | dir.set(c.norm); |
| 524 | dir.mul(c.depth * 100.f); |
| 525 | dir.add(c.pos); |
| 526 | Level().debug_renderer().draw_line(Fidentity, c.pos, dir, D3DCOLOR_XRGB(255 * is_cyl, 0, 255 * !is_cyl)); |
| 527 | } |
| 528 | } |
| 529 | // HUD().Font().pFontStat->OutNext("---------------------"); |
| 530 | #endif |