I have a thesis project where I am moving different game objects with cardboard. The interaction with game objects is done with the cross-hair. Currently, I am grabbing the object and trying to calculate the distance that the object traveled. In other words, I am grabbing the object and move it with cross-hair. Currently, I am calculating the distance like this:
distance = (Math.Abs (Vector3.Distance (newPosition, originalPosition)));
My question is as follows:
Should I take into account the framerate dependency and multiply the distance to Time.deltaTime or this distance is framerate independent?
No because:
Frame rate or more importantly time since last update impacts when you are calculating a new position based on velocity . In this case time since last update is used as a scalar.
By the way the line
distance = (Math.Abs (Vector3.Distance (newPosition, originalPosition)));
...can be simplified to:
distance = Vector3.Distance (newPosition, originalPosition);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.