github.com/1vanK/Urho3DFlowGraph
I try to make simple analogue Flow Graph (Crayengine) and Blueprints (Unreal engine)
Currently no interface. All FlowNodes created in code. But already exist correct order of execute of FlowNodes and sending data from one flownode to other.
Example do 2 things:
- Control camera by separate FlowNode (see Game.cpp)
flowGraphExample_ = new FlowGraph(context_);
SharedPtr<CameraControllerFlowNode> cameraController(new CameraControllerFlowNode(context_));
// Write data to input ports of flownode. In the final it shoud be doing throught UI in Editor
cameraController->inputs_["CameraNode"]->data_ = (void*)scene_->GetChild("Camera");
cameraController->inputs_["MouseSensitivity"]->data_ = 0.1f;
flowGraphExample_->nodes_.Push(cameraController);
- Creating cube on start demo shows connecting of 2 flounodes.
First flounode (starter) send signal to its output port when first update.
Second flounode (cubeCreator) create cube when has signal on input port.
[code]
// Create first flownode
SharedPtr starter(new StarterFlowNode(context_));
flowGraphExample_->nodes_.Push(starter);
// Second flow node
SharedPtr cubeCreator(new CubeCreatorFlowNode(context_));
// Write scene pointer to input port
cubeCreator->inputs_[“Scene”]->data_ = (void*)scene_;
flowGraphExample_->nodes_.Push(cubeCreator);
// Connection
flowGraphExample_->Connect(starter->outputs_[“Start”], cubeCreator->inputs_[“Create!”]);[/code]
p.s. sorry for russians comments in code