Topic: Velocity
Hello, is there some way to measure velocity of translating objects?
You are not logged in. Please login or register.
Hello, is there some way to measure velocity of translating objects?
you can calculate the length of the current position minus the last frame position of an object,
in lua :
velocity = length(currentPos - lastPos)
Sweet, so that's the length of two vectors?
yes, because velocity is distance/time and that the logic is running at 60fps,
you can simply calculate the length of the difference vector of the two positions in time.
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.