Project

General

Profile

« Previous | Next » 

Revision 65d5505f

Added by Leszek Koltunski over 7 years ago

2 bugfixes:

- in Dynamics, it has to be t<=0.5 (rather than t<0.5) (see comment in code)
- in EffectQueueVertex, we need to postprocess() the last time, when effect is finished but not removed!

View differences:

src/main/java/org/distorted/library/type/Dynamic2D.java
459 459
                                break;
460 460
                case MODE_PATH: segment = (int)(2*t*(numPoints-1));
461 461

  
462
                                if( t<0.5f )
463
                                  {
462
                                if( t<=0.5f )  // this has to be <= (otherwise when effect ends at t=0.5, then time=1.0
463
                                  {            // and end position is slightly not equal to the end point => might not get autodeleted!
464 464
                                  time = 2*t*(numPoints-1);
465 465
                                  vecCurr = segment;
466 466
                                  }
......
489 489
                    {
490 490
                    case MODE_LOOP: vecNext = vecCurr==numPoints-1 ? 0:vecCurr+1;
491 491
                                    break;
492
                    case MODE_PATH: if( t<0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
493
                                    else         vecNext = vecCurr==0 ? 1 : vecCurr-1;
492
                    case MODE_PATH: if( t<=0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
493
                                    else          vecNext = vecCurr==0 ? 1 : vecCurr-1;
494 494
                                    break;
495 495
                    case MODE_JUMP: vecNext = vecCurr==numPoints-1 ? 1:vecCurr+1;
496 496
                                    break;

Also available in: Unified diff