本文整理汇总了C#中Windows.Kinect.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Windows.Kinect.ToString方法的具体用法?C# Windows.Kinect.ToString怎么用?C# Windows.Kinect.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.Kinect
的用法示例。
在下文中一共展示了Windows.Kinect.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RotateBone
private void RotateBone(GameObject bodyObject, Kinect.JointType startBone, Kinect.JointType endBone)
{
GameObject avatarJoint = GameObject.FindGameObjectsWithTag (startBone.ToString ()) [0];
Transform jointObj = bodyObject.transform.FindChild (startBone.ToString ());
Transform targetJointObj = bodyObject.transform.FindChild (endBone.ToString ());
Quaternion avatarRotaion = Quaternion.LookRotation ((targetJointObj.transform.position - jointObj.transform.position).normalized);
avatarJoint.transform.rotation = Quaternion.Slerp (avatarJoint.transform.rotation, avatarRotaion, Time.deltaTime * 2000);
avatarJoint.transform.Rotate (new Vector3 (90, 0, 0));
}
示例2: addBone
private GameObject addBone(string name, float radius, GameObject prefab, Transform body, Kinect.JointType joint1, Kinect.JointType? joint2 = null)
{
GameObject bone = (GameObject) Instantiate(prefab, Vector3.zero, Quaternion.identity);
bone.name = name; bone.transform.parent = body;
BoneScript script = bone.GetComponent("BoneScript") as BoneScript;
script.radius = radius;
script.joint1 = body.FindChild (joint1.ToString ()).gameObject;
if (joint2 != null)
script.joint2 = body.FindChild (((Kinect.JointType) joint2).ToString ()).gameObject;
else if (_BoneMap.ContainsKey (joint1))
script.joint2 = body.FindChild (_BoneMap [joint1].ToString ()).gameObject;
else
Debug.LogError ("BAD JOINT: " + joint1);
return bone;
}
示例3: GetHandRay
public Ray GetHandRay(Kinect.JointType hand)
{
if (hand == Kinect.JointType.HandLeft)
return GetHandRay(Kinect.JointType.ElbowLeft, Kinect.JointType.HandLeft);
else if (hand == Kinect.JointType.HandRight)
return GetHandRay(Kinect.JointType.ElbowRight, Kinect.JointType.HandRight);
else
{
Debug.LogError("Error: GetHandRay Method only takes HandLeft and HandRight. Got: " + hand.ToString());
return GetHandRay(Kinect.JointType.ElbowRight, Kinect.JointType.HandRight);
}
}