I'm trying to predict/recalculate the increase in forwards speed you get when you jump on an angled surface. So far, I have this happening in the tick where the player is on the surface, after the engine has already applied velocity from the collision
PHP Code:
vel[0] = lastvel[client][0] - vNormal[0] * lastvel[client][2];
vel[1] = lastvel[client][1] - vNormal[1] * lastvel[client][2];
float dot = GetVectorDotProduct(vel, vNormal);
vel[0] -= vNormal[0] * dot;
vel[1] -= vNormal[1] * dot;
It's decently close but always below the actual speed you get. Does anyone know the proper math or at least the relevant functions in the game source so I could see for myself?