コード例 #1
0
 private void CognitiveVR_Manager_OnTick()
 {
     if (samples < sampleCount)
     {
         hmdAccumHeight += CognitiveVR_Manager.HMD.position.y;
         samples++;
         if (samples >= sampleCount)
         {
             float averageHeight = hmdAccumHeight / samples;
             Util.logDebug("head height " + averageHeight);
             Instrumentation.updateUserState(new Dictionary <string, object> {
                 { "height", averageHeight }
             });
             CognitiveVR_Manager.OnTick -= CognitiveVR_Manager_OnTick;
         }
     }
 }
コード例 #2
0
        private void CognitiveVR_Manager_OnTick()
        {
            if (CognitiveVR_Manager.GetController(0) == null)
            {
                return;
            }

            if (samples < sampleCount)
            {
                maxSqrDistance = Mathf.Max(Vector3.SqrMagnitude(CognitiveVR_Manager.GetController(0).position - CognitiveVR_Manager.HMD.position));

                samples++;
                if (samples >= sampleCount)
                {
                    Util.logDebug("arm length " + maxSqrDistance);
                    Instrumentation.updateUserState(new Dictionary <string, object> {
                        { "armlength", Mathf.Sqrt(maxSqrDistance) }
                    });
                    CognitiveVR_Manager.OnTick -= CognitiveVR_Manager_OnTick;
                }
            }
        }