Project

General

Profile

« Previous | Next » 

Revision 649544b8

Added by Leszek Koltunski over 7 years ago

Completely redesign Noise in the Dynamics and move all the complexity to the parent class.

something does not work with it now :)

View differences:

src/main/java/org/distorted/library/type/DynamicQuat.java
33 33
  {
34 34
 
35 35
///////////////////////////////////////////////////////////////////////////////////////////////////
36
// Here we implement our own Cache as we need something slightly different.
36 37
// omega, sinOmega, cosOmega - angle between pair of quaternions, its sinus and cosinus.
37 38
//  
38 39
// (vx,vy,vz,vw) is the original vector from vv (copied here so when interpolating we can see if it is 
39 40
// still valid and if not - rebuild the Cache
40 41
  
41
  private class VectorCache
42
  private class VectorCacheQuat
42 43
    {
43 44
    float omega, sinOmega,cosOmega;
44 45
    float vx,vy,vz,vw;
45 46
    }
46 47
  
47
  private Vector<VectorCache> vc;
48
  private VectorCache tmp1, tmp2;
48
  private Vector<VectorCacheQuat> vc;
49
  private VectorCacheQuat tmp1, tmp2;
49 50

  
50 51
  private Vector<Static4D> vv;
51 52
  private Static4D curr, next;
......
190 191
      switch(numPoints)
191 192
         {
192 193
         case 0: 
193
         case 1: vc.add(new VectorCache());
194
                 vc.add(new VectorCache());
194
         case 1: vc.add(new VectorCacheQuat());
195
                 vc.add(new VectorCacheQuat());
195 196
        	     break;
196
         default:vc.add(new VectorCache());
197
         default:vc.add(new VectorCacheQuat());
197 198
         }
198 199

  
199 200
       numPoints++;
......
217 218
      switch(numPoints)
218 219
        {
219 220
        case 0: 
220
        case 1: vc.add(new VectorCache());
221
                vc.add(new VectorCache());
221
        case 1: vc.add(new VectorCacheQuat());
222
                vc.add(new VectorCacheQuat());
222 223
                break;
223
        default:vc.add(location,new VectorCache());
224
        default:vc.add(location,new VectorCacheQuat());
224 225
        }
225 226

  
226 227
      numPoints++;

Also available in: Unified diff