Project

General

Profile

« Previous | Next » 

Revision 6a2ebb18

Added by Leszek Koltunski over 7 years ago

Next fixes for issues with 'jumping' path when noise is on. (and a whole lot of commented out debugging)

View differences:

src/main/java/org/distorted/library/type/Dynamic3D.java
31 31
  {
32 32
  private Vector<Static3D> vv;
33 33
  private Static3D prev, curr, next;
34

  
34
/*
35
private float a0,a1,a2;
36
private float f0, f1;
37
private float b00,b01,b02;
38
private float b10,b11,b12;
39
private float b20,b21,b22;
40
private float oldTime;
41
*/
35 42
///////////////////////////////////////////////////////////////////////////////////////////////////
36 43
// no array bounds checking!
37 44
  
......
516 523
                  buffer[offset  ]= ((tmp1.a[0]*time+tmp1.b[0])*time+tmp1.c[0])*time+tmp1.d[0] + (baseV[1][0]*mFactor[0] + baseV[2][0]*mFactor[1]);
517 524
                  buffer[offset+1]= ((tmp1.a[1]*time+tmp1.b[1])*time+tmp1.c[1])*time+tmp1.d[1] + (baseV[1][1]*mFactor[0] + baseV[2][1]*mFactor[1]);
518 525
                  buffer[offset+2]= ((tmp1.a[2]*time+tmp1.b[2])*time+tmp1.c[2])*time+tmp1.d[2] + (baseV[1][2]*mFactor[0] + baseV[2][2]*mFactor[1]);
526
/*
527
                  float d0 = buffer[offset+0] - a0;
528
                  float d1 = buffer[offset+1] - a1;
529
                  float d2 = buffer[offset+2] - a2;
530

  
531
                  float distSQ = d0*d0+d1*d1+d2*d2;
532

  
533
                  if( distSQ>500.0f )
534
                    {
535
                    android.util.Log.e("dyn3D", "distSQ="+distSQ);
536
                    android.util.Log.e("dyn3D", "factors old0="+f0+" new0="+mFactor[0]+" old1="+f1+" new1="+mFactor[1]);
537
                    android.util.Log.e("dyn3D", "first  base: old ("+b00+","+b01+","+b02+") new ("+baseV[0][0]+","+baseV[0][1]+","+baseV[0][2]+")");
538
                    android.util.Log.e("dyn3D", "second base: old ("+b10+","+b11+","+b12+") new ("+baseV[1][0]+","+baseV[1][1]+","+baseV[1][2]+")");
539
                    android.util.Log.e("dyn3D", "third  base: old ("+b20+","+b21+","+b22+") new ("+baseV[2][0]+","+baseV[2][1]+","+baseV[2][2]+")");
540

  
541
                    String s1= "velocity: old (";
542
                    String s2= "acceleration: old (";
543

  
544
                    for(int i=0; i<mDimension; i++)
545
                      {
546
                      s1 += (((3*tmp1.a[i]*oldTime+2*tmp1.b[i])*oldTime+tmp1.c[i])+(i==mDimension-1 ? ") new (":","));
547
                      s2 += ( (6*tmp1.a[i]*oldTime+2*tmp1.b[i])                   +(i==mDimension-1 ? ") new (":","));
548
                      }
549

  
550
                    for(int i=0; i<mDimension; i++)
551
                      {
552
                      s1 += (((3*tmp1.a[i]*time+2*tmp1.b[i])*time+tmp1.c[i])+(i==mDimension-1 ? ")":","));
553
                      s2 += ( (6*tmp1.a[i]*time+2*tmp1.b[i])                +(i==mDimension-1 ? ")":","));
554
                      }
555

  
556
                    android.util.Log.e("dyn3D", s1);
557
                    android.util.Log.e("dyn3D", s2);
558

  
559
                    computeOrthonormalBaseMoreDebug(oldTime,tmp1);
560
                    computeOrthonormalBaseMoreDebug(   time,tmp1);
561
                    }
562

  
563
                  a0 = buffer[offset+0];
564
                  a1 = buffer[offset+1];
565
                  a2 = buffer[offset+2];
566

  
567
                  f0 = mFactor[0];
568
                  f1 = mFactor[1];
569

  
570
                  b00 = baseV[0][0];
571
                  b01 = baseV[0][1];
572
                  b02 = baseV[0][2];
573

  
574
                  b10 = baseV[1][0];
575
                  b11 = baseV[1][1];
576
                  b12 = baseV[1][2];
577

  
578
                  b20 = baseV[2][0];
579
                  b21 = baseV[2][1];
580
                  b22 = baseV[2][2];
581

  
582
                  oldTime = time;
583
*/
519 584
                  }
520 585
                else
521 586
                  {

Also available in: Unified diff