Project

General

Profile

« Previous | Next » 

Revision 21819119

Added by Leszek Koltunski over 7 years ago

Progress with Wind

View differences:

src/main/java/org/distorted/examples/wind/WindRenderer.java
46 46
   private DistortedObject mObject;
47 47
   private WindEffectsManager mEffects;
48 48
   private int mObjWidth, mObjHeight;
49
   private int mWind;
49 50

  
50 51
///////////////////////////////////////////////////////////////////////////////////////////////////
51 52

  
......
64 65

  
65 66
   void setWind(int wind)
66 67
      {
67
      mEffects.apply(mObject,wind);
68
      mWind = wind;
69
      mEffects.setWind(mWind);
68 70
      }
69 71
   
70 72
///////////////////////////////////////////////////////////////////////////////////////////////////
......
82 84
   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
83 85
      {
84 86
      mObject.abortEffects(EffectTypes.MATRIX);
87
      mObject.abortEffects(EffectTypes.VERTEX);
88
      mObject.abortEffects(EffectTypes.FRAGMENT);
89

  
85 90
      float factor = 0.8f*(width<height? width:height)/mObjWidth;
86 91

  
87 92
      mObject.move( new Static3D( (width-factor*mObjWidth)/2 + width/8 , (height-factor*mObjHeight)/2 -height/4 , 0) );
......
93 98

  
94 99
      mObject.rotate(angle, axis, center);
95 100

  
101
      mEffects.apply(mObject, mWind);
102

  
96 103
      Distorted.onSurfaceChanged(width, height);
97 104
      }
98 105

  

Also available in: Unified diff