Пример #1
0
Bool
fxDreamModelStep(CompScreen *s, CompWindow *w, float time)
{
   if (!defaultAnimStep(s, w, time))
     return FALSE;

   ANIM_SCREEN(s);
   ANIM_WINDOW(w);

   Model *model = aw->model;

   float forwardProgress;
   if ((aw->curWindowEvent == WindowEventMinimize ||
        aw->curWindowEvent == WindowEventUnminimize) &&
       animGetB(as, aw, ANIM_SCREEN_OPTION_DREAM_Z2TOM))
     {
        float dummy;
        fxZoomAnimProgress(as, aw, &forwardProgress, &dummy, TRUE);
     }
   else
     forwardProgress = defaultAnimProgress(aw);

   int i;
   for (i = 0; i < model->numObjects; i++)
     fxDreamModelStepObject(w,
                            model,
                            &model->objects[i], forwardProgress);

   return TRUE;
}
Пример #2
0
void fxRollUpModelStep(CompWindow * w, float time)
{
	defaultAnimStep(w, time);

	ANIM_WINDOW(w);

	Model *model = aw->com.model;

	float forwardProgress = sigmoidAnimProgress(w);
	Bool fixedInterior =
	    animGetB(w, ANIM_SCREEN_OPTION_ROLLUP_FIXED_INTERIOR);

	Object *object = model->objects;
	int i;
	for (i = 0; i < model->numObjects; i++, object++)
		fxRollUpModelStepObject
		    (w, model, object, forwardProgress, fixedInterior);
}
Пример #3
0
Bool
fxGlideAnimStep(CompScreen *s, CompWindow *w, float time)
{
   ANIM_SCREEN(s);
   ANIM_WINDOW(w);

   if (fxGlideIsPolygonBased(as, aw))
     return polygonsAnimStep(s, w, time);
   else
     {
        if (!defaultAnimStep(s, w, time))
          return FALSE;

        applyGlideTransform (w, &aw->transform);

        return TRUE;
     }
}
void
fxDodgeAnimStep (CompWindow *w, float time)
{
    XRectangle dodgeBox;

    defaultAnimStep (w, time);

    ANIM_WINDOW(w);

    aw->com.transformProgress = 0;

    float forwardProgress = defaultAnimProgress (w);
    if (forwardProgress > aw->com.transformStartProgress)
    {
	aw->com.transformProgress = 
	    (forwardProgress - aw->com.transformStartProgress) /
	    (1 - aw->com.transformStartProgress);
    }

    if (!aw->isDodgeSubject &&
	aw->com.transformProgress <= 0.5f &&
	fxDodgeFindDodgeBox (w, &dodgeBox))
    {
	// Update dodge amount if subject window has moved during dodge
	float newDodgeAmount =
	    DODGE_AMOUNT_BOX(dodgeBox, w, aw->dodgeDirection);

	// Only update if amount got larger
	if (((newDodgeAmount > 0 && aw->dodgeMaxAmount > 0) ||
	     (newDodgeAmount < 0 && aw->dodgeMaxAmount < 0)) &&
	    abs(newDodgeAmount) > abs(aw->dodgeMaxAmount))
	{
	    aw->dodgeMaxAmount = newDodgeAmount;
	}
    }

    matrixGetIdentity (&aw->com.transform);
    applyDodgeTransform (w, &aw->com.transform);
}
Пример #5
0
Bool
fxCurvedFoldModelStep(CompScreen *s, CompWindow *w, float time)
{
    if (!defaultAnimStep(s, w, time))
        return FALSE;

    ANIM_SCREEN(s);
    ANIM_WINDOW(w);

    Model *model = aw->model;

    float forwardProgress;
    if ((aw->curWindowEvent == WindowEventMinimize ||
            aw->curWindowEvent == WindowEventUnminimize) &&
            animGetB(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_Z2TOM))
    {
        float dummy;
        fxZoomAnimProgress(as, aw, &forwardProgress, &dummy, TRUE);
    }
    else
        forwardProgress = defaultAnimProgress(aw);

    float curveMaxAmp =
        animGetF(as, aw, ANIM_SCREEN_OPTION_CURVED_FOLD_AMP) * WIN_W(w) *
        pow(WIN_H(w) / (s->height * 1.2f), 0.7);
    int i;
    for (i = 0; i < model->numObjects; i++)
        fxCurvedFoldModelStepObject
        (w,
         model,
         &model->objects[i],
         forwardProgress,
         curveMaxAmp);

    return TRUE;
}
Пример #6
0
void fxHorizontalFoldsModelStep(CompWindow * w, float time)
{
	defaultAnimStep(w, time);

	ANIM_WINDOW(w);

	Model *model = aw->com.model;

	float winHeight = 0;
	if (aw->com.curWindowEvent == WindowEventShade ||
	    aw->com.curWindowEvent == WindowEventUnshade) {
		winHeight = (w)->height;
	} else {
		winHeight = BORDER_H(w);
	}
	int nHalfFolds =
	    2.0 * animGetI(w, ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_NUM_FOLDS);
	float foldMaxAmp =
	    0.3 * pow((winHeight / nHalfFolds) / w->screen->height, 0.3) *
	    animGetF(w, ANIM_SCREEN_OPTION_HORIZONTAL_FOLDS_AMP_MULT);

	float forwardProgress = getProgressAndCenter(w, NULL);

	float sinForProg = sin(forwardProgress * M_PI / 2);

	Object *object = model->objects;
	int i;
	for (i = 0; i < model->numObjects; i++, object++)
		fxHorizontalFoldsModelStepObject(w,
						 model,
						 object,
						 forwardProgress,
						 sinForProg,
						 foldMaxAmp,
						 i / model->gridWidth);
}