Project

General

Profile

« Previous | Next » 

Revision 15aa7d94

Added by Leszek Koltunski almost 7 years ago

Progress with support for Effect classes.

View differences:

src/main/java/org/distorted/library/effect/MatrixEffectShear.java
47 47
      mDynamic0 = (Dynamic3D)shear;
48 48
      }
49 49

  
50
    mCenter = center;
50
    if( center instanceof Static3D)
51
      {
52
      mStaticCenter = (Static3D)center;
53
      }
54
    else if( center instanceof Dynamic3D )
55
      {
56
      mDynamicCenter = (Dynamic3D)center;
57
      }
58
    }
59

  
60
///////////////////////////////////////////////////////////////////////////////////////////////////
61

  
62
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
63
    {
64
    if( mDynamicCenter!=null )
65
      {
66
      mDynamicCenter.interpolateMain(uniforms,index+4,currentDuration,step);
67
      }
68
    else
69
      {
70
      uniforms[index+4] = mStaticCenter.getX();
71
      uniforms[index+5] = mStaticCenter.getY();
72
      uniforms[index+6] = mStaticCenter.getZ();
73
      }
74

  
75
    if( mDynamic0!=null )
76
      {
77
      return mDynamic0.interpolateMain(uniforms,index,currentDuration,step);
78
      }
79
    else
80
      {
81
      uniforms[index  ] = ((Static3D)mStatic0).getX();
82
      uniforms[index+1] = ((Static3D)mStatic0).getY();
83
      uniforms[index+2] = ((Static3D)mStatic0).getZ();
84

  
85
      return false;
86
      }
51 87
    }
52 88
  }

Also available in: Unified diff