/// <summary> /// Serialize pose data to JSON format. /// </summary> public string ToJson() { var record = new RecordedHandJoints { Joints = new RecordedHandJoint[LocalJointPoses.Length] }; for (int i = 0; i < LocalJointPoses.Length; i++) { record.Joints[i] = new RecordedHandJoint((TrackedHandJoint)i, LocalJointPoses[i]); } return(JsonUtility.ToJson(record)); }
/// <inheritdoc /> public void OnInputChanged(InputEventData <HandData> eventData) { if (targetHandedness != eventData.Handedness) { return; } for (int i = 0; i < HandData.JointCount; i++) { jointPoses[i] = new RecordedHandJoint((TrackedHandJoint)i, eventData.InputData.Joints[i]); } recordedHandJoints.Joints = jointPoses; currentRecording = recordedHandJoints; }