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/Dynamic1D.java
426 426
                                break;
427 427
                case MODE_PATH: segment = (int)(2*t*(numPoints-1));
428 428

  
429
                                if( t<0.5f )
430
                                  {
429
                                if( t<=0.5f )  // this has to be <= (otherwise when effect ends at t=0.5, then time=1.0
430
                                  {            // and end position is slightly not equal to the end point => might not get autodeleted!
431 431
                                  time = 2*t*(numPoints-1);
432 432
                                  vecCurr = segment;
433 433
                                  }
......
456 456
                    {
457 457
                    case MODE_LOOP: vecNext = vecCurr==numPoints-1 ? 0:vecCurr+1;
458 458
                                    break;
459
                    case MODE_PATH: if( t<0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
460
                                    else         vecNext = vecCurr==0 ? 1 : vecCurr-1;
459
                    case MODE_PATH: if( t<=0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
460
                                    else          vecNext = vecCurr==0 ? 1 : vecCurr-1;
461 461
                                    break;
462 462
                    case MODE_JUMP: vecNext = vecCurr==numPoints-1 ? 1:vecCurr+1;
463 463
                                    break;

Also available in: Unified diff