Forum Discussion
btrusler
13 years agoHonored Guest
Restricting Camera Rotation
Hi guys,
I'm developing a racing game using the Rift and just wondering if anyone has come up with an easy way of modifying the scripts to restrict the camera rotation (ie so that you cant fully look behind you or fully up/down).
I'm currently delving through the scripts to see if I can do it myself, but if anyone has come up with a solution already I'd love to hear it! (I'm guessing I'll have to play around with the SetCameraOrientation() function in OVRCamera.cs).
I'm developing a racing game using the Rift and just wondering if anyone has come up with an easy way of modifying the scripts to restrict the camera rotation (ie so that you cant fully look behind you or fully up/down).
I'm currently delving through the scripts to see if I can do it myself, but if anyone has come up with a solution already I'd love to hear it! (I'm guessing I'll have to play around with the SetCameraOrientation() function in OVRCamera.cs).
2 Replies
Replies have been turned off for this discussion
- petergiokarisProtegeHello there,
Currently there is no way to disable camera rotation. However, this will be included in the next release; at this time you can go into OVRCamera.cs, look for OVRDevice.GetOrientation. The code looks like this:
// Read shared data from CameraController
if(CameraController != null)
{
// Read sensor here (prediction on or off)
if(CameraController.PredictionOn == false)
OVRDevice.GetOrientation(0, ref CameraOrientation);
else
OVRDevice.GetPredictedOrientation(0, ref CameraOrientation);
}
Simply wrap your condition to turn off reading the CameraOrientation here.
FOr the next release, OVRCameraController.cs will include a new public bool variable EnableTracking. This can be used to toggle tracking on off. - btruslerHonored GuestThanks for the response Peter! Much appreciated!
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
- 7 months ago
- 10 years agoAnonymous
- 7 months ago
- 12 years ago