MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetBoxCenter

Function GetBoxCenter

TombEngine/Game/control/box.cpp:135–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135static Vector3 GetBoxCenter(int boxIndex)
136{
137 if (boxIndex <= NO_VALUE || boxIndex >= g_Level.PathfindingBoxes.size())
138 return Vector3::Zero;
139
140 auto& currBox = g_Level.PathfindingBoxes[boxIndex];
141
142 float x = ((float)currBox.left + (float)(currBox.right - currBox.left) / 2.0f) * BLOCK(1);
143 auto y = currBox.height - CLICK(1);
144 float z = ((float)currBox.top + (float)(currBox.bottom - currBox.top) / 2.0f) * BLOCK(1);
145
146 return Vector3(z, y, x);
147}
148
149static void DrawBox(int boxIndex, const Vector3& color)
150{

Callers 3

DrawBoxFunction · 0.85
DrawItemPathfindingFunction · 0.85
SearchLOT_DijkstraAStarFunction · 0.85

Calls 2

Vector3Function · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected