collision detection and staying on the ground

Started by
5 comments, last by bla bla 19 years, 8 months ago
is there a difference between collision detection (walls and obstacles) and making the character/player stay on the ground. in other words could the same algorithms solve both? and is it practical(or is it better to seperate them?) .
Advertisement
It depends. If we are talking about outside terrain, then clearly, if such terrain is represented by some sort of height map or even parameteric surface, then there may be faster ways to stay on the ground (depending on the precision required).

As for indoors, my guess is that unless the ground is treated
specially (such as a game where there is only one floor)
there is no need to treat the ground collision specially.
Stairs tend to be special cased for "walk around" models. I don't know about heightfield type collisions, but it would make sense that the response code is the same, atleast.

-Morten-
it depends on the game... but if there is a lot of jumping and falling and such, it would probably be best to implement gravity (whether realistic or not), and let normal collision detection with the ground keep the player where he should be.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
If by staying on the ground, you mean it 'blocks', then you can separate the two and its actually better this way.

For example, on the Unreal engine, there is collision and there is blocking. Blocking stops anything from going past but collision calls a function (a trigger) with arguments of who collided with who.
--------------------------A good discussion is like a miniskirt; Short enough to pertain interest and long enough to cover the subject..
I would implement gravity and then just make collision detection/response against the ground each cycle.

Hitting an object like a wall would be the same as hitting the ground, just your response (like sliding) will be against the wall instead of the ground.
Quote:CalvinI am only polite because I don't know enough foul languageQuote:Original post by superpigI think the reason your rating has dropped so much, Mercenarey, is that you come across as an arrogant asshole.
ok, thanks guys.
I see that most of the opinions tend to include the "staying on ground" in the collision detection. so I will try to make a collision detection that takes in consideration both.

This topic is closed to new replies.

Advertisement