示例#1
0
        private bool TryGetReading <TReading>(SourceCapability <TReading> capability, out TReading reading)
        {
            if (capability.IsAvailable)
            {
                Debug.Assert(capability.IsSupported);

                reading = capability.CurrentReading;
                return(true);
            }
            reading = default(TReading);
            return(false);
        }
示例#2
0
 public SourceData(uint sourceId)
 {
     SourceId = sourceId;
     Position = new SourceCapability <Vector3> {
         CurrentReading = DefaultPosition
     };
     Orientation = new SourceCapability <Quaternion> {
         CurrentReading = DefaultOrientation
     };
     PointingRay = new SourceCapability <Ray> {
         CurrentReading = DefaultRay
     };
 }
示例#3
0
 private SupportedInputInfo GetSupportFlag <TReading>(SourceCapability <TReading> capability, SupportedInputInfo flagIfSupported)
 {
     return(capability.IsSupported ? flagIfSupported : SupportedInputInfo.None);
 }