public StateChangedEvent(ProductionNode node, RegisterFunc reg, UnregisterFunc unreg) { this.node = node; this.reg = reg; this.unreg = unreg; this.internalHandler = new OpenNIImporter.XnStateChangedHandler(InternalHandler); }
private static IntPtr Create(Context context, CodecID codecID, ProductionNode initializer) { IntPtr nodeHandle; UInt32 status = OpenNIImporter.xnCreateCodec(context.InternalObject, codecID.InternalValue, initializer.InternalObject, out nodeHandle); WrapperUtils.CheckStatus(status); return nodeHandle; }
public UserPositionCapability(ProductionNode node) : base(node) { this.userPositionChanged = new StateChangedEvent(node, OpenNIImporter.xnRegisterToUserPositionChange, OpenNIImporter.xnUnregisterFromUserPositionChange); }
public CroppingCapability(ProductionNode node) : base(node) { this.croppingChanged = new StateChangedEvent(node, OpenNIImporter.xnRegisterToCroppingChange, OpenNIImporter.xnUnregisterFromCroppingChange); }
public AlternativeViewPointCapability(ProductionNode node) : base(node) { this.viewPointChangedEvent = new StateChangedEvent(node, OpenNIImporter.xnRegisterToViewPointChange, OpenNIImporter.xnUnregisterFromViewPointChange); }
public MirrorCapability(ProductionNode node) : base(node) { this.mirrorChangedEvent = new StateChangedEvent(node, OpenNIImporter.xnRegisterToMirrorChange, OpenNIImporter.xnUnregisterFromMirrorChange); }
void skeletonCapability_CalibrationEnd(ProductionNode node, uint id, bool success) { if (success) { Debug.Log("Calibratoin ended successfully"); skeletonCapability.StartTracking(id); } else { poseDetectionCapability.StartPoseDetection(calibPose, id); } }
return OpenNIImporter.xnIsJointAvailable(this.InternalObject, joint); } public bool IsProfileAvailable(SkeletonProfile profile) { return OpenNIImporter.xnIsProfileAvailable(this.InternalObject, profile); } public void SetSkeletonProfile(SkeletonProfile profile) { UInt32 status = OpenNIImporter.xnSetSkeletonProfile(this.InternalObject, profile);
void hands_HandCreate(ProductionNode node, uint id, ref Point3D position, float fTime) { Debug.Log ("hands_HandCreate(): Here"); float x = position.X; float y = position.Y; float z = position.Z; Debug.Log ("hands_HandUpdate(): Position X: " + x + " Y: " + y + " Z: " + z); Vector3 pos = new Vector3(x * scale, y * scale, -z * scale); bias = pos; }
//-------------------------------- void gestures_GestureRecognized(ProductionNode node, string strGesture, ref Point3D idPosition, ref Point3D endPosition) { Debug.Log ("gestures_GestureRecognized(): Here"); switch (strGesture) { case "Wave": handsGenerator.StartTracking (ref idPosition); break; default: break; } }
void hands_HandUpdate(ProductionNode node, uint id, ref Point3D position, float fTime) { float x = position.X; float y = position.Y; float z = position.Z; // Debug.Log ("hands_HandUpdate(): Position X: " + x + " Y: " + y + " Z: " + z); Vector3 pos = new Vector3(x * scale, y * scale, -z * scale); pos -= bias; // if (pos.z > 0) pos.z = 0; hand.position = pos; }
void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success) { if (success) { this.skeletonCapbility.StartTracking(id); this.joints.Add(id, new Dictionary<SkeletonJoint, SkeletonJointPosition>()); } else { this.poseDetectionCapability.StartPoseDetection(calibPose, id); } }
public ProductionNode GetInstance() { IntPtr handle = OpenNIImporter.xnNodeInfoGetHandle(this.InternalObject); if (handle == IntPtr.Zero) { return(null); } else { return(ProductionNode.FromNative(handle)); } }
void _handGenerator_HandCreate(ProductionNode node, uint id, ref xn.Point3D position, float fTime) { if (_startTime == 0) { _traceHistory = new SortedList<float, xn.Point3D>(); _startTime = fTime; _traceHistory.Add(0, position); _id = id; System.Diagnostics.Debug.WriteLine("Hand created"); } else { _handsGenerator.StopTracking(id); } }
void _handGenerator_HandUpdate(ProductionNode node, uint id, ref xn.Point3D position, float fTime) { if (id == _id) { float timeTracking = fTime - _startTime; _traceHistory.Add(timeTracking, position); CheckStatus(); System.Diagnostics.Debug.WriteLine("Hand update for " + timeTracking); } }
private void UserGenerator_LostUser(ProductionNode node, uint id) { this.playersInOrderOfAppearance.Remove(id); this.OnMessage("Lost player with Id " + id); this.OnUserLost(); }
void userGenerator_NewUser(ProductionNode node, uint id) { App.ViewModel.Status = "Waiting for pose..."; App.ViewModel.User.UserId = id; this.poseDetectionCapability.StartPoseDetection(this.calibPose, id); }
public void AddNodeToRecording(ProductionNode node) { AddNodeToRecording(node, CodecID.Null); }
public UInt32 GetNumFrames(ProductionNode node) { return(GetNumFrames(node.GetName())); }
void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success) { if (success) { App.ViewModel.Status = "Tracking user"; this.skeletonCapbility.StartTracking(id); App.ViewModel.Tracking = true; } else { App.ViewModel.Status = "Waiting for pose..."; this.poseDetectionCapability.StartPoseDetection(calibPose, id); } }
public PoseDetectionCapability(ProductionNode node) : base(node) { this.internalPoseDetected = new OpenNIImporter.XnPoseDetectionCallback(this.InternalPoseDetected); this.internalPoseEnded = new OpenNIImporter.XnPoseDetectionCallback(this.InternalPoseEnded); }
public void SetViewPoint(ProductionNode other) { UInt32 status = OpenNIImporter.xnSetViewPoint(this.InternalObject, other.InternalObject); WrapperUtils.CheckStatus(status); }
public UInt32 TellFrame(ProductionNode node) { return(TellFrame(node.GetName())); }
public void RemoveNeededNode(ProductionNode needed) { UInt32 status = OpenNIImporter.xnRemoveNeededNode(this.InternalObject, needed.InternalObject); WrapperUtils.CheckStatus(status); }
public void AddNodeToRecording(ProductionNode node, CodecID codec) { UInt32 status = OpenNIImporter.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue); WrapperUtils.CheckStatus(status); }
private void UserGenerator_NewUser(ProductionNode node, uint id) { this.playersInOrderOfAppearance.Add(id); this.OnMessage("New player detected and assigned Id " + id); this.OnUserFound(); }
public void RemoveNodeFromRecording(ProductionNode node) { UInt32 status = OpenNIImporter.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject); WrapperUtils.CheckStatus(status); }
public void SeekToFrame(ProductionNode node, Int32 frameOffset, PlayerSeekOrigin origin) { SeekToFrame(node.GetName(), frameOffset, origin); }
private void UserGenerator_NewUser(ProductionNode node, uint id) { }
public Capability(ProductionNode node) : base(node.InternalObject, true) { this.node = node; }
void poseDetectionCapability_PoseDetected(ProductionNode node, string pose, uint id) { App.ViewModel.Status = "Pose detected"; this.poseDetectionCapability.StopPoseDetection(id); this.skeletonCapbility.RequestCalibration(id, true); }
public Codec(Context context, CodecID codecID, ProductionNode initializer) : this(Create(context, codecID, initializer), false) { }
void userGenerator_LostUser(ProductionNode node, uint id) { App.ViewModel.Status = "Lost user."; App.ViewModel.Tracking = false; this.ResetPoints(); }
void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success) { if (success) { this.skeletonCapbility.StartTracking(id); this.joints.Add(id, new Dictionary<SkeletonJoint, SkeletonJointPosition>()); FMessage[0] = "Calibration ended for user " + id.ToString(); } else { this.poseDetectionCapability.StartPoseDetection(calibPose, id); FMessage[0] = "Pose detection for user " + id.ToString(); } }
void poseDetectionCapability_PoseDetected(ProductionNode node, string pose, uint id) { this.poseDetectionCapability.StopPoseDetection(id); this.skeletonCapbility.RequestCalibration(id, true); FMessage[0] = "Pose detected for user: " + id.ToString(); }
void userGenerator_NewUser(ProductionNode node, uint id) { this.poseDetectionCapability.StartPoseDetection(this.calibPose, id); FMessage[0] = "New user: " + id.ToString(); }
void _handsGenerator_GenerationRunningChanged(ProductionNode node) { }
void userGenerator_LostUser(ProductionNode node, uint id) { this.joints.Remove(id); FMessage[0] = "Lost user: " + id.ToString(); }
void _handGenerator_HandDestroy(ProductionNode node, uint id, float fTime) { if (id == _id) { _traceHistory = null; _startTime = 0; _isTracking = false; HandDestroyed(this, EventArgs.Empty); } System.Diagnostics.Debug.WriteLine("Hand destroy"); }
public bool IsViewPointAs(ProductionNode other) { return(OpenNIImporter.xnIsViewPointAs(this.InternalObject, other.InternalObject)); }