Jump to content

how to avoid intersect collision with other mesh


vahith
 Share

Recommended Posts

I don't have time to give you a playground at the moment but you could use collision check (http://doc.babylonjs.com/page.php?p=22101 - or with the actionManager: http://babylondoc.azurewebsites.net/page.php?p=22531) and then just calculate where the box should move when it intersect or maybe use moveWithCollisions (http://doc.babylonjs.com/page.php?p=22091) while moving it.

Link to comment
Share on other sites

What are you trying to do specifically? On clicking and moving the mouse? Changing a specific faces color? Every mesh has a .scaling property, which you can then do a similiar action that you were trying originally when moving the object (ie mesh.scaling += 0.1; ). Though detecting collisions do not exist for scaling and rotating with a function like moveWithCollisions, that I am aware. Maybe do a intersect check and if it is with an object you want to collide with, then disable the scaling.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...