Richard C Posted February 9, 2017 Share Posted February 9, 2017 I'm struggling to find a solution either in the docs or playground. I am moving a small mesh with the pointer using pointerMove - no problem. That mesh's movement is restricted to a confined area - no problem. I would like to keep the pointer over the mesh while it is being moved and more especially not move off the mesh it is moving when the mesh reaches the borders of the restricted area until the pointerUp event is triggered. Currently, the mesh stops moving as required but the pointer moves off the mesh which is what I am trying to stop. Any help please. Thanks Richard C Quote Link to comment Share on other sites More sharing options...
ViBe Posted February 9, 2017 Share Posted February 9, 2017 Hi, I understand you want to apply collision : https://doc.babylonjs.com/tutorials/cameras,_mesh_collisions_and_gravity. On chapter "4 - Object vs. object collision", you can see the method moveWithCollisions. There is a playground on this tutorial I found another playground here : http://www.babylonjs-playground.com/#184SZL#4 Quote Link to comment Share on other sites More sharing options...
Richard C Posted February 10, 2017 Author Share Posted February 10, 2017 Hi ViBe Thanks for your reply. I do not see or think the issue is about collision. I just want to know if it is possible to attach the pointer to an object being moved via the pointer X Y position in the scene. Thanks again Richard C Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 10, 2017 Share Posted February 10, 2017 I don't think you can prevent the user from moving the point... would be horrible if java script was allowed to do that, right? 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.