nathanidp Posted August 28, 2018 Share Posted August 28, 2018 In this Babylon Playground I try to constrain the yGizmo of the position gizmo to prevent the sphere to go below the plane. My technique seems to be wrong. Any help to solve this ? https://www.babylonjs-playground.com/#31M2AP#24 DylanD 1 Quote Link to comment Share on other sites More sharing options...
nathanidp Posted August 28, 2018 Author Share Posted August 28, 2018 I tried to block by using "dragBehavior.releaseDrag()" but then I can't drag up again Quote Link to comment Share on other sites More sharing options...
DylanD Posted August 28, 2018 Share Posted August 28, 2018 Hmmm maybe like this? https://www.babylonjs-playground.com/#31M2AP#25 I added it to the engine.runRenderLoop I added a check if they intersect. nathanidp 1 Quote Link to comment Share on other sites More sharing options...
nathanidp Posted August 28, 2018 Author Share Posted August 28, 2018 That's a good solution. Eventually I did this : https://www.babylonjs-playground.com/#31M2AP#26 babbleon and DylanD 2 Quote Link to comment Share on other sites More sharing options...
DylanD Posted August 28, 2018 Share Posted August 28, 2018 thats a better solution! Well actually it might break if you moved the plane in the y axis. However you could just switch it to something like: https://www.babylonjs-playground.com/#31M2AP#27 https://www.babylonjs-playground.com/#31M2AP#28 This way it will "scale" with the plane moving. Nice job though! p.s. please mark as solved 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.