UglyFoot wrote:You could read about what happens when a ball bounces in a ramp. I've read a bit and I would say that you should remove the normal component of the velocity (because players don't bounce) but keep the parallel unchanged. That's in case the gravity is perpendicular to the plane, in the ramp case there's also an acceleration but I'm not sure about how to calculate it.
I was curious about this so I did some testing and it is indeed what happens, the normal component of the velocity (normal to the ramp) is set to zero. It's just regular collision detection in Q3, when you hit the ramp your velocity is projected on the tangent plane of the ramp and the rest is discarded, so some of your horizontal velocity is converted to vertical. Some of your vertical speed is also converted to horizontal, or another way to think about it is that the more vertical speed you have the less of your horizontal is converted to vertical because you're not impacting the ramp at as high an angle.
Anyway, the reason you get so much height from it is because it kind of works like a triple jump. When you hit the ramp still going upwards from your first jump you get to keep all that upward momentum that you have from jumping, you even get some extra from the ramp, but because you're on the ground you can jump again and because it's CPMA you can even do a double jump and add 370 UPS to your vertical speed. So the first jump, the double jump and the ramp pushing you upwards all contribute to giving you more vertical speed.
The difference between VQ3 and CPM is that in VQ3 the speed of your jump is always set to 270, but in CPM the jump seems to be addative, so if you start with some vertical velocity the jump just adds to it. I'm not sure why that is because according to this:
http://games.linuxdude.com/tamaps/archi ... /step2.txt it shouldn't work that way. That isn't the source though so who knows. For regular double jumps your speed is set to 0 when you step up the ledge, so in that situation the first jump doesn't contribute.
edit: I should say as well that falling down a ramp works the same in both VQ3 and CPM. It's just the same thing basically, the velocity vector is again projected on the tangent plane. When you jump off the ramp the jump just cancels your vertical velocity and you jump normally. I guess that's a little strange since the jump in CPM was addative in the last case.