18#include "../AI/BehaviorTree.h"
55 class BTGraphLayoutEngine
83 float nodeSpacingX = 320.0f,
84 float nodeSpacingY = 180.0f,
85 float zoomFactor = 1.0f
122 std::vector<std::vector<uint32_t>>
m_layers;
123 std::map<uint32_t, std::vector<uint32_t>>
m_parentMap;
ComponentTypeID GetComponentTypeID_Static()
bool UpdateNodePosition(uint32_t nodeId, float x, float y)
Update the stored position for a node (e.g.
const BTNodeLayout * GetNodeLayout(uint32_t nodeId) const
Get computed layout for a specific node.
std::vector< BTNodeLayout > m_layouts
std::vector< uint32_t > GetChildren(const BTNode *node) const
void BuildParentMap(const BehaviorTreeAsset *tree)
void SetLayoutDirection(BTLayoutDirection direction)
Set layout direction.
BTLayoutDirection GetLayoutDirection() const
Get current layout direction.
BTLayoutDirection m_layoutDirection
Default vertical.
std::map< uint32_t, size_t > m_nodeIdToIndex
std::map< uint32_t, std::vector< uint32_t > > m_parentMap
~BTGraphLayoutEngine()=default
void AssignLayers(const BehaviorTreeAsset *tree)
std::vector< BTNodeLayout > ComputeLayout(const BehaviorTreeAsset *tree, float nodeSpacingX=320.0f, float nodeSpacingY=180.0f, float zoomFactor=1.0f)
Compute layout for a behavior tree.
std::vector< std::vector< uint32_t > > m_layers
< Provides AssetID and INVALID_ASSET_ID
BTLayoutDirection
Layout direction for behavior tree visualization.
@ LeftToRight
Horizontal left-to-right layout.
@ TopToBottom
Traditional top-down layout (vertical)
Represents a single node in a behavior tree.
Layout information for a single behavior tree node.
int orderInLayer
Order within the layer.
Vector position
Final position (x, y)
float height
Node visual height (increased for readability)
uint32_t nodeId
BT node ID.
int layer
Hierarchical layer (0 = root)
float width
Node visual width (increased for readability)