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); }
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); }
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; } } }