1 registered members (AndrewAMD),
742
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: 'c_move' movement
[Re: sheefo]
#150987
08/29/07 17:59
08/29/07 17:59
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
AFAIK, vars/defines are limited to 3 decimal places
DEFINE quant2meter = 0.031;
temp.x = my.speed * quant2meter * time_step; temp.y = 0; temp.z = 0; move_mode = glide; c_move(my, temp, nullvector, move_mode);
xXxGuitar511 - Programmer
|
|
|
Re: 'c_move' movement
[Re: sheefo]
#150989
08/30/07 16:33
08/30/07 16:33
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
So first of all, you want to make your entity move with actually metres (in quants that is) per real time second. The real time second is just a simple calculation via this line: Code:
time_step / 16;
I would advice you to use time_smooth. If time_step changes suddenly, the speed becomes inaccurate during the next frame, adding to the noticeable jerk. This can be prevented by the time_smooth variable. Code:
(constant_speed * (metres_in_quants * (time_step / 16)));
I guess this should do the trick. It's a simple theory but you could improve it using physics I guess. This exemple is in figure speech a 'poor man's physics' example Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: 'c_move' movement
[Re: frazzle]
#150990
08/30/07 17:36
08/30/07 17:36
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
mhh maby i have a strange feeling but maby this helps
my.speed * quant2meter *(time_step/time_step)
"empty"
|
|
|
Re: 'c_move' movement
[Re: flits]
#150991
08/31/07 13:49
08/31/07 13:49
|
Joined: Jul 2006
Posts: 783 London, UK
sheefo
OP
User
|
OP
User
Joined: Jul 2006
Posts: 783
London, UK
|
Thanks everyone. I got it now. The constant METERTOQUANT is 32, so he is moving MovementSpeed number of 32 quants every second. Code:
my.MovementSpeed * METERTOQUANT * (time_frame / 16);
|
|
|
Re: 'c_move' movement
[Re: sheefo]
#150992
08/31/07 13:59
08/31/07 13:59
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Nice to see, but one question I have is, why you use time_frame ?? Probably because of the potential sudden fps increase/decrease Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: 'c_move' movement
[Re: sheefo]
#150994
08/31/07 16:40
08/31/07 16:40
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
with movement, you'll want to use time_step.
with time, (as mentioned by sheefo), you'll want to use time_frame
xXxGuitar511 - Programmer
|
|
|
|