The documentation says that the speed in this code is 1.Im making a little car game and i want to know what that value is relative to in the reall world.
Thanks greatly.
the answer to your question might be “none” as well as “green” or “blue”
well if you want a “real” speed you need to decide on a “real” scale. time in panda usualy is pretty close to reality. but you can make 1 panda unit to be as large as a planet or as small as atom.
in a simple case just take 1panda unit as your prefered system like 1meter or 1feet.
once you decided you could easily calculate the meters or feet per second.
small example with 1panda unit as one meter:
lets take a bycicle with 20km/h … would make roughly 5.5 meters per second. in our case 5.5 panda units per second.
thanks for your reply
What you say is very logical.
Ill take on board what you said.
i remebered my physics teacher telling about how time and space is all relative.I guess i had forgotten that,lol
Oh, if you want for example to move something 1 m/s, and you use 1 meter = 1 panda unit, you have to check the frame time, because the number of frames per second varies.
To be honest, I don’t think an interval is the way to go for moving a car. I would definately set up a task and capture “dt” from the task and then use basic physics formulae to get what you want.
dt = task.time - task.last #obtains the time since that last frame.
task.last = task.time
Then do something simple like:
x = dt * 5
Nodepath.setPos(Nodepath,x,0,0)
return Task.cont
If you have the task setup you’ll see the nodepath move in the x direction 5 units per second.