boyofgreen Posted March 24, 2017 Share Posted March 24, 2017 Hi All, I have a mesh that is a background, and you can move the other meshes on top of it (and a record the movement). It's very similar to this example: http://playground.babylonjs.com/#U0YL2#0 what I would like to do is keep the smaller mesh contained within the larger one. Ideally, I would like to allow users to move the smaller mesh outside the larger one, but not completely off of it (there would still be like a 25px edge of the mesh so you could still touch it and move it). I am sure I can just compare the xy of the smaller mesh and compare it to the area of the larger mesh, but I'm wondering if there is something that is already being computed that I can use. Thanks, Jeff Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted March 24, 2017 Share Posted March 24, 2017 Hi @boyofgreen As long we're talking about a simple square, a bit of math can solve that right away; http://playground.babylonjs.com/#U0YL2#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.