Thanks guys.
Founds some interesting things:
idInterpolate<float> zoomFov;
/*
82 ====================
83 idInterpolate::Init
84 ====================
85 */
86 template< class type >
87 ID_INLINE void idInterpolate<type>::Init( const float startTime, const float duration, const type &startValue, const type &endValue ) {
88 this->startTime = startTime;
89 this->duration = duration;
90 this->startValue = startValue;
91 this->endValue = endValue;
92 this->currentTime = startTime - 1;
93 this->currentValue = startValue;
94 }
if ( IsLocallyControlled() ) {
// zooming
if ( ( usercmd.buttons ^ oldCmd.buttons ) & BUTTON_ZOOM ) {
if ( ( usercmd.buttons & BUTTON_ZOOM ) && weapon.GetEntity() ) {
zoomFov.Init( gameLocal.time, 200.0f, CalcFov( false ), weapon.GetEntity()->GetZoomFov() );
} else {
zoomFov.Init( gameLocal.time, 200.0f, zoomFov.GetCurrentValue( gameLocal.time ), DefaultFov() );
}
}
}
Theoretically in my script I can check delay with sys.getTime or just insert sys.wait(1) in cycle.
Is sys.wait is bad for performance in this case (it will be run in infinite loop)?