Refactor behaviour tree decorators

This commit is contained in:
2024-01-10 21:17:39 +01:00
parent b09f1d4ca9
commit 93b665b290
2 changed files with 163 additions and 115 deletions

View File

@@ -117,6 +117,8 @@ void igVisualizeBTState(const BzBTNode *node, const BzBTNodeState *state, bool s
void igRenderBT(BzBTState *state) {
const BzBTNode *root = state->root;
if (igBegin("BehaviourTree", NULL, 0)) {
igText("NodeState pool: %d", bzObjectPoolGetNumFree(nodeStatePool));
igSeparatorText("");
igVisualizeBTState(root, state->_first, false, 0);
}
igEnd();
@@ -126,6 +128,7 @@ void render(float dt, int *game) {
ClearBackground(WHITE);
BzBTStatus status = bzBTExecute(&agentState, dt);
assert(status != BZ_BT_ERROR);
rlImGuiBegin();
igRenderBT(&agentState);