コード例 #1
0
        private void EvaluateHandData(SimulatedHandData handData, Handedness handedness)
        {
            animation.EvaluateHandState(localTime, handedness, out bool isTracked, out bool isPinching);

            if (handData.Update(isTracked, isPinching,
                                (MixedRealityPose[] joints) =>
            {
                for (int i = 0; i < jointCount; ++i)
                {
                    joints[i] = animation.EvaluateHandJoint(localTime, handedness, (TrackedHandJoint)i);
                }
            }))
            {
                UpdateHandDevice(HandSimulationMode.Articulated, handedness, handData);
            }
        }
コード例 #2
0
        /// <summary>
        /// Capture a snapshot of simulated hand data based on current state.
        /// </summary>
        public bool UpdateHandData(SimulatedHandData handDataLeft, SimulatedHandData handDataRight, MouseDelta mouseDelta)
        {
            SimulateUserInput(mouseDelta);

            bool handDataChanged = false;

            // Cache the generator delegates so we don't gc alloc every frame
            if (generatorLeft == null)
            {
                generatorLeft = HandStateLeft.FillCurrentFrame;
            }

            if (generatorRight == null)
            {
                generatorRight = HandStateRight.FillCurrentFrame;
            }

            handDataChanged |= handDataLeft.Update(HandStateLeft.IsTracked, HandStateLeft.IsPinching, generatorLeft);
            handDataChanged |= handDataRight.Update(HandStateRight.IsTracked, HandStateRight.IsPinching, generatorRight);

            return(handDataChanged);
        }