コード例 #1
0
 private void CalcScanFeatures(TextureHandProperties _hand, TextureAttributes _attribute)
 {
     if (_alwaysOn)
     {
         _currentHandVelocityThreshold = 0;
     }
     else
     {
         _currentHandVelocityThreshold = _handVelocityThreshold;
     }
     if (_attribute != null && _hand.handMagnitude > _currentHandVelocityThreshold)
     {
         if (_modulateIntensityByHandVelocity)
         {
             HapticRunner.Circles[(int)_hand.chirality].Intensity = HeightValue(
                 _hand.handRayResult.textureCoord,
                 _attribute.HeightMap,
                 _attribute.MinIntensity,
                 _attribute.MaxIntensity * GetModulatedIntensityByHandVelocity(_hand.handMagnitude));
         }
         else
         {
             HapticRunner.Circles[(int)_hand.chirality].Intensity = HeightValue(
                 _hand.handRayResult.textureCoord,
                 _attribute.HeightMap,
                 _attribute.MinIntensity,
                 _attribute.MaxIntensity);
         }
         if (_modulateFrequencyByHandVelocity)
         {
             HapticRunner.Circles[(int)_hand.chirality].Frequency = _attribute.Smoothness + ((_attribute.Smoothness / 2) * GetModulatedFrequencyByHandVelocity(_hand.handMagnitude));
         }
         else
         {
             HapticRunner.Circles[(int)_hand.chirality].Frequency = _attribute.Smoothness;
         }
     }
     else
     {
         HapticRunner.Circles[(int)_hand.chirality].Intensity = 0;
     }
 }
コード例 #2
0
 private void UpdateHand(TextureHandProperties _hand)
 {
     _hand.handVelocity  = HandData.TwoHandData[(int)_hand.chirality].PalmVelocity.ToVector3();
     _hand.handMagnitude = _hand.handVelocity.magnitude;
     CalcScanFeatures(_hand, RaycastToTexture(_hand.scanPosition, _raycastLengthDown, out _hand.handRayResult));
 }