Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Need help from a collision detection jock!

This topic is 6153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I need help from someone who really knows his collision detection routines. Here''s my goal: I''m writing a pretty simple Marble Madness clone. I found some collision detection routines and quickly adapted them to my program. I did the initial testing with five triangles onscreen to form a ramp and a couple walls. It worked perfectly, really perfectly, and I was thrilled. I fiddled around with some other stuff, and I came back and put in a slightly larger level. Lo and behold, now the collision routine does funny things. Sometimes it stops the ball in the middle of nowhere, for no reason. Sometimes it "detects" a collision with a triangle that is nowhere near the bounding sphere. Help! I have the source and binary on the web here. If you download and run it (about 4mb, sorry!), you can move the marble around with the arrow keys. You can press space to stop the marble dead, or you can press enter if you want to drop the marble from the top again, in case you fall off or something. When running it, any triangle that you "collide" with will show up green. If you are "stuck" in a triangle, it will flash red while the program tries to figure out how to unstick you. To see the problem, do this: Roll the marble down the ramp onto the lower level. If you roll around there long enough, you''ll hit one of a few mystery spots that either stop the marble dead, or suddenly launch it off in a funny direction. On some of these spots, you''ll notice that unrelated triangles on the screen are registering a collision. Help! The only real change I made to the collision routine from the web was to lower the minimum movement distance, so that I could actually control a marble at very low speed. The class that controls the marble is called CRodentBall. The class that handles all collisions is called CCollide, and it''s a member of CRodentBall. By going into CRodentBall->Process (very short) you can see where CCollide->Move is called to determine where the ball should be in the next frame. I truly would appreciate any help with this. Thanks, Goodlife

Share this post


Link to post
Share on other sites
Advertisement
i''ve got similar problems: using the sphereprobe, i get immaginary collisions, or i don''t get real ones.
the other methods doesn''t seem to work at all (passing the mesh and the ray, ..)

i''ll take some look to your code.

hey, and i report CRASHES, too in my code!

Share this post


Link to post
Share on other sites
I''m using Telemacho''s collision routine (you can find it on Mr-GameMaker.com).

I''m not sure what the problem is, because the demo that he wrote for it works perfectly. My fear is that it has something to do with backfacing; his demo is in first person, but I need to use the routine for third person.

This morning I tried taking out the gravity vector, and I still get problems. But if I just shoot a ray straight downward and disable sliding, it detects the correct triangle. In fact, if I disable sliding and run test routines, it works fine. But, of course, I need the sliding, so I''m not sure why the slider shoots off in such funny directions.

Goodlife

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!