Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        // 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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void SetHandPose(ref HandPoseData data)
 {
     if (m_runtimeControl == null)
     {
         InitializeRuntimeControl();
     }
     m_handPoseData = data;
 }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 public HandPosePreset(string name, ref HandPoseData pose, Texture2D icon)
 {
     m_name          = name;
     m_handPoseData  = pose;
     m_handPoseImage = icon;
 }