aWeirdo Posted February 2, 2017 Share Posted February 2, 2017 Hi guys, i notised that if you use arcRotateCamera and setTarget(mesh) you're unable to unlock the target, e.g setTarget(mesh.position.clone()); without updating the mesh's position first, i'm using 2.5, but it is also available in the PG; // Press any key to setTarget(sphere), press again to setTarget(sphere.position.clone()), try to pan using the left mouse button, you're still stuck, uncomment line 33 ( sphere.position.x += 0.00000001;), do it again and now you can pan.. Example; http://www.babylonjs-playground.com/#WHMIR#0 Fix has been merged, thanks @Deltakosh https://github.com/BabylonJS/Babylon.js/pull/1740 http://www.babylonjs-playground.com/#WHMIR#6 Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 2, 2017 Share Posted February 2, 2017 Hello, I don't know if it's the behaviour you are waiting for, but : http://www.babylonjs-playground.com/#WHMIR#3 isLocked is not a camera property, it is used to lock the bouding info of a mesh. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 2, 2017 Share Posted February 2, 2017 Yeah, your sort of right. I added a optional arg in 2.5 to use the center of bounds, for meshes with "feet on the ground". I do not have a foot fetish . There is an optimization not to do really do anything then setting the target to something in the same location. I did not add it, so I left it there. If this is only being done for optimization reasons, I think it would be better to pull this check out. Really how many times is this going to be called. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted February 3, 2017 Author Share Posted February 3, 2017 @Temechon camera.isLocked is just a variable i made up to keep track whether the camera was locked or not the issue seems to be related to the setTarget function, it does not happen when using camera.target instead of camera.setTarget.. http://www.babylonjs-playground.com/#WHMIR#4 Edit; Ahh @JCPalmer That must be the cause then ^^ Edit 2; Made a PR https://github.com/BabylonJS/Babylon.js/pull/1740 added a optional boolean to allow same position 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.