{"behavior_tree":{"result":"Running","relativeFilePath":"grow_segments.json","parameters":[{"type":"Float","name":"angle","value":[0.0,-1.0,0.0,0.0]},{"type":"Float","name":"targetDistance","value":[100.0,0.0,0.0,0.0]},{"type":"Float","name":"distancePerSecond","value":[60.0,0.0,0.0,0.0]},{"type":"Float","name":"parentI","value":[-1.0,0.0,0.0,0.0]},{"type":"Float","name":"nodeI","value":[-1.0,0.0,0.0,0.0]},{"type":"Float","name":"currentDistance","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"currentSegmentCount","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"segmentCount","value":[1.0,0.0,0.0,0.0]},{"type":"Float","name":"baseAngle","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"newSegmentAngleSpan","value":[20.0,0.0,0.0,0.0]},{"type":"Float","name":"nodeType","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"distanceAcceleration","value":[0.0,0.0,0.0,0.0]}],"rootNode":{"name":"Start","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Repeat","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Create Segment","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Repeat until done","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Extend Segment","position":[0.0,0.0],"type":"Leaf","childTreePath":"","currentChildI":-1,"onStart":"","onUpdate":"currentDistance += dt * distancePerSecond\ncurrentDistance = min(currentDistance, targetDistance)\nStem.setNodeDistance(nodeI, currentDistance)\ndistancePerSecond += dt * distanceAcceleration","onDone":""}],"onStart":"","onUpdate":"","onDone":"if (result == Success && currentDistance < targetDistance) {\n    result = Running\n}"}],"onStart":"angle = random(-1, 1) * newSegmentAngleSpan\nif (currentSegmentCount == 0) {\n    angle += baseAngle\n}\nnodeI = Stem.createNode(parentI, angle)\nStem.setNodeType(nodeI, nodeType)\ncurrentSegmentCount += 1\ncurrentDistance = 0","onUpdate":"","onDone":"parentI = nodeI"}],"onStart":"currentSegmentCount = 0","onUpdate":"","onDone":"if (currentSegmentCount < segmentCount) {\n    result = Running\n}"}],"onStart":"","onUpdate":"","onDone":""}}}