Re: [Algorithms] Kinematic Collision
Brought to you by:
vexxed72
|
From: Juan L. <re...@gm...> - 2009-09-02 05:57:38
|
What you are describing is usually the standard way of handling a character through a level, or at least what it used to be standard up to a few years ago. I'm not sure if i'm solving your problem, but at least i'll try to share some experience: Nowadays, physics engines can handle this in 2 different ways 1) The way you propose, plus usually a "solver" check if your character ended up embedded (may always happen.. ) so it ends up unembedded. This results in very "correct" character motion, but with poor interaction with other dynamic objects. 2) Under a physics engine, you can treat your character as a rigid body with infinite inertial tensor (0 inverted) so it can't rotate (stays straight all the time, and just solve the contacts as you would solve any rigid body (applying force and remving friction while it walks, etc). This works pretty well except for a few side effects i'll commend below. The second way has some extra problems to solve: a) Characters or other objects can go through floors if moving too fast, this can be solved by using CCD, raycasting from the support in the direction it's moving, or use binary steps with the swept motion volume to the point first intersecting. b) Characters can slide slowly in ramps (not stay still).. there are many small ways to fix this, the one i like the most is disabling gravity on our character if you are not moving your character for a while and it stays n floor, or you can just reenable friction when your character is still (you are not trying to move it). c) Characters may bounce when falling from too high or at high speed, this can be fixed either hacking the solver,or using the raycast mentioned in (a) to preapply an impulse that decreases the impact velocity. Also, i noticed techniques such as split/accumulated impulses described by erin catto help this scenario. Cheers! |