• 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;
        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);
                LLVector3 camera_projected_dir = camera_plane_projection;

    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


One Response