Revision 8664ea2e
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/wind/WindEffectsManager.java | ||
---|---|---|
26 | 26 |
import org.distorted.library.effect.VertexEffectDeform; |
27 | 27 |
import org.distorted.library.effect.VertexEffectWave; |
28 | 28 |
import org.distorted.library.main.DistortedEffects; |
29 |
import org.distorted.library.main.DistortedTexture; |
|
30 | 29 |
import org.distorted.library.type.Dynamic; |
31 | 30 |
import org.distorted.library.type.Dynamic5D; |
32 | 31 |
import org.distorted.library.type.Static3D; |
... | ... | |
105 | 104 |
|
106 | 105 |
void apply(DistortedEffects effects) |
107 | 106 |
{ |
108 |
Static3D midLeftMatrix= new Static3D(-mWidth/2,0,0); // matrix effects have their origin in the center!
|
|
107 |
Static3D midLeftMatrix= new Static3D(-mWidth/2,0,0); // matrix effects center is in the middle
|
|
109 | 108 |
Static3D midRight = new Static3D(mWidth,mHeight/2,0); // |
110 |
Static3D tadRight = new Static3D(3*mWidth/4,mHeight/2,0); // whereas vertex effects - in the bottom-left corner
|
|
109 |
Static3D tadRight = new Static3D(3*mWidth/4,mHeight/2,0); // vertex & fragment - in the lower-left
|
|
111 | 110 |
Static4D windRegion = new Static4D(0,0,0,mHeight); // |
112 | 111 |
|
113 | 112 |
setWind(0); |
114 | 113 |
|
115 |
effects.apply( new MatrixEffectShear(shearFactor,midLeftMatrix) ); |
|
116 | 114 |
effects.apply( new MatrixEffectScale(scaleFactor) ); |
115 |
effects.apply( new MatrixEffectShear(shearFactor,midLeftMatrix) ); |
|
116 |
|
|
117 | 117 |
effects.apply( new VertexEffectDeform(deformForce,midRight) ); |
118 | 118 |
effects.apply( new VertexEffectWave(windDynamic1, midRight, windRegion) ); |
119 | 119 |
effects.apply( new VertexEffectWave(windDynamic2, midRight, windRegion) ); |
Also available in: Unified diff
Fixes for the merge.