googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

How to disable head tracking (gyroscope)? #325

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, is there a way to programmatically enable or disable head tracking (gyroscope) in the GVRKit? Also in the issue https://github.com/googlevr/gvr-ios-sdk/issues/281 I've read that the GVRKit was open source but the reference in the issue was broken and I didn't found source code of GVRKit in the repository.

Performador commented 6 years ago

You should be able to use gvr->PauseTracking().

Performador commented 6 years ago

We distribute GVRKit as a compiled framework. You should be able to see the headers in XCode though.

ghost commented 6 years ago

Could I call this method if I use (GVRSceneRenderer + GVRVideoRenderer) or I have to write my own Renderer with my own gvr_context as shown in TreasureHuntNDK example?

Performador commented 6 years ago

This call is independent from the rendering logic and should work either way.

ghost commented 6 years ago

Could give me some tip? I don't understand how to get a reference or pointer to GvrApi instance.

Performador commented 6 years ago

Ah, I see, this is not exposed through GVRCardboardView yet.

Are you using a GVRCardboardView? If so, you should be able to use whatever head pose you'd like in the delegate functions instead of the tracked head pose.

ghost commented 6 years ago

No. I'm using (GVRRendererViewController + GVRRendererView + GVRSceneRenderer + GVRVideoRenderer).

Performador commented 5 years ago

OK, will add this on GVRRenderer so you can pause tracking.

Performador commented 5 years ago

Actually [GVRRenderer pause:NO] should disable tracking.