Project

General

Profile

« Previous | Next » 

Revision e1cc59ff

Added by Leszek Koltunski 6 months ago

further fixes for ghosts

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObjectGhost.java
173 173
          if( mNumRot<maxU ) mNumRot = maxU;
174 174
          }
175 175

  
176

  
177
        android.util.Log.e("D", "nearest: "+mNumRot);
178

  
179 176
        return mNumRot*mGhostAngle;
180 177
        }
181 178
      }
......
190 187

  
191 188
  int onRemoveRotation(int axis, int rowBitmap, float angleInDegrees)
192 189
    {
193
    android.util.Log.e("D", "onRemove: "+angleInDegrees+" numRot: "+mNumRot+" inverted: "+mAxisInverted);
194

  
195 190
    int nonGhostAngle = (int)angleInDegrees;
196 191

  
197 192
    if( mGhostAngle !=0 && nonGhostAngle!=0 )
......
482 477
        {
483 478
        int index = (len-1)/2;
484 479
        mRowState[index] *= -1;
485
        mEffectAngle[index].set(m* mRowState[index]* mGhostAngle);
480
        mEffectAngle[index].set(m*mRowState[index]*mGhostAngle);
486 481
        }
487 482
      }
488 483

  
......
499 494

  
500 495
    if( newLevel!=0 )
501 496
      {
502
      Static4D quat = computeQuaternion(axis,newLevel* mGhostAngle);
497
      Static4D quat = computeQuaternion(axis,newLevel*mGhostAngle);
503 498
      mObject.rotateCameraQuat(quat);
504 499

  
500
      int m = mAxisInverted ? -1 : 1;
505 501
      int len = mRowState.length;
502

  
506 503
      for(int s=0; s<len; s++)
507 504
        {
508
        mRowState[s] = 0;
509
        mEffectAngle[s].set(0);
505
        mRowState[s] -= newLevel;
506
        mEffectAngle[s].set( m*mRowState[s]*mGhostAngle );
510 507
        }
511 508
      }
512 509
    }

Also available in: Unified diff