bmsq wrote:Hi Julio,
As for the controller algorithm, I got it from looking at the quake 3 source code. I've also looked at q1 and q2 code and it's essentially the same thing. The algorithm is called SlideMove and it works by performing a convex cast from the current position to the expected position at the end of the frame. If a collision if found, the impact normal is checked against all previous impact normals and a new velocity direction is calculated. The new velocity is calculated so the player will "slide" along all existing normals, the last impact normal is saved and this process is repeated until the end of the frame or the player hits three intersecting normals and stops. Initially, the saved normal list contains just the ground normal and a "fake" normal to prevent backwards movement.
[/code]
oh I see, that is an standard iterative solution, basically in calculates the the preject velocuty and move to the position canceling the reflection velocity and then try again.
That method works for the most part as long as the player only collide with coner that do not form obtuse angles.
if the player hits a corner with an optuse angle then it it fail with terrible jiter because you afte the secund bounce the legal velocity is negative with respect to teh firt normal.
so so the player moves legally backward even the restition is zero.
The Newton player controller uses a complementary solver to solve the problem. Basically the first move calculate the reflection velocity. andt it saves the normal.
the secund move get the new normal and solve the new relfextion velocity for both normals directions using a complemtary system of equation.
since the condition of that complementary solver states that the prejection of reflected velocity can not be negative for all directions.
then the solution is ether positive velocity when the corner angles is 90% or larger or zero whne corners from 90 degree angle or less.
when you say this:
The new velocity is calculated so the player will "slide" along all existing normals, the last impact normal is saved and this process is repeated until the end of the frame or the player hits three intersecting normals and stops
if the algorithm is not using a complementari system or equations then it fail. but maybe they are using one.
It is funny because for almost 15 years I have being making controller using that principle for comercial games, and I never new that games like quake migh be using that.