public sealed class BehaviorTreeProjectionTurns a behaviour tree into the graph the canvas draws, and back again.
Remarks
⚠ A projection rather than the document itself, and that is doc 37 § D19's decision. The canvas draws a NodeGraph — boxes, ports and wires — and a behaviour tree is a tree with attachments and an ordered child list. Making the document be the canvas's model would mean either teaching the framework about ordered edges and attachments, which neither the shader graph nor the VFX graph nor the compositor has any use for, or teaching the tree to be a dataflow graph, which it is not. So the canvas gets a picture and every edit goes back through BehaviorTreeModel.
Each projected node carries its BehaviorNodeContent in Tag, which is how a click on a box becomes a selection in the document.
Fields and properties (2)
public NodeGraph GraphWhat the canvas shows.
public BehaviorTreeModel? ModelThe tree the last Project drew, so a live pass can ask it about types.
Methods (7)
public NodeGraph Project(BehaviorTreeModel model)Rebuilds the picture from the document.
public GraphNode? BoxOf(BehaviorNodeContent node)The box showing a node, if it is in the picture.
public GraphNode? BoxOf(int index)The box at an execution index, which is what the runtime calls a node.
public int Live(BehaviorTreeInstance? instance)Tints the picture by what an agent is actually doing: the active path, and every node by what it last returned.
public static BehaviorNodeContent? NodeOf(GraphNode box)The node a box is showing.
public Rectangle RectOf(BehaviorNodeContent node, NodeCanvas canvas)Where a node's box is on the canvas, in graph units.
public Rectangle RegionOf(IEnumerable<BehaviorNodeContent> nodes, NodeCanvas canvas, float padding = 12)The rectangle covering a set of nodes, for the abort-scope overlay.
Used by (1)
- BehaviorTreeViewVixen.Editor.AssetEditors