本文整理汇总了C#中KinectInterop类的典型用法代码示例。如果您正苦于以下问题:C# KinectInterop类的具体用法?C# KinectInterop怎么用?C# KinectInterop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KinectInterop类属于命名空间,在下文中一共展示了KinectInterop类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
{
//GestureInfo.guiText.text = string.Format("{0} Progress: {1:F1}%", gesture, (progress * 100));
// if(gesture == KinectGestures.Gestures.Click && progress > 0.3f)
// {
// string sGestureText = string.Format ("{0} {1:F1}% complete", gesture, progress * 100);
// if(GestureInfo != null)
// GestureInfo.guiText.text = sGestureText;
//
// progressDisplayed = true;
// }
// else
if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
if(GestureInfo != null)
GestureInfo.guiText.text = sGestureText;
progressDisplayed = true;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
if(GestureInfo != null)
GestureInfo.guiText.text = sGestureText;
progressDisplayed = true;
}
}
开发者ID:ly774508966,项目名称:IUILab_Lecture_KinectAndOculusWithUnity3D,代码行数:30,代码来源:SimpleGestureListener.cs
示例2: GestureCompleted
//Virtual override of KinectGestures.GestureListenerInterface.GestureCompleted
//Once completed a gesture propogate the gesture to the GestureNavigationMenu
public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
string sGestureText = gesture + " detected";
if(GestureInfo != null)
{
GestureInfo.text = sGestureText;
}
//depending on which gesture is performed, call the relevant function in the GestureNavigationMenu
switch (gesture) {
case KinectGestures.Gestures.SwipeUp:
menu.SwipeUp();
break;
case KinectGestures.Gestures.SwipeDown:
menu.SwipeDown();
break;
case KinectGestures.Gestures.SwipeLeft:
menu.SwipeLeft();
break;
case KinectGestures.Gestures.SwipeRight:
menu.SwipeRight();
break;
default:
break;
}
progressDisplayed = false;
return true;
}
示例3: GestureCompleted
public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
//string sGestureText = gesture + " detected";
//if(GestureInfo != null)
//{
// GestureInfo.guiText.text = sGestureText;
//}
if (gesture == KinectGestures.Gestures.Squat) {
int num = 0;
Camera.main.transform.SendMessage ("ActionPerformed",num);
}
else if (gesture == KinectGestures.Gestures.Jump) {
Camera.main.transform.SendMessage ("ActionPerformed",1);
}
else if (gesture == KinectGestures.Gestures.Wave) {
Camera.main.transform.SendMessage ("ActionPerformed",2);
}
else if (gesture == KinectGestures.Gestures.RaiseLeftHand) {
Camera.main.transform.SendMessage ("ActionPerformed",3);
}
else if (gesture == KinectGestures.Gestures.RaiseRightHand) {
Camera.main.transform.SendMessage ("ActionPerformed",4);
}
return true;
}
示例4: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
{
if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} {1:F0}%", gesture, screenPos.z * 100f);
if(GestureInfo != null)
{
GestureInfo.GetComponent<GUIText>().text = sGestureText;
}
progressDisplayed = true;
progressGestureTime = Time.realtimeSinceStartup;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} {1:F0} deg.", gesture, screenPos.z);
if(GestureInfo != null)
{
GestureInfo.GetComponent<GUIText>().text = sGestureText;
}
//Debug.Log(sGestureText);
progressDisplayed = true;
progressGestureTime = Time.realtimeSinceStartup;
}
}
示例5: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
{
// the gestures are allowed for the primary user only
KinectManager manager = KinectManager.Instance;
if(!manager || (userId != manager.GetPrimaryUserID()))
return;
// this function is currently needed only to display gesture progress, skip it otherwise
if(gestureInfo == null)
return;
if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} {1:F0}%", gesture, screenPos.z * 100f);
gestureInfo.GetComponent<GUIText>().text = sGestureText;
progressDisplayed = true;
progressGestureTime = Time.realtimeSinceStartup;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} {1:F0} degrees", gesture, screenPos.z);
gestureInfo.GetComponent<GUIText>().text = sGestureText;
//Debug.Log(sGestureText);
progressDisplayed = true;
progressGestureTime = Time.realtimeSinceStartup;
}
}
示例6: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
{
// the gestures are allowed for the primary user only
KinectManager manager = KinectManager.Instance;
if(!manager || (userId != manager.GetPrimaryUserID()))
return;
if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
if(GestureInfo != null)
{
GestureInfo.GetComponent<GUIText>().text = sGestureText;
}
//Debug.Log(sGestureText);
progressDisplayed = true;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
if(GestureInfo != null)
{
GestureInfo.GetComponent<GUIText>().text = sGestureText;
}
//Debug.Log(sGestureText);
progressDisplayed = true;
}
}
示例7: Init
// Initialize the filter with a set of TransformSmoothParameters.
public void Init(KinectInterop.SmoothParameters smoothParameters)
{
this.smoothParameters = smoothParameters;
this.Reset();
this.init = true;
}
示例8: GestureCancelled
/// <summary>
/// Invoked if a gesture is cancelled.
/// </summary>
/// <returns>true</returns>
/// <c>false</c>
/// <param name="userId">User ID</param>
/// <param name="userIndex">User index</param>
/// <param name="gesture">Gesture type</param>
/// <param name="joint">Joint type</param>
public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint)
{
// the gestures are allowed for the primary user only
KinectManager manager = KinectManager.Instance;
if(!manager || (userId != manager.GetPrimaryUserID()))
return false;
if(gesture == KinectGestures.Gestures.LeanLeft)
{
leanLeft = false;
}
else if(gesture == KinectGestures.Gestures.LeanRight)
{
leanRight = false;
}
else if(gesture == KinectGestures.Gestures.Wheel)
{
wheel = false;
}
if(gestureInfo != null && progressDisplayed)
{
progressDisplayed = false;
gestureInfo.GetComponent<GUIText>().text = "Lean-left, Lean-right to rotate the Room.";
}
return true;
}
示例9: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, KinectInterop.JointType joint, Vector3 screenPos)
{
/*if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
if(GestureInfo != null)
{
GestureInfo.text = sGestureText;
}
//Debug.Log(sGestureText);
progressDisplayed = true;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
if(GestureInfo != null)
{
GestureInfo.text = sGestureText;
}
//Debug.Log(sGestureText);
progressDisplayed = true;
}*/
}
示例10: GestureCompleted
public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
if (activeGestures.ContainsKey(userId))
activeGestures[userId].Enqueue(gesture);
return true;
// this true return will clear the gesture info, because once we've completed one gesture,
// we assume that any others started at the same time were actually just misinterpretations.
}
示例11: GestureCompleted
//KinectGestures.GestureListenerInterface virtual implementation
public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
string sGestureText = gesture + " detected";
//Propogate the recognised gesture to the cursor controller
if(cursor!=null)cursor.WaveRecognised();
if(cursorDirect!=null)cursorDirect.WaveRecognised();
return true;
}
示例12: GestureCancelled
public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint)
{
// the gestures are allowed for the primary user only
KinectManager manager = KinectManager.Instance;
if(!manager || (userId != manager.GetPrimaryUserID()))
return false;
// don't do anything here, just reset the gesture state
return true;
}
示例13: CloseSensor
public void CloseSensor(KinectInterop.SensorData sensorData)
{
if(coordMapper != null)
{
coordMapper = null;
}
if(bodyFrameReader != null)
{
bodyFrameReader.Dispose();
bodyFrameReader = null;
}
if(bodyIndexFrameReader != null)
{
bodyIndexFrameReader.Dispose();
bodyIndexFrameReader = null;
}
if(colorFrameReader != null)
{
colorFrameReader.Dispose();
colorFrameReader = null;
}
if(depthFrameReader != null)
{
depthFrameReader.Dispose();
depthFrameReader = null;
}
if(infraredFrameReader != null)
{
infraredFrameReader.Dispose();
infraredFrameReader = null;
}
if(multiSourceFrameReader != null)
{
multiSourceFrameReader.Dispose();
multiSourceFrameReader = null;
}
if(kinectSensor != null)
{
if (kinectSensor.IsOpen)
{
kinectSensor.Close();
}
kinectSensor = null;
}
}
示例14: GestureCompleted
public bool GestureCompleted (long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
string sGestureText = gesture + " detected";
// if(gesture == KinectGestures.Gestures.Click)
// sGestureText += string.Format(" at ({0:F1}, {1:F1})", screenPos.x, screenPos.y);
if(GestureInfo != null)
GestureInfo.guiText.text = sGestureText;
progressDisplayed = false;
return true;
}
开发者ID:ly774508966,项目名称:IUILab_Lecture_KinectAndOculusWithUnity3D,代码行数:14,代码来源:SimpleGestureListener.cs
示例15: GestureCompleted
public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture,
KinectInterop.JointType joint, Vector3 screenPos)
{
string sGestureText = gesture + " detected";
if(GestureInfo != null)
{
GestureInfo.guiText.text = sGestureText;
}
progressDisplayed = false;
return true;
}