Xray wrote:jon_joy_1999 wrote:my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
That's a very strange script! Could you please explain how it works and what it does? And why the strange math, such as entity.vel / 1.075 and entity.vel / 6.5? Also, why do you check to see if _Vel is > +inf? !!! How can any variable be greater than infinity? Also where does _Vel get defined?
Thanks
EDIT: I just realized that _Vel was defined in luezma's scene. But I still don't understand the rest of the script.
First: "+inf" is an constant variable, here it means the maximum speed that the ship can get, if you change "+inf" to "2", if will start dividing the ship's speed by 1.075 until it reaches 2m/s, that makes deceleration and works to limit speed.
Second: "_Vel" is the magnitude of the "entity.vel" vector, it is to see the current speed of the entity.
Third:
- Code: Select all
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
This script works to move the camera (with some damping) where is the current position plus the speed divided by 6.5. If you change the "4" in the last division, you will change the camera damping, when bigger, more damping