public FindExistingNode ( NodeType type ) : |
||
type | NodeType | |
리턴 |
public ProductionNode FindExistingNode(NodeType type)
{
IntPtr nodeHandle;
UInt32 status = OpenNIImporter.xnFindExistingNodeByType(this.InternalObject, type, out nodeHandle);
WrapperUtils.CheckStatus(status);
return CreateProductionNodeObject(nodeHandle, type);
}
void Start() { Debug.Log ("Start(): Initializing nodes."); this.context = new Context (SAMPLE_XML_FILE); this.depth = context.FindExistingNode (NodeType.Depth) as DepthGenerator; if (this.depth == null) { Debug.LogError ("Viewer must have a depth node!"); } this.hands = context.FindExistingNode (NodeType.Hands) as HandsGenerator; if (this.hands == null) { Debug.LogError ("Viewer must have a hands node!"); } this.gestures = context.FindExistingNode (NodeType.Gesture) as GestureGenerator; if (this.gestures == null) { Debug.LogError ("Viewer must have a gestures node!"); } this.hands.HandCreate += new HandsGenerator.HandCreateHandler (hands_HandCreate); this.hands.HandUpdate += new HandsGenerator.HandUpdateHandler (hands_HandUpdate); this.hands.HandDestroy += new HandsGenerator.HandDestroyHandler (hands_HandDestroy); this.gestures.AddGesture ("Wave"); this.gestures.AddGesture ("RaiseHand"); this.gestures.GestureRecognized += new GestureGenerator.GestureRecognizedHandler (gestures_GestureRecognized); this.gestures.StartGenerating (); }