Revision 40eef4b9
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/wind/WindEffectsManager.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
23 | 23 |
|
24 |
import org.distorted.library.DistortedObject; |
|
24 |
import org.distorted.library.DistortedEffectQueues; |
|
25 |
import org.distorted.library.DistortedTexture; |
|
25 | 26 |
import org.distorted.library.type.Dynamic; |
26 | 27 |
import org.distorted.library.type.Dynamic3D; |
27 | 28 |
import org.distorted.library.type.Dynamic5D; |
... | ... | |
47 | 48 |
|
48 | 49 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
49 | 50 |
|
50 |
WindEffectsManager(DistortedObject obj)
|
|
51 |
WindEffectsManager(DistortedTexture texture)
|
|
51 | 52 |
{ |
52 |
mHeight = obj.getHeight();
|
|
53 |
mWidth = obj.getWidth();
|
|
53 |
mHeight = texture.getHeight();
|
|
54 |
mWidth = texture.getWidth();
|
|
54 | 55 |
|
55 | 56 |
shearFactor = new Static3D(0,0,0); |
56 | 57 |
shearDynamic= new Dynamic3D(); |
... | ... | |
89 | 90 |
|
90 | 91 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
91 | 92 |
|
92 |
synchronized void apply(DistortedObject obj, int wind)
|
|
93 |
synchronized void apply(DistortedEffectQueues queues, int wind)
|
|
93 | 94 |
{ |
94 | 95 |
Static3D midLeft = new Static3D(0,mHeight/2,0); |
95 | 96 |
Static3D midRight = new Static3D(mWidth,mHeight/2,0); |
... | ... | |
97 | 98 |
|
98 | 99 |
setWind(wind); |
99 | 100 |
|
100 |
obj.shear(shearDynamic,midLeft);
|
|
101 |
obj.scale(scaleDynamic);
|
|
102 |
obj.deform(deformForce,midRight);
|
|
103 |
obj.wave(windDynamic1, midRight, windRegion);
|
|
104 |
obj.wave(windDynamic2, midRight, windRegion);
|
|
105 |
obj.wave(windDynamic3, midRight, windRegion);
|
|
101 |
queues.shear(shearDynamic,midLeft);
|
|
102 |
queues.scale(scaleDynamic);
|
|
103 |
queues.deform(deformForce,midRight);
|
|
104 |
queues.wave(windDynamic1, midRight, windRegion);
|
|
105 |
queues.wave(windDynamic2, midRight, windRegion);
|
|
106 |
queues.wave(windDynamic3, midRight, windRegion);
|
|
106 | 107 |
} |
107 | 108 |
|
108 | 109 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Beginnings of split of DistortedObject into two separate classes: DistortedEffectQueues and DistortedTexture.
Still does not compile, but pushing already.