how to accel?

Posted By: Anonymous

how to accel? - 09/12/02 21:58

long time ago, i used accel to move my entities this

code:
accel(my.relSpeed, my.relForce, 0.7);
accel(my.absSpeed, my.absForce, 0.7);
vec_set(my.relForce, nullvector);
vec_set(my.absForce, nullvector);
ent_move(my.relSpeed, my.absSpeed);

way. now i replaced accel with script

code:
speed += time * ( force - speed * frinction );

and it doesnt seem to be time corrected. but i find no error in my accel (btw, its the accel-replacement from the movement.wdl)
so whats my problem?

(thanks in advance)
Posted By: Anonymous

Re: how to accel? - 09/16/02 18:37

ok, let me proof that this kind of acceleration does not work properly:

this is the formula
speed += time * ( force - speed * frinction)

1) speed=10, force=0, frinc=0.5; time=1;

10 += 1*(0-10*0.5) // == 5

2) speed=10, force=0, frinc=0.5; time=0.5;

10 += 0.5 * (0-10*0.5) // == 7.5
7.5 += 0.5 * (0-7.5*0.5) // == 5.625

the difference something about 10%
Posted By: Phantom88

Re: how to accel? - 09/16/02 22:20


Posted By: Anonymous

Re: how to accel? - 09/17/02 15:55

not that shy! i dont bite [Smile] [Smile]
Posted By: Phantom88

Re: how to accel? - 09/17/02 22:01

I said something(then posted), then thought again, and figured out, that what i said was wrong(and edited it). Sorry...

~Phantom88~
Posted By: Anonymous

Re: how to accel? - 09/18/02 15:10

i'm interested in your theories [Smile]
i dont know how to go on, even a guess may help [Frown]
© 2023 lite-C Forums