Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. local camPos = {}
  2. camPos[1] = {}
  3. camPos[1]["start"] = {2056.5581054688, 819.84655761719, 49.241451263428, 2057.9289550781, 907.13269042969, 0.4638779759407}
  4. camPos[1]["end"] = {2061.2707519531, 1341.8156738281, 46.84907913208, 1974.5848388672, 1342.2952880859, -3.0040047168732}
  5. camPos[1]["speed"] = 50000
  6. camPos[1]["type"] = "Linear"
  7.  
  8. function updateCamPosition ()
  9. if camPos[camID] then
  10. local cTick = getTickCount ()
  11. local delay = cTick - lastCamTick
  12. local duration = camPos[camID]["speed"]
  13. local easing = camPos[camID]["type"]
  14. if duration and easing then
  15. local progress = delay/duration
  16. if progress < 1 then
  17. local cx,cy,cz = interpolateBetween (
  18. camPos[camID]["start"][1],camPos[camID]["start"][2],camPos[camID]["start"][3],
  19. camPos[camID]["end"][1],camPos[camID]["end"][2],camPos[camID]["end"][3],
  20. progress,easing
  21. )
  22. local tx,ty,tz = interpolateBetween (
  23. camPos[camID]["start"][4],camPos[camID]["start"][5],camPos[camID]["start"][6],
  24. camPos[camID]["end"][4],camPos[camID]["end"][5],camPos[camID]["end"][6],
  25. progress,easing
  26. )
  27.  
  28. setCameraMatrix (cx,cy,cz,tx,ty,tz)
  29. else
  30. local nextID = false
  31.  
  32. while nextID == false do
  33. local id = camID + 1
  34. if id ~= camID then
  35. nextID = id
  36. end
  37. if id > # camPos then
  38. nextID = 1
  39. end
  40. end
  41.  
  42. camFading = 2
  43. lastCamTick = getTickCount ()
  44. camID = nextID
  45.  
  46. setCameraMatrix (camPos[camID]["start"][1],camPos[camID]["start"][2],camPos[camID]["start"][3],camPos[camID]["start"][4],camPos[camID]["start"][5],camPos[camID]["start"][6])
  47. end
  48. end
  49. end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement