Advertisement

Collision Detection Needs Fixing!

Started by May 15, 2000 07:57 PM
4 comments, last by nes8bit 24 years, 7 months ago
My problem is quite minor. My collision detection works except for collisions against corners. See my horrible diagram. It shows the player going through the corner instead of stopping or sliding across the wall. My collision response would immediately push the player in the direction of the arrow in the red area as soon as the player moves into the red area. HELP!
just add another if statement for that part
it would be simpler for us to help if you post the part of your code that checks the collision for the 2 red parts you have in figure 1. that way we can atleast have an idea of how you''re checking the other 2 and what needs to be added in order to check the corner part

- pouya
Advertisement
Hmm, it''s in VB. I hope you can read it. I''ll post the code in about an hour because I am at school right now. I can give you an idea of how it checks though. It does a basic sphere to plane collision check using dot products and plane normals. Basically it checks if the source and destination point goes through the plane. After that, it checks if the point where it collides is within the triangle. If it intersects, it moves the camera back at exactally 100 units away from the plane by using the plane normal so it slides like quake. My problem is in the picture. The red zones represent the collision response. The reason it does not check corners is because the collision response pushes back only if the point is within the 100 units of the player AND if it is within the boundaries of the triangle. It''s kinda weird explaning. I''ll try to draw more pictures and post my VB source. Hopefully my pictures will be in .gif or .jpg because this mac does not read bmp''s.
Nevermind, I think I figured it out. I''ll just resize the block and get the planes from that...

ok, fine
see, you didn''t even need our help...

- pouya
--------------
Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us
I still might need help, but later..

This topic is closed to new replies.

Advertisement