I have a scene renderer declared like this in a GVRRendererViewController subclass:
private lazy var sceneRenderer: GVRSceneRenderer = {
let sr = GVRSceneRenderer()
sr.hidesReticle = true
sr.renderList.add(self.videoRenderer)
sr.add(toHeadRotationYaw: 0, andPitch: -0.125) // <--- doesn't work
return sr
}()
Adding yaw or pitch doesn't work like this. It turns out _headPose is null on line 123 in GVRRenderer.mm.
Moving that call to viewDidLoad in the view controller didn't help, but moving it to viewDidAppear fixed the problem. headPose isn't allocated until initializeGl is called so it makes sense that it would exist once the view has been painted.
Moving headpose initialization into GVRRenderer's init makes this API a little more friendly.
Thank you for GVRKit. It's a million times better than the old APIs. And extra kudos for making it open source.
I have a scene renderer declared like this in a
GVRRendererViewController
subclass:Adding yaw or pitch doesn't work like this. It turns out
_headPose
is null on line 123 in GVRRenderer.mm.Moving that call to
viewDidLoad
in the view controller didn't help, but moving it toviewDidAppear
fixed the problem.headPose
isn't allocated untilinitializeGl
is called so it makes sense that it would exist once the view has been painted.Moving
headpose
initialization intoGVRRenderer
's init makes this API a little more friendly.Thank you for GVRKit. It's a million times better than the old APIs. And extra kudos for making it open source.