Skip to content

Commit

Permalink
Implemented aiPath functions
Browse files Browse the repository at this point in the history
* Implement aiPath Functions

* Update aiPath.cpp
  • Loading branch information
KcRobin9 authored May 31, 2024
1 parent ee891fd commit 4121625
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions code/midtown/mmai/aiPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ define_dummy_symbol(mmai_aiPath);

#include "aiIntersection.h"

Vector3* aiPath::CenterVertice(i32 index)
{
if (index >= 0 && index < VertexCount)
return &CenterVerts[index];

Warningf("Returning a NULL CenterVertice vector.");
Warningf("Bad Idx: %d, Path Id: %d", index, Id);
return 0;
}

void aiPath::Dump()
{
Displayf("Path %d, Vertex Count = %d, Num Lanes = %d", Id, VertexCount, NumLanes);
Expand All @@ -44,3 +54,23 @@ void aiPath::Dump()
Displayf("\t\tEnd = %.2f, %.2f, %.2f", end.x, end.y, end.z);
}
}

Vector3* aiPath::VertXDir(i32 index)
{
if (index >= 0 && index < VertexCount)
return &VertXDirs[index];

Warningf("Returning a NULL VertXDir vector.");
Warningf("Bad Idx: %d, Path Id: %d", index, Id);
return 0;
}

Vector3* aiPath::VertZDir(i32 index)
{
if (index >= 0 && index < VertexCount)
return &VertZDirs[index];

Warningf("Returning a NULL VertZDir vector.");
Warningf("Bad Idx: %d, Path Id: %d", index, Id);
return 0;
}
6 changes: 3 additions & 3 deletions code/midtown/mmai/aiPath.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class aiPath
ARTS_IMPORT void CenterPosition(f32 arg1, Vector3& arg2);

// ?CenterVertice@aiPath@@QAEPAVVector3@@H@Z | inline
ARTS_IMPORT Vector3* CenterVertice(i32 arg1);
ARTS_EXPORT Vector3* CenterVertice(i32 index);

// ?ContinuityError@aiPath@@QAEHH@Z | unused
ARTS_IMPORT i32 ContinuityError(i32 arg1);
Expand Down Expand Up @@ -235,10 +235,10 @@ class aiPath
ARTS_IMPORT void UpdatePedestrians();

// ?VertXDir@aiPath@@QAEPAVVector3@@H@Z | inline
ARTS_IMPORT Vector3* VertXDir(i32 arg1);
ARTS_EXPORT Vector3* VertXDir(i32 index);

// ?VertZDir@aiPath@@QAEPAVVector3@@H@Z | inline
ARTS_IMPORT Vector3* VertZDir(i32 arg1);
ARTS_EXPORT Vector3* VertZDir(i32 index);

aiPath* OncomingPath;
i32 EdgeIndex;
Expand Down

0 comments on commit 4121625

Please sign in to comment.