Project

General

Profile

« Previous | Next » 

Revision 9dacabea

Added by Leszek Koltunski over 4 years ago

library: Fix DynamicQuat
cube app: progress with ScrambleEffects

View differences:

src/main/java/org/distorted/library/type/Dynamic2D.java
473 473
                if( cacheDirty ) recomputeCache();  // recompute cache if we have added or remove vectors since last computation
474 474
                else if( mSegment!= segment )       // ...or if we have just passed a vector and the vector we are currently flying to has changed
475 475
                  {
476
                  int vecNext;
477

  
478
                  switch(mMode)
479
                    {
480
                    case MODE_LOOP: vecNext = vecCurr==numPoints-1 ? 0:vecCurr+1;
481
                                    break;
482
                    case MODE_PATH: if( t<=0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
483
                                    else          vecNext = vecCurr==0 ? 1 : vecCurr-1;
484
                                    break;
485
                    case MODE_JUMP: vecNext = vecCurr==numPoints-1 ? 1:vecCurr+1;
486
                                    break;
487
                    default       : vecNext = 0;
488
                    }
489

  
476
                  int vecNext = getNext(vecCurr,t);
490 477
                  next = vv.elementAt(vecNext);
491 478
                  tmp2 = vc.elementAt(vecNext);
492 479

  

Also available in: Unified diff