Collision position

Is there anyway to get the exact coordinates of a collision , event.x and event.y do not help , nor do self.x and self,y !!

there should be someway to get the exact point of collision!! , but i couldn’t find any , any suggestions !!!

thanks in advance [import]uid: 86096 topic_id: 15877 reply_id: 315877[/import]

Maybe you can use self.contentBounds.xMin or self.contentBounds.xMax?

[lua]if collidingObject.x > self.x then
pointOfCollision = self.contentBounds.xMax
else
pointOfCollision = self.contentBounds.xMin
end[/lua]

and Similarly for y.
Not sure what you want… but just an idea! :slight_smile: [import]uid: 64174 topic_id: 15877 reply_id: 58729[/import]

I needed this points coordinates to… For circles you can calculate it easy. For other shapes it will be harder.

As far as I read anywhere else Box2D inside has this feature. Corona SDK has not. So I would really like to get a “handle” to use this feature. Hey Ansca would this be more than a simple wrapper? I dont know…

@Satheesh

I think with your idea you just can create a smaller area in which this point is located - but you don’t get the point. [import]uid: 70114 topic_id: 15877 reply_id: 58744[/import]

thx Satheesh i tried it but that was not very accurate , i have an area with several polygons for collision , i need to know with which polygon of the area the collision occured , i tried contentBounds but still not giving me accurate results, hope there’s some way to get what i need exactly !
thxx again :)) [import]uid: 86096 topic_id: 15877 reply_id: 58746[/import]

Sven.Lua i guess we can at least use polygon intersection algorithems for other shapes but still it’s a performance issue since we r developing for mobile devices :)) [import]uid: 86096 topic_id: 15877 reply_id: 58747[/import]


I think with your idea you just can create a smaller area in which this point is located - but you don’t get the point.

lol! I guess I never gave that a thought since I never needed that level of accuracy!
Still… would love to see a solution for the above.
:slight_smile: [import]uid: 64174 topic_id: 15877 reply_id: 58751[/import]