/// <summary> /// Blend between two hand poses. /// </summary> public void InterpolateOffsets(ArticulatedHandPose poseA, ArticulatedHandPose poseB, float value) { for (int i = 0; i < jointCount; i++) { var p = Vector3.Lerp(poseA.localJointPoses[i].Position, poseB.localJointPoses[i].Position, value); var r = Quaternion.Slerp(poseA.localJointPoses[i].Rotation, poseB.localJointPoses[i].Rotation, value); localJointPoses[i] = new MixedRealityPose(p, r); } }
private static ArticulatedHandPose LoadGesturePose(GestureId gesture, string filePath) { if (!string.IsNullOrEmpty(filePath)) { var pose = new ArticulatedHandPose(); pose.FromJson(File.ReadAllText(filePath)); handPoses.Add(gesture, pose); return(pose); } return(null); }
/// <summary> /// Copy data from another articulated hand pose. /// </summary> public void Copy(ArticulatedHandPose other) { Array.Copy(other.localJointPoses, localJointPoses, jointCount); }