Ejemplo n.º 1
0
 public Vector3 GetPosition(LogicalPositionDevice logicalPositionDevice)
 {
     if (!this.mappedPositionDevices.ContainsKey(logicalPositionDevice))
     {
         return(this.defaultPosition);
     }
     foreach (var physicalPositionDevice in this.mappedPositionDevices[logicalPositionDevice])
     {
         Vector3?position = physicalPositionDevice.GetPosition();
         if (position != null)
         {
             return((Vector3)position);
         }
     }
     return(this.defaultPosition);
 }
Ejemplo n.º 2
0
 public Quaternion GetRotation(LogicalPositionDevice logicalPositionDevice)
 {
     if (!this.mappedPositionDevices.ContainsKey(logicalPositionDevice))
     {
         return(this.defaultRotation);
     }
     foreach (var physicalPositionDevice in this.mappedPositionDevices[logicalPositionDevice])
     {
         Quaternion?rotation = physicalPositionDevice.GetRotation();
         if (rotation != null)
         {
             return((Quaternion)rotation);
         }
     }
     return(this.defaultRotation);
 }
Ejemplo n.º 3
0
 public void Merge(PositionDeviceMap other)
 {
     foreach (var mappedPositionDevices in other.mappedPositionDevices)
     {
         LogicalPositionDevice          logicalPositionDevice   = mappedPositionDevices.Key;
         List <IPhysicalPositionDevice> physicalPositionDevices = mappedPositionDevices.Value;
         if (this.mappedPositionDevices.ContainsKey(logicalPositionDevice))
         {
             this.mappedPositionDevices[logicalPositionDevice].AddRange(physicalPositionDevices);
         }
         else
         {
             this.mappedPositionDevices[logicalPositionDevice] = physicalPositionDevices;
         }
     }
 }