srimshady Posted December 12, 2017 Share Posted December 12, 2017 Hello, I am getting a strange bug in chrome with the pointer lock API. When using chrome on windows 10, the mouse will randomly move to a new location as I move the mouse around. I have repeated this bug on seperate machines. Works fine on firefox. Here's a play ground: https://playground.babylonjs.com/#H9FRSI#2. I removed the non chrome pointer lock stuff. Pointerlock code for chrome: scene.onPointerDown = function (evt) { canvas.requestPointerLock(); }; I would really appreciate any help on this! Thanks! jonforum 1 Quote Link to comment Share on other sites More sharing options...
erichlof Posted December 12, 2017 Share Posted December 12, 2017 Hi, same here on all instances of Pointer Lock. When trying to spin around 360 degrees, the camera angle will randomly snap back to start position. I filed a problem report with the Chrome team, hopefully it will be resolved soon. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 12, 2017 Share Posted December 12, 2017 Thanks @erichlof! Quote Link to comment Share on other sites More sharing options...
marcgfx Posted December 13, 2017 Share Posted December 13, 2017 I have had some user reports sounding very similar to what you are describing... also Windows 10. Quote Link to comment Share on other sites More sharing options...
FunFetched Posted December 17, 2017 Share Posted December 17, 2017 The Windows 10 Fall Creators Update is rife with problems; this being one of them, although it could be argued that it really just exposed a problem with Chromium, since it's the only browser that is exhibiting this issue. I've implemented a "solution" in my game which simply ignores the first mousemove event that moves in the opposite direction, thereby eliminating that big jump backwards in most circumstances. Such events are high enough in frequency that ignoring a few here and there is not noticeable. It's not 100% effective, but it's a huge improvement when the alternative is that your app is basically rendered unusable. I know this doesn't help much when you're relying on Babylon's built-in input functionality, but one could use FreeCameraInputsManager, for instance, to register a new mouse input function to replace the old one. Quote Link to comment Share on other sites More sharing options...
marcgfx Posted December 17, 2017 Share Posted December 17, 2017 I'm not using babylon, it's absolutely a chrome issue. I don't have a system to test the issue on either. What do these bad values look like? Maybe there is a recognizable pattern (I'm sure you've checked though). @erichlof: can you maybe link me to the bug report you filed? It's a pretty big issue for me too. Quote Link to comment Share on other sites More sharing options...
duchman Posted January 11, 2018 Share Posted January 11, 2018 Any news on this issue? Quote Link to comment Share on other sites More sharing options...
duchman Posted January 31, 2018 Share Posted January 31, 2018 It's fixed with Chrome v64 GameMonetize and FunFetched 2 Quote Link to comment Share on other sites More sharing options...
jonforum Posted May 7, 2018 Share Posted May 7, 2018 i have the same issue ? any fix ? i have chromium: "65.0.3325.146" process.versions { http_parser: "2.7.0", node: "9.7.1", v8: "6.5.254.31", uv: "1.19.2", zlib: "1.2.11", … } ares: "1.13.0" chromium: "65.0.3325.146" cldr: "32.0" http_parser: "2.7.0" icu: "60.1" modules: "59" napi: "2" nghttp2: "1.29.0" node: "9.7.1" node - webkit: "0.29.0" nw: "0.29.0" nw - commit - id: "40ba6a3-15b9f14-1b41b42-41dc8a9" nw - flavor: "sdk" openssl: "1.0.2n" tz: "2017c" unicode: "10.0" uv: "1.19.2" v8: "6.5.254.31" zlib: "1.2.11" __proto__: Object Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 7, 2018 Share Posted May 7, 2018 @jonforum I'm not having any issues on "66.0.3359.139" However, the bug is indeed annoying, and appears to happen with several hundred units at a time, before then going back to around previous values. If you want a fix for the bug, (to make sure everything works for ppl who doesn't update their browsers ? ) Something like this should work; Note; i set the max value the mouse can move before thinking it's a bug jump to 100, you can lower or increase this as needed, (not tested on bugged browser, but works fine on non-bugged). // Fix for Chrome mouseMove "sudden jump" bug. if(!_this.__lastOffsetX){ _this.__lastOffsetX = offsetX; } else if(Math.abs(_this.__lastOffsetX - offsetX) > 100) { return; } if(!_this.__lastOffsetY){ _this.__lastOffsetY = offsetY; } else if(Math.abs(_this.__lastOffsetY - offsetY) > 100) { return; } It should be placed inside the FreeCameraMouseInput's "_onMouseMove" function (see lines 112 - 128 in PG) Or if you'd rather not edit babylon source, the entire function can be overwritten, simply copy the "BABYLON.FreeCameraMouseInput.prototype.attachControl" from the PG below and load in a JS file, after Babylon.js is loaded. http://playground.babylonjs.com/#HTKXPC It should eliminate the bug, but comes with a downside, moving the mouse very rapidly & far will trigger it aswell. jonforum 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.