Re: [Algorithms] Physics and stairs
Brought to you by:
vexxed72
From: John B. <John.Bustard@JustAddMonsters.com> - 2003-04-30 09:15:41
|
It all depends on what physical properties you want the player to have. In Kungfu Chaos we had fast moving ground surfaces that could be jumped between. In those situations you want to treat the character as an object stuck to the surface. Each frame working out the new speed of the character to travel with the ground and then add the velocity from the characters movement. To deal with stairs we used a lolipop model of the character (sphere with ray cast down) this got the character over most bumps. But often stairs are modelled to have each step more than half way up a character and you just have to mark them as special areas that when hit the player climbs on top of. By modelling the character as an attached object moved through velocity most of the physics interaction can be modelled correctly. For a physics engine integration this represents a game code driven impulse to the player to achieve the desired velocity (probably with some maximum impulse so characters can slide and be pushed about), this impulse represents the friction on the feet and any crazy balancing skills a character has, they can then collide with physical objects and react correctly. John |