Using c_move I want my boat to pan/rotate when turning but only move to that new angle after a slight delay (continues straight for a few frames), creating a sliding effect like you would see when a car attempts to turn too fast or on a slippery surface.
Thanks! -Bruce
Re: Sliding effect when turning?
[Re: bpc31]
#150051 08/24/0717:5308/24/0717:53
That's really easy if you're already using acceleration and the rel_dist part of ent_move.
Since you rotate the model you rotate the movement direction with the model by using rel_dist.
To avoid this, just rotate your speed vector in the oppsing direction that the character turns to let the movement direction stay the same even if the character turns.
How to do this?
This is your acceleration vector where you store your current speed: MY._speed_x/y/z
Now you'Re doing somthing like this: MY.PAN += MOUSE_FORCE.X * 5 * TIME; (for example)
Turn it into this: TEMP = MOUSE_FORCE.X * 5 * TIME;
MY.PAN += TEMP; VEC_ROTATE(MY._speed_x, vector(-TEMP, 0, 0)); // Rotates the speed vector into the opposiong direction
VEC_SET(TEMP.X, MY._speed_x); VEC_SCALE(TEMP.X, TIME); // Time correction ent_move(TEMP.X, NULLVECTOR);