Possible bug in enterVr()

Hi,
I am firing enterVR manually (i.e. onClick is disabled)

I have a script attached to the camera thus:

Startvr.prototype.initialize = function() {
     var Camera = this.app.root.findByName('Camera');
     var vrCamera = Camera.script.vrCamera;
     this.app.on("vr:ready", function (hmd) {
        vrCamera.enterVr();
    });
};

however using this causing the stereo effect to become disjointed and blurred?

Can you post a screenshot?

probably but I am not sure it will be of much use. it looks stereo on the screen and you only notice the difference when you put the headset on and everything is blurred and out of wack.
do you still want the screenshot?

here is the project though which has the problem if you want to see it yourself on a vive

https://playcanvas.com/editor/scene/445339

found something odd in the vrCamera script

you appear to have

VrCamera.prototype._onPresentChange = function (presenting)

defined twice?

I am new to javascript so I might be reading things wrong.

Edit: not related to the bug above though (I don’t think) just thought I would mention it.

Hi,

Yes it does appear to be a bug.

If you are doing it manually then you need to run

vrCanera.update();

before you do

vrCamera.enterVr();

otherwise the view is all messed up

i.e.

Startvr.prototype.initialize = function() {
     var Camera = this.app.root.findByName('Camera');
     var vrCamera = Camera.script.vrCamera;
     this.app.on("vr:ready", function (hmd) {
        vrCamera.update();
        vrCamera.enterVr();
    });
};

p.s. you will miss me when I’m gone :wink:

Thanks for the report. I’ll take a look