public void updateAnimation ( ) { Date time = new Date ( ) ; long currentTime = time . getTime ( ) - this . beginAnimation ; if ( currentTime > animationTime ) { this . currentQuaternion . set ( endQuaternion ) ; for ( int i = 0 ; i < 3 ; i ++ ) { this . currentPos [ i ] = this . endPos [ i ] ; } this . animate = false ; } else { float t = ( float ) currentTime / animationTime ; this . currentQuaternion = this . beginQuaternion . slerp ( this . endQuaternion , t ) ; for ( int i = 0 ; i < 3 ; i ++ ) { this . currentPos [ i ] = this . beginPos [ i ] + totalTranslation [ i ] * t ; } } }
called per frame of animation to update the camera position