Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How much collision is too much? -NGC-

Author
Message
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 7th Nov 2004 21:54
Using the Nuclear Glory .dll I've finally gotten my platformer engine close to where I want it to be. My only problem at the moment is that when my object touches the platforms sides it can sort of 'walk' right up the sides, and when it hits the bottom of them it sticks to them. I can clearly see in my code why this behavior is happening, and I think I know how to fix it.

I had in my mind to make four collision boxes, for the right side, the top, the left side, and the bottom of the platform, so that when one of them is hit I can make the object react as I want it. Is that going to be too much too calculate though, 4 collision boxes per platform? Obviously I wouldn't load these objects until my character is close to them. I just didn't want to start on some elaborate thing if its going to be too taxing in the long run.

Here's the code:


Thanks!

Neeeeeeeewom!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Nov 2004 00:01
1. You could retrieve the collision normal, to establish whether you had hit top, bottom or sides. A Y Normal of 0 is a vertical face, 1 is horizontal.

2. You could use collision spheres on the edges. Collision spheres are much faster than polys.

3. You could use 2-pass collision. That would involve a bigger initial collision poly. When you know you have hit the bigger poly, you can then check for collision on the collision areas within it, which will give you your accuracy.

4. You could add 4 collsion spheres as you suggested to each object, and see what happens. I don't see it as being an issue, NGC collision is very fast.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 8th Nov 2004 00:45
Sweet, the first idea sounds best. I didn't even realize you could do that. I'll have to do some reading!

Thanks

Neeeeeeeewom!

Login to post a reply

Server time is: 2024-11-27 15:49:32
Your offset time is: 2024-11-27 15:49:32