accelerate problem

Posted By: dakilla

accelerate problem - 03/18/11 22:05

hey, I have used accelerate and vec_accelerate a lot recently however I am completely frustrated with it in this occasion. Is it that I cannot use vec_accelerate and accelerate in the same function? - I cannot see a reason why not, however when I try and use this code:

var aspeed = 0;
vec_add(camera.pan,accelerate(aspeed,0,0));

The variable aspeed switches between 9 and -9 within every second and the camera pans all over the place. Notice that there is no input into the acceleration function and no friction, so all i would expect is there to be no camera movement. If it means anything, in the same function I am using vec_accelerate but all of the variables and vectors have different names.

Thanks for any helps
Posted By: Uhrwerk

Re: accelerate problem - 03/18/11 22:13

you can use vec_accelerate and accelerate as often in as many function as you like.

I am sorry, but "vec_add(camera.pan,accelerate(aspeed,0,0));" is nonsense. vec_add expects two vectors. Accelerate returns the distance to cover in quants, i.e. a scalar. I guess the other two missing vector elements will be random memory from the stack in your case. Apart from that: calling accelerate with a friction and an acceleration of 0 does not make any sense.
© 2024 lite-C Forums