• 21Jul

    It starts off innocently enough:

    BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
    {
        // Translation tool only works if mouse button is down.
        // Bail out if mouse not down.
        if( !hasMouseCapture() )
        {
    

    Three hundred ninety-six lines later, we come to the end of the function:

        dialog_refresh_all();		// ??? is this necessary?
     
        lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (active)" << llendl;
        gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
        return TRUE;
    }
    

    One function.

    Over 400 lines long.

    Not intimidating enough for you? Here’s a sample of what some of those lines look like:

                // snap to planar grid
                LLVector3 cursor_point_agent = gAgent.getPosAgentFromGlobal(cursor_point_global);
                LLVector3 camera_plane_projection = gCamera->getAtAxis();
                camera_plane_projection -= projected_vec(camera_plane_projection, mManipNormal);
                camera_plane_projection.normVec();
                LLVector3 camera_projected_dir = camera_plane_projection;
                camera_plane_projection.rotVec(~mGridRotation);
    

    This is one of those functions that makes your eyes go blurry and your head start to hurt until you curl up into fetal position and question the existence of a merciful god.


    Posted by Jacek Antonelli @ 9:36 pm

    Tags:

One Response

WP_Cloudy