Hi, how can I calculate penetration depth and normal for a point inside the outline?
Hi, how can I calculate penetration depth and normal for a point inside the outline?
As far as I know, there are no active developers that can remember how the collision code works.
Have a look at ClanLib-2.3.6/Tests/Display/Collision - It may help
(Also, it is rumoured ClanLib 3.0 collision is to be rewritten using Box2D via clanPhysics ... but that might be last next year)
The collision system has a single fatal problem, that renders it useless in most situations.
Lets have 2 objects (A and B)
'A' is a rectangle 2 pixels wide and 10 height
'B' is also a rectangle 2 pixels wide and 10 height
'A' is located at (0,0). 'B' is located at (2,0)
At that point they are not colliding.
If 'A' moves horizontally 4 pixels, thus is in location (4,0)
'A' is not touching 'B', but should have collided with 'A' during the transition.
The current Collision system cannot handle this situation.
In games that I have worked in, the collision boxes are always made up of rectangles. When an object moves, you can extrude the points (using difference between of the old and new point).
Maybe this problem can be fixed?
When creating the Examples/Display/Collision, I tried extruding the collision outlines in an attempt to solve this problem, but ended up in a mess (too complex for myself to code) - Also there are faster methods
Instead, it checks for collision for every pixel the object moves. (See
#ifndef "PIXEL_TRANSVERSAL_COLLISION_DETECTION" in the code)
That is slow, especially if the object moves rapidly.
Thanks for response
Yes, I know about tunneling effect and I'm using simple techniques to avoid them, like slow movement, big collisions objects, frames subsampling.
Anyway, I wanted just to know if it was possible to get information from point inside outline test
Bookmarks