public void UpdateHandPose(ref HandPoseData handPose) { m_poseHandler.GetHumanPose(ref m_humanPose); m_humanPose.bodyPosition = Vector3.zero; m_humanPose.bodyRotation = Quaternion.identity; var i = 0; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle3; m_poseHandler.SetHumanPose(ref m_humanPose); }
// NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties. public override void ProcessFrame(Playable playable, FrameData info, object playerData) { var trackBinding = playerData as HandController; if (!trackBinding) { return; } var inputCount = playable.GetInputCount(); var handPose = new HandPoseData(); for (var i = 0; i < inputCount; i++) { var inputWeight = playable.GetInputWeight(i); var inputPlayable = (ScriptPlayable <HandControllerPlayableBehaviour>)playable.GetInput(i); var input = inputPlayable.GetBehaviour(); // Use the above variables to process each frame of this playable. handPose.WeightedAddPose(inputWeight, ref input.handPose); } trackBinding.SetHandPose(ref handPose); }
public void WeightedAddPose(float weight, ref HandPoseData data) { thumb.WeightedAddPose(weight, ref data.thumb); index.WeightedAddPose(weight, ref data.index); middle.WeightedAddPose(weight, ref data.middle); ring.WeightedAddPose(weight, ref data.ring); little.WeightedAddPose(weight, ref data.little); }
public void SetHandPose(ref HandPoseData data) { if (m_runtimeControl == null) { InitializeRuntimeControl(); } m_handPoseData = data; }
public void UpdateHandPose(ref HandPoseData handPose) { m_poseHandler.GetHumanPose(ref m_humanPose); var hipsPos = m_rootObject.GetBoneTransform(HumanBodyBones.Hips).transform.position; var hipsRot = m_rootObject.GetBoneTransform(HumanBodyBones.Hips).transform.rotation; //m_humanPose.bodyPosition = Vector3.zero; //m_humanPose.bodyRotation = Quaternion.identity; var i = 0; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.thumb.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.index.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.middle.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.ring.muscle3; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle1; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.spread; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle2; m_humanPose.muscles[m_handBoneIndexMap[i++]] = handPose.little.muscle3; m_poseHandler.SetHumanPose(ref m_humanPose); m_rootObject.GetBoneTransform(HumanBodyBones.Hips).transform.position = hipsPos; m_rootObject.GetBoneTransform(HumanBodyBones.Hips).transform.rotation = hipsRot; }
public HandPosePreset(string name, ref HandPoseData pose, Texture2D icon) { m_name = name; m_handPoseData = pose; m_handPoseImage = icon; }