[add] Describe #ifdef _Debug

This commit is contained in:
kimnuri
2025-11-24 14:24:41 +09:00
parent 17e5946279
commit 8ed467f8cc
46 changed files with 204 additions and 80 deletions
+26 -24
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Navigation.h"
#include "Cell.h"
@@ -68,48 +68,48 @@ HRESULT CNavigation::isMove(_fvector vCurrentPos, _vector vCurrentDir, _vector&
return S_OK;
}
// iCrossCount > 0 이므로
// 슬라이딩 혹은 이웃찾기 혹은 블록
// iCrossCount > 0 이므로
// 슬라이딩 혹은 이웃찾기 혹은 블록
_uint iCrossedNeighborCount = 0;
_int iBlockedLine = -1;
_int iCrossedNeighbor = -1;
{
_int iTempNeighbor = -1;
for (int i = 0; i < 3; ++i) {
if (fOuts[i] < 0.f) { // 선분에 가로막혔는데
if (fOuts[i] < 0.f) { // 선분에 가로막혔는데
iTempNeighbor = (*m_pCells)[m_iCurrentCellIndex]->Get_Neighbor((NAVI_LINE)i);
if (-1 != iTempNeighbor) { // 이웃으로 향하는 길 이면
if (-1 != iTempNeighbor) { // 이웃으로 향하는 길 이면
iCrossedNeighborCount++;
iCrossedNeighbor = iTempNeighbor;
}
else {
iBlockedLine = i; // 진짜 막힌 길이면 저장
iBlockedLine = i; // 진짜 막힌 길이면 저장
}
}
}
}
// 10 11
// 20 21 22
if (iCrossCount == iCrossedNeighborCount) // 가로막혔던 길이 모두 이웃이 있는 길이었으면
if (iCrossCount == iCrossedNeighborCount) // 가로막혔던 길이 모두 이웃이 있는 길이었으면
{
m_iCurrentCellIndex = iCrossedNeighbor; // 아무 방향으로나
m_iCurrentCellIndex = iCrossedNeighbor; // 아무 방향으로나
vCorrectOut = XMVector3TransformNormal(vCurrentDirection, XMLoadFloat4x4(&s_WorldMatrix));
return S_OK; // 이동
return S_OK; // 이동
}
// 10
// 20 21
if (iCrossCount > iCrossedNeighborCount) // 가로막혔던 길 중 이웃으로 향하는 길이 더 적다면
if (iCrossCount > iCrossedNeighborCount) // 가로막혔던 길 중 이웃으로 향하는 길이 더 적다면
{
if (iCrossCount == 2 && iCrossedNeighborCount == 0) {// 가로막혔던 길이 둘 다 막힌 길이었으면 이동불가능
if (iCrossCount == 2 && iCrossedNeighborCount == 0) {// 가로막혔던 길이 둘 다 막힌 길이었으면 이동불가능
return E_FAIL;
}
// 10
// 21
// 막힌 길로 슬라이딩 타면 됨
// 막힌 길로 슬라이딩 타면 됨
// 슬라이딩 벡터
// 슬라이딩 벡터
_vector vNeighborNormal = -XMLoadFloat3(pCell->Get_Normarl((NAVI_LINE)iBlockedLine));
vCurrentDirection = vCurrentDirection - XMVector3Dot(vCurrentDirection, vNeighborNormal) * vNeighborNormal;
if (iCrossedNeighborCount == 0) {
@@ -124,7 +124,7 @@ HRESULT CNavigation::isMove(_fvector vCurrentPos, _vector vCurrentDir, _vector&
if (SUCCEEDED((*m_pCells)[iCrossedNeighbor]->isIn(vEstimatedDestination, fOuts, iCrossCount))) {
m_iCurrentCellIndex = iCrossedNeighbor;
}
else { // K 자 네비도트가 있을 때 아래 삼각형에서 바로 윗삼각형으로 갔을 경우임
else { // K 자 네비도트가 있을 때 아래 삼각형에서 바로 윗삼각형으로 갔을 경우임
int iFoundCell = Find_Cell_ByPosition(vEstimatedDestination, m_iCurrentCellIndex, 5);
if (iFoundCell >= 0)
@@ -135,7 +135,7 @@ HRESULT CNavigation::isMove(_fvector vCurrentPos, _vector vCurrentDir, _vector&
}
else
{
return E_FAIL; // 완전히 네비 밖
return E_FAIL; // 완전히 네비 밖
}
}
}
@@ -143,8 +143,8 @@ HRESULT CNavigation::isMove(_fvector vCurrentPos, _vector vCurrentDir, _vector&
}
else {
assert(false);
// 불가능,
// 경우의 수가 없음
// 불가능,
// 경우의 수가 없음
}
return S_OK;
}
@@ -162,32 +162,32 @@ HRESULT CNavigation::Get_NearCell(_fvector vCurrentPos, _int& iDestCell)
return S_OK;
}
// iCrossCount > 0 이므로
// 슬라이딩 혹은 이웃찾기 혹은 블록
// iCrossCount > 0 이므로
// 슬라이딩 혹은 이웃찾기 혹은 블록
_uint iCrossedNeighborCount = 0;
_int iBlockedLine = -1;
_int iCrossedNeighbor = -1;
{
_int iTempNeighbor = -1;
for (int i = 0; i < 3; ++i) {
if (fOuts[i] < 0.f) { // 선분에 가로막혔는데
if (fOuts[i] < 0.f) { // 선분에 가로막혔는데
iTempNeighbor = (*m_pCells)[m_iCurrentCellIndex]->Get_Neighbor((NAVI_LINE)i);
if (-1 != iTempNeighbor) { // 이웃으로 향하는 길 이면
if (-1 != iTempNeighbor) { // 이웃으로 향하는 길 이면
iCrossedNeighborCount++;
iCrossedNeighbor = iTempNeighbor;
}
else {
iBlockedLine = i; // 진짜 막힌 길이면 저장
iBlockedLine = i; // 진짜 막힌 길이면 저장
}
}
}
}
// 10 11
// 20 21 22
if (iCrossCount == iCrossedNeighborCount) // 가로막혔던 길이 모두 이웃이 있는 길이었으면
if (iCrossCount == iCrossedNeighborCount) // 가로막혔던 길이 모두 이웃이 있는 길이었으면
{
iDestCell = iCrossedNeighbor;
return S_OK; // 이동
return S_OK; // 이동
}
return E_FAIL;
}
@@ -362,7 +362,9 @@ void CNavigation::Free()
}
}
}
#ifdef _DEBUG
void CNavigation::Describe_Entity()
{
}
#endif // _DEBUG