Jump to content

  • Log In with Google      Sign In   
  • Create Account


Collision Detection & Response


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.

  • You cannot reply to this topic
2 replies to this topic

#1 3TATUK2   Members   -  Reputation: 730

Like
0Likes
Like

Posted 12 November 2013 - 05:58 AM

When doing collision detection and response -- is it *necessary* to first find the *closest* colliding triangle before pushing back and recursing, or can you just push back on the first collision triangle you find?



Sponsor:

#2 3TATUK2   Members   -  Reputation: 730

Like
0Likes
Like

Posted 12 November 2013 - 06:45 AM

So I'm trying to figure out the proper way to handle collision response and iteration in a case like this . . . I keep ending up getting pushed through the floor by the diagonal wall:

 

RKpKtwc.png

 

 

can you maybe review this collision detection/response logical pseudocode and possibly point out any fundamental flaws?

checkTriangles(start, end):

	collision_distance = infinity
	collision_occured = false

	for triangle in triangles:
		if check_collision( triangle ):
			if triangle_distance < collision_distance || collision_occured == false:
				collision_distance = triangle_distance
				collision_triangle = triangle
				collision_occured = true

	if collision_occured:
		end += collision_triangle->normal * pushback_factor
		checkTriangles(start,end)

Attached Thumbnails

  • RKpKtwc.png


#3 3TATUK2   Members   -  Reputation: 730

Like
0Likes
Like

Posted 12 November 2013 - 09:18 AM

ok, i figured out the problem.

 

since it was a point-position instead of swept test, the FPS would drop dramatically when the recursion depth increased so the timestep was big, forcing it through the wall. seems to work now. :>






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.



PARTNERS