All pastes #431856 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-09 22:25 UTC
rendered paste body
static Bool
cubeCheckFTB (CompScreen *s, 
              const ScreenPaintAttrib *sAttrib, 
              const CompTransform  *transform
              int output)
{
    CompTransform sTransform = *transform;
(*s->applyScreenTransform) (s, &sa, output, &sTransform);
    float mvp[16];

    MULTM(w->screen->projection, sTransform->m, mvp);

    float pntA[4] = { 0.0,
                      0.0,
                      0.0, 1};

    float pntB[4] = { 0.0,
                      0.0,
                      -0.1, 1};

    MULTMV(mvp, pntA);
    DIVV(pntA);

    MULTMV(mvp, pntB);
    DIVV(pntB);

    if pntA[3] < pntB[3] return true
    
    return FALSE;
}