Fix controller orientation for OpenXR and Varjo
This commit is contained in:
parent
64af1d26da
commit
285aefc2ae
@ -15,6 +15,7 @@ namespace Passer.Tracking {
|
|||||||
None,
|
None,
|
||||||
Oculus,
|
Oculus,
|
||||||
OpenXR,
|
OpenXR,
|
||||||
|
Varjo,
|
||||||
}
|
}
|
||||||
protected LoadedDeviceType loadedDevice = LoadedDeviceType.None;
|
protected LoadedDeviceType loadedDevice = LoadedDeviceType.None;
|
||||||
public GameObject model;
|
public GameObject model;
|
||||||
@ -141,7 +142,8 @@ namespace Passer.Tracking {
|
|||||||
loadedDevice = LoadedDeviceType.Oculus;
|
loadedDevice = LoadedDeviceType.Oculus;
|
||||||
else if (XRSettings.loadedDeviceName == "OpenXR Display")
|
else if (XRSettings.loadedDeviceName == "OpenXR Display")
|
||||||
loadedDevice = LoadedDeviceType.OpenXR;
|
loadedDevice = LoadedDeviceType.OpenXR;
|
||||||
|
else if (XRSettings.loadedDeviceName == "VarjoDisplay")
|
||||||
|
loadedDevice = LoadedDeviceType.Varjo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -200,8 +202,9 @@ namespace Passer.Tracking {
|
|||||||
|
|
||||||
Quaternion rotation;
|
Quaternion rotation;
|
||||||
if (isTracked && device.TryGetFeatureValue(CommonUsages.deviceRotation, out rotation)) {
|
if (isTracked && device.TryGetFeatureValue(CommonUsages.deviceRotation, out rotation)) {
|
||||||
//if (loadedDevice == LoadedDeviceType.OpenXR)
|
if (loadedDevice == LoadedDeviceType.OpenXR ||
|
||||||
// rotation *= Quaternion.AngleAxis(45, Vector3.right);
|
loadedDevice == LoadedDeviceType.Varjo)
|
||||||
|
rotation *= Quaternion.AngleAxis(45, Vector3.right);
|
||||||
transform.rotation = trackerTransform.rotation * rotation;
|
transform.rotation = trackerTransform.rotation * rotation;
|
||||||
rotationConfidence = 1;
|
rotationConfidence = 1;
|
||||||
status = Tracker.Status.Tracking;
|
status = Tracker.Status.Tracking;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user