Revision bdb341bc
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/EffectQueueFragment.java | ||
---|---|---|
89 | 89 |
|
90 | 90 |
if( mInter[1][i]!=null ) |
91 | 91 |
{ |
92 |
mInter[1][i].interpolateMain( mUniforms, NUM_UNIFORMS*i+4, mCurrentDuration[i]); |
|
92 |
mInter[1][i].interpolateMain( mUniforms, NUM_UNIFORMS*i+4, mCurrentDuration[i], step);
|
|
93 | 93 |
|
94 | 94 |
mUniforms[NUM_UNIFORMS*i+4] = mUniforms[NUM_UNIFORMS*i+4]-mObjHalfX; |
95 | 95 |
mUniforms[NUM_UNIFORMS*i+5] =-mUniforms[NUM_UNIFORMS*i+5]+mObjHalfY; |
96 | 96 |
} |
97 | 97 |
|
98 |
if( mInter[2][i]!=null ) mInter[2][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+1, mCurrentDuration[i]); |
|
98 |
if( mInter[2][i]!=null ) mInter[2][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+1, mCurrentDuration[i], step);
|
|
99 | 99 |
|
100 | 100 |
mCurrentDuration[i] += step; |
101 | 101 |
} |
... | ... | |
151 | 151 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
152 | 152 |
|
153 | 153 |
if( data instanceof Dynamic1D) |
154 |
{ |
|
154 | 155 |
mInter[0][mNumEffects] = (Dynamic1D)data; |
156 |
} |
|
155 | 157 |
else if( data instanceof Static1D ) |
156 | 158 |
{ |
157 | 159 |
mInter[0][mNumEffects] = null; |
... | ... | |
181 | 183 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
182 | 184 |
|
183 | 185 |
if( data instanceof Dynamic1D) |
186 |
{ |
|
184 | 187 |
mInter[0][mNumEffects] = (Dynamic1D)data; |
188 |
} |
|
185 | 189 |
else if( data instanceof Static1D ) |
186 | 190 |
{ |
187 | 191 |
mInter[0][mNumEffects] = null; |
... | ... | |
190 | 194 |
else return -1; |
191 | 195 |
|
192 | 196 |
if( region instanceof Dynamic4D) |
197 |
{ |
|
193 | 198 |
mInter[1][mNumEffects] = (Dynamic4D)region; |
199 |
} |
|
194 | 200 |
else if( region instanceof Static4D ) |
195 | 201 |
{ |
196 | 202 |
mInter[1][mNumEffects] = null; |
... | ... | |
219 | 225 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
220 | 226 |
|
221 | 227 |
if( level instanceof Dynamic1D) |
228 |
{ |
|
222 | 229 |
mInter[0][mNumEffects] = (Dynamic1D)level; |
230 |
} |
|
223 | 231 |
else if( level instanceof Static1D ) |
224 | 232 |
{ |
225 | 233 |
mInter[0][mNumEffects] = null; |
... | ... | |
241 | 249 |
else return -1; |
242 | 250 |
|
243 | 251 |
if( region instanceof Dynamic4D) |
252 |
{ |
|
244 | 253 |
mInter[1][mNumEffects] = (Dynamic4D)region; |
254 |
} |
|
245 | 255 |
else if( region instanceof Static4D ) |
246 | 256 |
{ |
247 | 257 |
mInter[1][mNumEffects] = null; |
... | ... | |
268 | 278 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
269 | 279 |
|
270 | 280 |
if( level instanceof Dynamic1D) |
281 |
{ |
|
271 | 282 |
mInter[0][mNumEffects] = (Dynamic1D)level; |
283 |
} |
|
272 | 284 |
else if( level instanceof Static1D ) |
273 | 285 |
{ |
274 | 286 |
mInter[0][mNumEffects] = null; |
Also available in: Unified diff
Dynamics: Introduce 2 Modes of operation:
- 'random access' mode, where we are able to call a single Dynamic from multiple thread simultaneously.
- 'sequential' mode, which only permits sequential interpolation from one client.
The second mode has an advantage when one needs to change mDuration: it keeps on interpolating smoothly. In the first mode, this is not possible.