Forum Discussion
rolsct
11 years agoHonored Guest
Setting IPD in code ?
Hi there,
Found nothing about this on the forum, so excuse me if this question has already been answered.
For my custom needs, I cannot rely on the users management provided by the OVR config tool, and I have to override this behavior, so that I can set the IPD from somewhere else (by code, either directly from my Unity application, or from another application).
Is there any proper way to do this ? (by setting up a registry key, or modifying a config file before running my VR application ?)
Thanks,
Roland Tomczak
Found nothing about this on the forum, so excuse me if this question has already been answered.
For my custom needs, I cannot rely on the users management provided by the OVR config tool, and I have to override this behavior, so that I can set the IPD from somewhere else (by code, either directly from my Unity application, or from another application).
Is there any proper way to do this ? (by setting up a registry key, or modifying a config file before running my VR application ?)
Thanks,
Roland Tomczak
4 Replies
- vrdavebOculus StaffYou should be able to update the user profile's IPD in the current process by calling
OVRManager.capiHmd.SetFloat(Ovr.Hmd.OVR_KEY_IPD, newIpd);
- rolsctHonored GuestSo easy.. thank you :-)
- rolsctHonored GuestHum.. I must have missed something !
But the somewhat simple sequence
float newIpd = 0.068f;
OVRManager.capiHmd.SetFloat(Ovr.Hmd.OVR_KEY_IPD, newIpd);
var refFloat = OVRManager.capiHmd.GetFloat(Ovr.Hmd.OVR_KEY_IPD, DEFAULT_IPD);
doesn't returns my custom IPD, but the one being registered in the Oculus config profil.
So, I cannot be really sure that the custom IPD is taken in account. Am I missing something ? I tried to set up this snippet at different places (before the OVR prefab is instantiated, before the Menu component is instantiated, OnUpdate, etc..), it doesn't seem to have any impact.
Thank you !
Rolsct - vrdavebOculus StaffSorry, it turns out OVR_KEY_IPD is read-only. So you will have to restart the app with a different user profile to change it. So OVRCameraRig doesn't support custom IPDs. You can write your own camera behavior and add a handler to the OVRCameraRig.UpdatedAnchors event to override ours.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 3 months ago