public bool SetPoseSource(TrackedPoseDriver.DeviceType deviceType, TrackedPoseDriver.TrackedPose pose)
 {
     if (deviceType < (TrackedPoseDriver.DeviceType)TrackedPoseDriverDataDescription.DeviceData.Count)
     {
         TrackedPoseDriverDataDescription.PoseData poseData = TrackedPoseDriverDataDescription.DeviceData[(int)deviceType];
         for (int i = 0; i < poseData.Poses.Count; i++)
         {
             if (poseData.Poses[i] == pose)
             {
                 this.poseSource = pose;
                 return(true);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// This method is used to set the device / pose pair for the SpatialTracking.TrackedPoseDriver. setting an invalid combination of these values will return false.
 /// </summary>
 /// <param name="deviceType">The device type that we wish to track </param>
 /// <param name="pose">The pose source that we wish to track</param>
 /// <returns>true if the values provided are sensible, otherwise false</returns>
 public bool SetPoseSource(DeviceType deviceType, TrackedPose pose)
 {
     if ((int)deviceType < TrackedPoseDriverDataDescription.DeviceData.Count)
     {
         TrackedPoseDriverDataDescription.PoseData val = TrackedPoseDriverDataDescription.DeviceData[(int)deviceType];
         for (int i = 0; i < val.Poses.Count; ++i)
         {
             if (val.Poses[i] == pose)
             {
                 this.deviceType = deviceType;
                 poseSource      = pose;
                 return(true);
             }
         }
     }
     return(false);
 }