PDA

View Full Version : Collision Pont_Inside penetration_depth



spider853
12-19-2012, 02:56 PM
Hi, how can I calculate penetration depth and normal for a point inside the outline?

rombust
12-19-2012, 03:41 PM
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)

spider853
12-19-2012, 04:00 PM
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)

I've looked already on it and it does only outline->outline collision

btw, box2D will be nice but hope it will not replace the existing features, as outlines information can be nice for platformers where you don't need heavy physics.

rombust
12-20-2012, 08:48 AM
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.

spider853
12-20-2012, 08:59 AM
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