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/Dynamic4D.java
506 506
                                break;
507 507
                case MODE_PATH: segment = (int)(2*t*(numPoints-1));
508 508

  
509
                                if( t<0.5f )
510
                                  {
509
                                if( t<=0.5f )  // this has to be <= (otherwise when effect ends at t=0.5, then time=1.0
510
                                  {            // and end position is slightly not equal to the end point => might not get autodeleted!
511 511
                                  time = 2*t*(numPoints-1);
512 512
                                  vecCurr = segment;
513 513
                                  }
......
536 536
                    {
537 537
                    case MODE_LOOP: vecNext = vecCurr==numPoints-1 ? 0:vecCurr+1;
538 538
                                    break;
539
                    case MODE_PATH: if( t<0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
540
                                    else         vecNext = vecCurr==0 ? 1 : vecCurr-1;
539
                    case MODE_PATH: if( t<=0.5f ) vecNext = vecCurr==numPoints-1 ? numPoints-2: vecCurr+1;
540
                                    else          vecNext = vecCurr==0 ? 1 : vecCurr-1;
541 541
                                    break;
542 542
                    case MODE_JUMP: vecNext = vecCurr==numPoints-1 ? 1:vecCurr+1;
543 543
                                    break;

Also available in: Unified diff