Jump to content

How To Extract A Position Of Collision?


Recommended Posts

For example I have two wire objects which moves one around other. Sometimes they collides each other. So how to get an information about where the collision happen (in other words how to get the attribute value (say U coordinate) from wire object in the place where collision happen)?

Link to comment
Share on other sites

the collision happens on the points of the wires

so you will need to read the collision radius of each point and then to check if the distance between each two of them is smaller or equal than the sum of their collision radiuses, if that's the case - then collission occures.

to get the exact position of the point, where the collision "spheres" of those two points penetrate, you will need some vector math to figure it out.

The first thing coming in mind is to build a lookAt vector from one of the points, pointing to the other one. Then use it as local coordinate system to project the radius of the collision sphere along the aimAxis of this vector. Finally you will need to convert what you have got to world space coordinates in order to get something real to start from.

Kind of not so production ready approach.

But maybe there are easier ways to do all that. ( going to check DOP docs )

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.

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.

  • Create New...