Project

General

Profile

« Previous | Next » 

Revision f2259427

Added by Leszek Koltunski over 1 year ago

Progress with Masterball.
Remaining: touch control's newRotation() function.

View differences:

src/main/java/org/distorted/objectlib/touchcontrol/TouchControlBall.java
139 139
    float B = 2*(vx*mCamera[0] + vy*mCamera[1] + vz*mCamera[2]);
140 140
    float C = (mCamera[0]*mCamera[0] + mCamera[1]*mCamera[1] + mCamera[2]*mCamera[2]) - R*R;
141 141

  
142
    float delta = B*B - 4*A*C;
143

  
144
    if( delta>=0 )
142
    if( B*B >= 4*A*C )
145 143
      {
146 144
      computeLongitudeAndLatitude(A,B,C);
147 145
      return true;
......
151 149
    }
152 150

  
153 151
///////////////////////////////////////////////////////////////////////////////////////////////////
152
// TODO
154 153

  
155 154
  public void newRotation(int[] output, Static4D rotatedTouchPoint, Static4D quat)
156 155
    {
157 156
    computeEnabledAxis();
158

  
159
    int rotIndex = 0; // TODO
160
    int row = 0;      // TODO
157
/*
158
    int rotIndex = computeRotationIndex( mCastedRotAxis[mLastTouchedFace], mMove2D, mEnabledRotAxis);
159
    float offset = computeOffset(mPoint2D, mCastedRotAxis[mLastTouchedFace][rotIndex]);
160
    int row      = computeRowFromOffset(mLastTouchedFace,rotIndex,offset);
161
*/
162
    int rotIndex = 0;
163
    int row = 0;
161 164

  
162 165
    output[0] = rotIndex;
163 166
    output[1] = row;

Also available in: Unified diff