• Create Account

## Collision Response with multiple objects

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Mr.L  Members

125
Like
0Likes
Like

Posted 07 October 2012 - 12:06 PM

I hava a 3d map consisting out of triangles and player with a collision sphere.
it looks a bit like this:
http://ika.wdfiles.com/local--files/terrain-generation/Terrain.png
I've Managed to reslove collisions with just one triangle.

But i don't get it to resolve with multple objects, the sphere sinks in the floor time to time when i just resolve every MTV.

So how can i make it right?

### #2WiredCat  Members

1326
Like
0Likes
Like

Posted 07 October 2012 - 03:04 PM

So you test every triangle by managing distances from old collision sphere position to where want to go position, you make a line (segment)
you test if the every vertex and side [if sides are tested vertices may be forgotten] you test if this line is in the distance less or equal to the col sphere radius, you also need to test if the sphere allready intersects the triangle (or other poly like quad ;P) you can test if the line intersects the triangle but you must take care of one special condition , when
the end of the line (movement liine) is too close to tested triangle /

if collision found add to the stack

after doing this by all vertices you find the closest collision point and then apply the new position and you repeat the collisiobn [in ex 3 -4 times] test but well i don;'t know what exacly you will now test (i mean the movement line) or you just do sphere collision without movement ; ]
well to be honest i have written the code with this type of collision, but without repeating the collision because i do some different things now, and i faced the same problem and i remeber that someone told me that i need to repeat the process 3-4 times or even 12 ; ]

Edited by ___, 07 October 2012 - 03:14 PM.

### #3Mr.L  Members

125
Like
0Likes
Like

Posted 07 October 2012 - 03:54 PM

ok, got it, i report when i implemented it, thanks

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.