Project

General

Profile

« Previous | Next » 

Revision 012901f5

Added by Leszek Koltunski about 5 years ago

Invert the order of Matrix Effects. Now, just as in the other queues, the first matrix effect is actually the first to act on the object - not the other way around!

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueueMatrix.java
149 149
    Matrix.translateM(mViewMatrix, 0, -width*0.5f, -height*0.5f, -distance);
150 150
    if( mipmap!=1 ) Matrix.scaleM(mViewMatrix, 0, mipmap, mipmap, mipmap);
151 151

  
152
    for(int i=0; i<mNumEffects; i++) ((MatrixEffect)mEffects[i]).apply(mViewMatrix,mUniforms,i);
152
    for(int i=mNumEffects-1; i>=0; i--) ((MatrixEffect)mEffects[i]).apply(mViewMatrix,mUniforms,i);
153 153

  
154 154
    Matrix.translateM(mViewMatrix, 0, halfX,halfY,halfZ);
155 155
    Matrix.multiplyMM(mMVPMatrix, 0, projection, 0, mViewMatrix, 0);
src/main/java/org/distorted/library/type/Dynamic.java
613 613
 *
614 614
 * @param buffer Float buffer we will write the results to.
615 615
 * @param offset Offset in the buffer where to write the result.
616
 * @param time Time of interpolation. Time=0.0 would return the first Point, Time=0.5 - the last,
617
 *             time=1.0 - the first again, and time 0.1 would be 1/5 of the way between the first and the last Points.
618
 * @param step Time difference between now and the last time we called this function. Needed to figure out
619
 *             if the previous time we were called the effect wasn't finished yet, but now it is.
616
 * @param time   Time of interpolation. Time=0.0 would return the first Point, Time=0.5*mDuration - the
617
 *               last, time=1.0*mDuration - the first again, and time 0.1*mDuration would be 1/5 of the
618
 *               way between the first and the last Points.
619
 * @param step   Time difference between now and the last time we called this function. Needed to figure
620
 *               out if the previous time we were called the effect wasn't finished yet, but now it is.
620 621
 * @return true if the interpolation reached its end.
621 622
 */
622 623
  public boolean get(float[] buffer, int offset, long time, long step)

Also available in: Unified diff