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/Dynamic3D.java
497 497
                if( cacheDirty ) recomputeCache();  // recompute cache if we have added or remove vectors since last computation
498 498
                else if( mSegment!= segment )       // ...or if we have just passed a vector and the vector we are currently flying to has changed
499 499
                  {
500
                  int vecNext;
501

  
502
                  switch(mMode)
503
                    {
504
                    case MODE_LOOP: vecNext = vecCurr==numPoints-1 ? 0:vecCurr+1;
505
                                    break;
506
                    case MODE_PATH: if( t<=0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
507
                                    else          vecNext = vecCurr==0 ? 1 : vecCurr-1;
508
                                    break;
509
                    case MODE_JUMP: vecNext = vecCurr==numPoints-1 ? 1:vecCurr+1;
510
                                    break;
511
                    default       : vecNext = 0;
512
                    }
513

  
500
                  int vecNext = getNext(vecCurr,t);
514 501
                  next = vv.elementAt(vecNext);
515 502
                  tmp2 = vc.elementAt(vecNext);
516 503

  

Also available in: Unified diff