mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
CAI_Utility::DrawAIScriptNetwork: light cleanup
This commit is contained in:
parent
62f0e2aaf0
commit
b5b56c83ea
@ -88,11 +88,11 @@ void CAI_Utility::DrawAIScriptNetwork(const CAI_Network* pNetwork) const
|
|||||||
// Purpose: draw NavMesh BVTree
|
// Purpose: draw NavMesh BVTree
|
||||||
// Input : *pMesh -
|
// Input : *pMesh -
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void CAI_Utility::DrawNavMeshBVTree(dtNavMesh* pNavMesh) const
|
void CAI_Utility::DrawNavMeshBVTree(dtNavMesh* pMesh) const
|
||||||
{
|
{
|
||||||
if (!pNavMesh)
|
if (!pMesh)
|
||||||
pNavMesh = GetNavMeshForHull(navmesh_debug_type->GetInt());
|
pMesh = GetNavMeshForHull(navmesh_debug_type->GetInt());
|
||||||
if (!pNavMesh)
|
if (!pMesh)
|
||||||
return; // NavMesh for hull not loaded.
|
return; // NavMesh for hull not loaded.
|
||||||
|
|
||||||
const Vector3D vCamera = MainViewOrigin();
|
const Vector3D vCamera = MainViewOrigin();
|
||||||
@ -101,12 +101,12 @@ void CAI_Utility::DrawNavMeshBVTree(dtNavMesh* pNavMesh) const
|
|||||||
const float flCameraRange = navmesh_debug_camera_range->GetFloat();
|
const float flCameraRange = navmesh_debug_camera_range->GetFloat();
|
||||||
|
|
||||||
OverlayBox_t::Transforms vTransforms;
|
OverlayBox_t::Transforms vTransforms;
|
||||||
for (int i = navmesh_draw_bvtree->GetInt(), nt = pNavMesh->getTileCount(); i < nt; ++i)
|
for (int i = navmesh_draw_bvtree->GetInt(), nt = pMesh->getTileCount(); i < nt; ++i)
|
||||||
{
|
{
|
||||||
if (nTileRange > 0 && i > nTileRange)
|
if (nTileRange > 0 && i > nTileRange)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const dtMeshTile* pTile = &pNavMesh->m_tiles[i];
|
const dtMeshTile* pTile = &pMesh->m_tiles[i];
|
||||||
if (!pTile->header)
|
if (!pTile->header)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -136,9 +136,9 @@ void CAI_Utility::DrawNavMeshBVTree(dtNavMesh* pNavMesh) const
|
|||||||
vTransforms.xmm[2] = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f);
|
vTransforms.xmm[2] = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
// Parallel Vector3D construction.
|
// Parallel Vector3D construction.
|
||||||
const __m128 xMins = _mm_add_ps(xTileAABB, _mm_mul_ps( // Formula: tile->header->bmin[axis] + node->bmin[axis] * cs;
|
const __m128 xMins = _mm_add_ps(xTileAABB, _mm_mul_ps( // Formula: tile->header->bmin[axis]+node->bmin[axis]*cs;
|
||||||
_mm_setr_ps(pNode->bmin[0], pNode->bmin[1], pNode->bmin[2], 0.0f), xCellSize));
|
_mm_setr_ps(pNode->bmin[0], pNode->bmin[1], pNode->bmin[2], 0.0f), xCellSize));
|
||||||
const __m128 xMaxs = _mm_add_ps(xTileAABB, _mm_mul_ps( // Formula: tile->header->bmax[axis] + node->bmax[axis] * cs;
|
const __m128 xMaxs = _mm_add_ps(xTileAABB, _mm_mul_ps( // Formula: tile->header->bmax[axis]+node->bmax[axis]*cs;
|
||||||
_mm_setr_ps(pNode->bmax[0], pNode->bmax[1], pNode->bmax[2], 0.0f), xCellSize));
|
_mm_setr_ps(pNode->bmax[0], pNode->bmax[1], pNode->bmax[2], 0.0f), xCellSize));
|
||||||
|
|
||||||
v_RenderBox(vTransforms, *reinterpret_cast<const Vector3D*>(&xMins), *reinterpret_cast<const Vector3D*>(&xMaxs),
|
v_RenderBox(vTransforms, *reinterpret_cast<const Vector3D*>(&xMins), *reinterpret_cast<const Vector3D*>(&xMaxs),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user