MacSkelly Posted September 21, 2016 Share Posted September 21, 2016 So I'm not sure if this is a bug or maybe I've just not configured the camera correctly. I have a scene that's the interior of a building and the interior is made of a bunch of room meshes joined together. I have it so that when you click on a room the camera sets that room mesh as its target. If I try to pan the camera(ctrl and mouse drag) after clicking on a room the whole interior pans except for the room that I clicked on which stays in the centre of the screen, separated from the rest of the rooms. Any way to remedy this? I'm using an ArcRotateCamera by the way. Example of what I mean: http://www.babylonjs-playground.com/#18KHF6#0 Click on sphere2 and then pan the camera (ctrl and mouse drag). Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 21, 2016 Share Posted September 21, 2016 Hi MS, good to see you again. Yeah, something is toasted, somewhere, here. Rodents... chewing on the framework, I suspect. http://www.babylonjs-playground.com/#18KHF6#1 I tried two different methods of keeping sphere2.position locked-in-place, and failed. In my past experience, when an ArcCamera has a set target, control-dragging got disabled. See: https://github.com/BabylonJS/Babylon.js/commit/725298b717773e271b1256bca45a96db8159cdf2#diff-c5e36d2c529e0623cfb58b616c79943fL15173 Looks like some work on ArcCam targets happened within the last day. I think Deltakosh will have words about this... in < 4 hours from now. Thanks for the report and PG. Quote Link to comment Share on other sites More sharing options...
MacSkelly Posted September 21, 2016 Author Share Posted September 21, 2016 Thanks for the reply. I think in the meantime I'll add an eventListener on CTRL that resets the camera target when pressed. Quote Link to comment Share on other sites More sharing options...
adam Posted September 21, 2016 Share Posted September 21, 2016 Here is one way to fix the issue: http://www.babylonjs-playground.com/#18KHF6#4 I added the var _panning and lines 11-16; Wingnut 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted September 21, 2016 Share Posted September 21, 2016 Hi, what it actually does is moving the mesh you are focused along with the camera ;-) Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 24, 2016 Share Posted September 24, 2016 That is correct, aW. A-weird-o issue, eh? hmm. *scratch scratch* Mr. @Deltakosh, would you assist with this, please? On 9/21/2016 at 4:27 AM, MacSkelly said: http://www.babylonjs-playground.com/#18KHF6#0 Click on left sphere to set it as camera target. Now try control-dragging. Target moves with camera. Problem? I think so. Related to: https://github.com/BabylonJS/Babylon.js/commit/725298b717773e271b1256bca45a96db8159cdf2#diff-c5e36d2c529e0623cfb58b616c79943fL15173 ?? Adam's work-around is nice, but perhaps not a proper long-term fix. Thanks for help. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted September 24, 2016 Share Posted September 24, 2016 @Wingnut, @MacSkelly i had the same issue once, i was told to use mesh.position.clone(); http://www.babylonjs-playground.com/#18KHF6#6 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 24, 2016 Share Posted September 24, 2016 Not again! hehe. position.clone() has kicked my butt TWICE in 36 hours, now. What a lamer I am. Thx aW! (Wingy slaps himself up-side the head). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 26, 2016 Share Posted September 26, 2016 Quote Link to comment Share on other sites More sharing options...
adam Posted September 26, 2016 Share Posted September 26, 2016 On 9/24/2016 at 11:55 AM, aWeirdo said: i had the same issue once, i was told to use mesh.position.clone(); http://www.babylonjs-playground.com/#18KHF6#6 This will work if you don't need to follow a moving target. 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.