If p\nextTime <> p\previousTime ; if both packets arrived at the same time, we can't interpolate
If p\nextTime <> p\previousTime ; if both packets arrived at the same time, we can't interpolate
curTime# = Float(MilliSecs()-p\nextTime) / Float(p\nextTime-p\previousTime) ; curTime will be ideally 0.0-1.0, if it's > 1.0 then it performs extrapolation
curTime# = Float(MilliSecs()-p\nextTime) / Float(p\nextTime-p\previousTime) ; curTime will be ideally 0.0-1.0, if it's > 1.0 then it performs extrapolation
If curTime > 1 Then curTime = 1 ; extrapolation gives anoying jittering effects
If curTime > 1 Then curTime = 1 ; extrapolation gives anoying jittering effects
; special fix for yaw as EntityYaw returns a value beetween +180 ans -180, the interpolation can go backward
; special fix for yaw as EntityYaw returns a value beetween +180 ans -180, the interpolation can go backward
If p\previousYaw < 0 Then p\previousYaw = p\previousYaw + 360
If p\previousYaw < 0 Then p\previousYaw = p\previousYaw + 360