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); }
public SourceData(uint sourceId) { SourceId = sourceId; Position = new SourceCapability <Vector3> { CurrentReading = DefaultPosition }; Orientation = new SourceCapability <Quaternion> { CurrentReading = DefaultOrientation }; PointingRay = new SourceCapability <Ray> { CurrentReading = DefaultRay }; }
private SupportedInputInfo GetSupportFlag <TReading>(SourceCapability <TReading> capability, SupportedInputInfo flagIfSupported) { return(capability.IsSupported ? flagIfSupported : SupportedInputInfo.None); }