Graphics.SetUpAControlNode - lordmundi/wikidoctest GitHub Wiki
Set Up a Control Node
« Example Driving of Planets with Recorded Data | EDGE User’s Guide | Defining Camera Lenses »
On this page… (hide)
-
2. Types
-
3. Usage
-
DSP_CONFIG { DATA { SCENE_LOAD { CONTROLS { # node(name); control(name); control_xyz(x,y,z); control_pyr(p,y,r); xyz(x,y,z); pyr(p,y,r); order( PYR ); parent( node_name ); attrib(INHIBIT_CONTROL);
# Examples node(PROX_OPS); control_xyz(621.0,0,978.5); control_pyr(-90,0,0); control(NODE1_PAS); parent(ORBITER_STRUCTURE); node(EV1_SIGNAL); control(EV1_antenna); parent(ORBITER_STRUCTURE); node(EV2_SIGNAL); control(EV2_antenna); parent(ORBITER_STRUCTURE); }
...
1. What is a control node?
Control nodes are nodes that can be used to have node information output in a different frame, OR allow nodes to be driven in a different frame.
2. Types
There are two types of control nodes: passive and active.
- Passive control nodes are simply an alias for the node in a different frame and are output only
- Active control nodes drive a node in the NULL frame using numbers that are auto-calculated from input numbers in the control node in its own frame
3. Usage
- control field is the node being controlled (active control) or monitored (passive control)
- control node is active (not passive) only if the node it controls has a parent of NULL Note: If the control node's parent is erroneously set to NULL at startup, you can add 'attrib(INHIBIT_CONTROL);' to the node being controlled to make sure it will not be driven.
For example, if the user wanted to add a frame to see the position of node A in the frame of node C even though node A is actually linked to some other node then the user could define a control node B that controls node A in the frame of node C. A user would then be able to monitor node B which would be updated to reflect the position of node A relative to node C in real time as long as node A has a non-NULL parent, if the parent of node A is/becomes NULL then node A will be automatically driven in the NULL frame as if it where a child of node B in the frame of node C.
CONTROLS
{
node(B); control(A); parent(C);
}
Since node A has a parent that is non-NULL (presumably), then this control node would be a passive control node and would be for output data only (a monitor node so to speak).
But, if node A has it's parent changed to NULL, the control node would become active, making it as if node A was now a child of node B with zero offset. If you want to have an offset between controllee and control node, then you can use the control_xyz and control_pyr parameters shown above.
The active control node allows the user to drive a node in a different frame, rather than just see the data. Meaning, instead of the data in the control node being output by the visuals (in the cae of a passive control node), the control node would now accept input data to drive the controllee in the control nodes frame.
4. Advanced stuff
-
if multiple control nodes are defined for a single node, then the last one defined will, by default, be the active one
-
to change the active control node during runtime, the user can set the parent of the node being controlled to the new control node. EDGE will see the new parent is a control node, change it to be the active, and then relink the node back to NULL automatically.
-
The algorithm to figure out the source of the transform to be used in the visuals is below
normal node dependency_is : parent
modified controllee dependency_is : parent if( parent is one of its passive controllers ) parent_becomes : passive_control passive_contorl becomes active controller if( INHIBIT_CONTROL_ATTRIB not set ) parent_becomes : null non-modified controllee if( INHIBIT_CONTROL_ATTRIB not set ) dependency_is : active_control_node else dependency_is : parent active control with modified controllee dependency_is : controllee active control with non-modified controllee if( INHIBIT_CONTROL_ATTRIB not set ) dependency_is : parent else dependency_is : controlee passive control dependency_is : controlee Use the above rules to build a dependency array (secondary parent_id)
« Example Driving of Planets with Recorded Data | EDGE User’s Guide | Defining Camera Lenses »