Revision 69ed1eb4
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/EffectQueueMatrix.java | ||
---|---|---|
204 | 204 |
return mMVPMatrix; |
205 | 205 |
} |
206 | 206 |
|
207 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
208 |
// return true if in the queue there are only translations, scales, x- and y-shears, and rotations along |
|
209 |
// a vector which is perpendicular to the screen, i.e. if the resulting matrix keeps the front wall of the |
|
210 |
// Mesh parallel to the screen. |
|
211 |
|
|
212 |
boolean canUseShortcut() |
|
213 |
{ |
|
214 |
for(int i=0; i<mNumEffects; i++) |
|
215 |
{ |
|
216 |
if (mName[i] == EffectNames.ROTATE.ordinal() ) |
|
217 |
{ |
|
218 |
if( mUniforms[NUM_UNIFORMS*i] != 0.0f || mUniforms[NUM_UNIFORMS*i+1] != 0.0f ) return false; // rotation along vector with x or y non-zero |
|
219 |
} |
|
220 |
else if(mName[i] == EffectNames.QUATERNION.ordinal() ) |
|
221 |
{ |
|
222 |
if( mUniforms[NUM_UNIFORMS*i] != 0.0f || mUniforms[NUM_UNIFORMS*i+1] != 0.0f ) return false; // quaternion rotation along vector with x or y non-zero |
|
223 |
} |
|
224 |
else if(mName[i] == EffectNames.SHEAR.ordinal() ) |
|
225 |
{ |
|
226 |
if( mUniforms[NUM_UNIFORMS*i+2] != 0.0f ) return false; // shear with non-zero Z |
|
227 |
} |
|
228 |
} |
|
229 |
|
|
230 |
return true; |
|
231 |
} |
|
232 |
|
|
207 | 233 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
208 | 234 |
|
209 | 235 |
synchronized void compute(long currTime) |
Also available in: Unified diff
Progress with getting Mesh'es bounding rectangle.