Original Post
Hi As mentioned in the topic, Ive got collision working up to the part where I can slide like an ice cube above my world. Unfortunately Iam having some trouble with making it actual _game_ physics. To represent the player, Iam using an ellipsoid. So this ellipsoid slides above the terrain - something particulary unrealistic as a player actually walks - but I guess its not solvable in a better way. The thing is that I cant adjust friction and static friction so that it "feels good". ( My implementation of friction and static friction is as follows: Trace Sphere against World - get the material properties of the first hit - apply friction as: outvelocity=(1-friction)*inVelocity - apply static friction as: if (|inVelocity|<staticFriction) inVelocity=(0,0,0) - calculate the slide vector - collide with the world again ... ) A problem Iam seeing for example is this: the player walks up a sloped hill. Then he wants to stop, but since he still has velocity, static friction wont make him stop, the gravity pulls him slowly down the hill. When I set static friction too high, and Iam colliding with a tree for example, this happens: Iam walking forward ( the tree has friction and static friction set to 0 so that you can slide smoothly along ), you first collide with the tree, the resulting slide vector has a very low magnitude because we are pretty much walking right against it. Now in the second recursion step, we collide against the terrain underneath, since the Magitude of the velocity is very low because of the collision with the tree, static friction will make us stop. If we collided first against the terrain and I've tried adjusting this alot, but I never found a good setup. Is it at all possible to adjust these "physically correct" material properties to generate an unrealistic behaviour? Is it common to have hardcoded pieces of code that prevent the player from sliding when the source of force is gravity? Are my implementations of friction and static friction correct? Especially the case with the tree makes me wonder, as it yields different results if you first collide with the tree, and then with the terrain, or first with the terrain and then with the tree. Thanks alot