Project

General

Profile

Download (16.4 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objectlib / Movement.java @ 588ace55

1 27a70eae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 588ace55 Leszek Koltunski
package org.distorted.objectlib;
21 27a70eae Leszek Koltunski
22 efef689c Leszek Koltunski
import org.distorted.library.type.Static2D;
23 37a25788 Leszek Koltunski
import org.distorted.library.type.Static3D;
24 27a70eae Leszek Koltunski
import org.distorted.library.type.Static4D;
25
26
///////////////////////////////////////////////////////////////////////////////////////////////////
27
28 ca3300c3 Leszek Koltunski
public abstract class Movement
29 27a70eae Leszek Koltunski
  {
30 967c1d17 Leszek Koltunski
  // it doesn't matter where we touch a face - the list of enabled rotAxis will always be the same
31 bdbbb4c5 Leszek Koltunski
  public static final int TYPE_NOT_SPLIT    = 0;
32 967c1d17 Leszek Koltunski
  // each face is split into several parts by lines coming from its center to the midpoints of each edge
33 bdbbb4c5 Leszek Koltunski
  public static final int TYPE_SPLIT_EDGE   = 1;
34 967c1d17 Leszek Koltunski
  // each face is split into several parts by lines coming from its center to the vertices
35 bdbbb4c5 Leszek Koltunski
  public static final int TYPE_SPLIT_CORNER = 2;
36 967c1d17 Leszek Koltunski
37 ee39837d Leszek Koltunski
  static final float SQ3 = (float)Math.sqrt(3);
38
  static final float SQ6 = (float)Math.sqrt(6);
39
40 12313693 Leszek Koltunski
  private final int mNumFaceAxis;
41
  private final float[] mPoint, mCamera, mTouch;
42
  private final float[] mPoint2D, mMove2D;
43
  private final int[] mEnabledRotAxis;
44 4946b635 Leszek Koltunski
  private final float mDistanceCenterFace3D;
45 12313693 Leszek Koltunski
  private final Static3D[] mFaceAxis;
46
47
  private int mLastTouchedFace;
48 935f3663 Leszek Koltunski
  private float[][][] mCastedRotAxis;
49
  private Static4D[][] mCastedRotAxis4D;
50 4946b635 Leszek Koltunski
  private float[][] mTouchBorders, mA, mB;
51 dd65ead3 Leszek Koltunski
52 967c1d17 Leszek Koltunski
  private final int mType;
53
  private final int[][][] mEnabled;
54
55 dd65ead3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57 967c1d17 Leszek Koltunski
  abstract int returnPart(int type, int face, float[] touchPoint);
58 cc99cf91 Leszek Koltunski
  abstract boolean isInsideFace(int face, float[] point);
59 1ded8771 Leszek Koltunski
  public abstract float returnRotationFactor(int numLayers, int row);
60 dd65ead3 Leszek Koltunski
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62
63 967c1d17 Leszek Koltunski
  Movement(Static3D[] rotAxis, Static3D[] faceAxis, float[][] cuts, boolean[][] rotatable,
64 7ee89540 Leszek Koltunski
           float distance3D, int size, int type, int[][][] enabled)
65 dd65ead3 Leszek Koltunski
    {
66
    mPoint = new float[3];
67
    mCamera= new float[3];
68
    mTouch = new float[3];
69
70 14a4712f Leszek Koltunski
    mPoint2D = new float[2];
71
    mMove2D  = new float[2];
72 bef47287 Leszek Koltunski
73 967c1d17 Leszek Koltunski
    mType = type;
74
    mEnabled = enabled;
75
76 ad38d800 Leszek Koltunski
    mFaceAxis   = faceAxis;
77
    mNumFaceAxis= mFaceAxis.length;
78
79 fb377dae Leszek Koltunski
    mEnabledRotAxis = new int[rotAxis.length+1];
80
81 14a4712f Leszek Koltunski
    mDistanceCenterFace3D = distance3D; // distance from the center of the object to each of its faces
82
83 ee39837d Leszek Koltunski
    computeCastedAxis(rotAxis);
84 4946b635 Leszek Koltunski
    computeBorders(cuts,rotatable,size);
85
    computeLinear(distance3D,rotAxis,faceAxis);
86 ee39837d Leszek Koltunski
    }
87
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89
// mCastedRotAxis[1][2]{0,1} are the 2D coords of the 2nd rotAxis cast onto the face defined by the
90
// 1st faceAxis.
91
92
  private void computeCastedAxis(Static3D[] rotAxis)
93
    {
94 935f3663 Leszek Koltunski
    mCastedRotAxis   = new float[mNumFaceAxis][rotAxis.length][2];
95
    mCastedRotAxis4D = new Static4D[mNumFaceAxis][rotAxis.length];
96
97
    float fx,fy,fz,f;
98 14a4712f Leszek Koltunski
99 fb377dae Leszek Koltunski
    for( int casted=0; casted<rotAxis.length; casted++)
100 14a4712f Leszek Koltunski
      {
101 faa3aed0 Leszek Koltunski
      Static3D a = rotAxis[casted];
102 14a4712f Leszek Koltunski
      mPoint[0]= a.get0();
103
      mPoint[1]= a.get1();
104
      mPoint[2]= a.get2();
105
106 faa3aed0 Leszek Koltunski
      for( int face=0; face<mNumFaceAxis; face++)
107
        {
108 935f3663 Leszek Koltunski
        convertTo2Dcoords( mPoint, mFaceAxis[face], mCastedRotAxis[face][casted]);
109
        normalize2D(mCastedRotAxis[face][casted]);
110
111 ee39837d Leszek Koltunski
        fx = mFaceAxis[face].get0();
112
        fy = mFaceAxis[face].get1();
113
        fz = mFaceAxis[face].get2();
114 935f3663 Leszek Koltunski
        f  = mPoint[0]*fx + mPoint[1]*fy + mPoint[2]*fz;
115
        mCastedRotAxis4D[face][casted] = new Static4D( mPoint[0]-f*fx, mPoint[1]-f*fy, mPoint[2]-f*fz, 0);
116 faa3aed0 Leszek Koltunski
        }
117 14a4712f Leszek Koltunski
      }
118
    }
119
120
///////////////////////////////////////////////////////////////////////////////////////////////////
121
122
  private void normalize2D(float[] vect)
123
    {
124
    float len = (float)Math.sqrt(vect[0]*vect[0] + vect[1]*vect[1]);
125
    vect[0] /= len;
126
    vect[1] /= len;
127
    }
128
129
///////////////////////////////////////////////////////////////////////////////////////////////////
130
// find the casted axis with which our move2D vector forms an angle closest to 90 deg.
131
132 fb377dae Leszek Koltunski
  private int computeRotationIndex(int faceAxis, float[] move2D, int[] enabled)
133 14a4712f Leszek Koltunski
    {
134
    float cosAngle, minCosAngle = Float.MAX_VALUE;
135 cf097581 Leszek Koltunski
    int minIndex=0, index;
136 14a4712f Leszek Koltunski
    float m0 = move2D[0];
137
    float m1 = move2D[1];
138
    float len = (float)Math.sqrt(m0*m0 + m1*m1);
139 b972c160 Leszek Koltunski
140
    if( len!=0.0f )
141
      {
142
      m0 /= len;
143
      m1 /= len;
144
      }
145
    else
146
      {
147
      m0 = 1.0f;  // arbitrarily
148
      m1 = 0.0f;  //
149
      }
150 14a4712f Leszek Koltunski
151 fb377dae Leszek Koltunski
    int numAxis = enabled[0];
152
153
    for(int axis=1; axis<=numAxis; axis++)
154 14a4712f Leszek Koltunski
      {
155 fb377dae Leszek Koltunski
      index = enabled[axis];
156 935f3663 Leszek Koltunski
      cosAngle = m0*mCastedRotAxis[faceAxis][index][0] + m1*mCastedRotAxis[faceAxis][index][1];
157 fb377dae Leszek Koltunski
      if( cosAngle<0 ) cosAngle = -cosAngle;
158 faa3aed0 Leszek Koltunski
159 fb377dae Leszek Koltunski
      if( cosAngle<minCosAngle )
160 14a4712f Leszek Koltunski
        {
161 fb377dae Leszek Koltunski
        minCosAngle=cosAngle;
162
        minIndex = index;
163 14a4712f Leszek Koltunski
        }
164
      }
165
166
    return minIndex;
167
    }
168
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170 da178c88 Leszek Koltunski
// in the center of the face offset is always 0 regardless of the axis
171 14a4712f Leszek Koltunski
172
  private float computeOffset(float[] point, float[] axis)
173
    {
174 da178c88 Leszek Koltunski
    return point[0]*axis[0] + point[1]*axis[1];
175 dd65ead3 Leszek Koltunski
    }
176
177 37a25788 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
178
179 faa3aed0 Leszek Koltunski
  private boolean faceIsVisible(Static3D faceAxis)
180 37a25788 Leszek Koltunski
    {
181 faa3aed0 Leszek Koltunski
    float castCameraOnAxis = mCamera[0]*faceAxis.get0() + mCamera[1]*faceAxis.get1() + mCamera[2]*faceAxis.get2();
182
    return castCameraOnAxis > mDistanceCenterFace3D;
183 37a25788 Leszek Koltunski
    }
184
185
///////////////////////////////////////////////////////////////////////////////////////////////////
186
// given precomputed mCamera and mPoint, respectively camera and touch point positions in ScreenSpace,
187
// compute point 'output[]' which:
188 cc99cf91 Leszek Koltunski
// 1) lies on a face of the Object, i.e. surface defined by (axis, distance from (0,0,0))
189 37a25788 Leszek Koltunski
// 2) is co-linear with mCamera and mPoint
190
//
191
// output = camera + alpha*(point-camera), where alpha = [dist-axis*camera] / [axis*(point-camera)]
192
193 faa3aed0 Leszek Koltunski
  private void castTouchPointOntoFace(Static3D faceAxis, float[] output)
194 37a25788 Leszek Koltunski
    {
195
    float d0 = mPoint[0]-mCamera[0];
196
    float d1 = mPoint[1]-mCamera[1];
197
    float d2 = mPoint[2]-mCamera[2];
198 faa3aed0 Leszek Koltunski
    float a0 = faceAxis.get0();
199
    float a1 = faceAxis.get1();
200
    float a2 = faceAxis.get2();
201 37a25788 Leszek Koltunski
202
    float denom = a0*d0 + a1*d1 + a2*d2;
203
204
    if( denom != 0.0f )
205
      {
206
      float axisCam = a0*mCamera[0] + a1*mCamera[1] + a2*mCamera[2];
207 a76d9cb4 Leszek Koltunski
      float alpha = (mDistanceCenterFace3D-axisCam)/denom;
208 37a25788 Leszek Koltunski
209
      output[0] = mCamera[0] + d0*alpha;
210
      output[1] = mCamera[1] + d1*alpha;
211
      output[2] = mCamera[2] + d2*alpha;
212
      }
213
    }
214
215 bef47287 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
216
// Convert the 3D point3D into a 2D point on the same face surface, but in a different
217
// coordinate system: a in-plane 2D coord where the origin is in the point where the axis intersects
218
// the surface, and whose Y axis points 'north' i.e. is in the plane given by the 3D origin, the
219
// original 3D Y axis and our 2D in-plane origin.
220
// If those 3 points constitute a degenerate triangle which does not define a plane - which can only
221
// happen if axis is vertical (or in theory when 2D origin and 3D origin meet, but that would have to
222
// mean that the distance between the center of the Object and its faces is 0) - then we arbitrarily
223
// decide that 2D Y = (0,0,-1) in the North Pole and (0,0,1) in the South Pole)
224
225 faa3aed0 Leszek Koltunski
  private void convertTo2Dcoords(float[] point3D, Static3D faceAxis, float[] output)
226 bef47287 Leszek Koltunski
    {
227 cad4b4d6 Leszek Koltunski
    float y0,y1,y2; // base Y vector of the 2D coord system
228 faa3aed0 Leszek Koltunski
    float a0 = faceAxis.get0();
229
    float a1 = faceAxis.get1();
230
    float a2 = faceAxis.get2();
231 bef47287 Leszek Koltunski
232
    if( a0==0.0f && a2==0.0f )
233
      {
234
      y0=0; y1=0; y2=-a1;
235
      }
236
    else if( a1==0.0f )
237
      {
238
      y0=0; y1=1; y2=0;
239
      }
240
    else
241
      {
242
      float norm = (float)(-a1/Math.sqrt(1-a1*a1));
243 8e2295ad Leszek Koltunski
      y0 = norm*a0; y1= norm*(a1-1/a1); y2=norm*a2;
244 bef47287 Leszek Koltunski
      }
245
246 cad4b4d6 Leszek Koltunski
    float x0 = y1*a2 - y2*a1;  //
247
    float x1 = y2*a0 - y0*a2;  // (2D coord baseY) x (axis) = 2D coord baseX
248
    float x2 = y0*a1 - y1*a0;  //
249 bef47287 Leszek Koltunski
250
    float originAlpha = point3D[0]*a0 + point3D[1]*a1 + point3D[2]*a2;
251
252
    float origin0 = originAlpha*a0; // coords of the point where axis
253
    float origin1 = originAlpha*a1; // intersects surface plane i.e.
254
    float origin2 = originAlpha*a2; // the origin of our 2D coord system
255
256
    float v0 = point3D[0] - origin0;
257
    float v1 = point3D[1] - origin1;
258
    float v2 = point3D[2] - origin2;
259
260
    output[0] = v0*x0 + v1*x1 + v2*x2;
261
    output[1] = v0*y0 + v1*y1 + v2*y2;
262
    }
263
264 ef018c1b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
265
266 4946b635 Leszek Koltunski
  private float[] computeBorder(float[] cuts, boolean[] rotatable, int size)
267 ef018c1b Leszek Koltunski
    {
268
    int len = cuts.length;
269
    float[] border = new float[len];
270
271
    for(int i=0; i<len; i++)
272
      {
273
      if( !rotatable[i] )
274
        {
275
        border[i] = i>0 ? border[i-1] : -Float.MAX_VALUE;
276
        }
277
      else
278
        {
279 4946b635 Leszek Koltunski
        if( rotatable[i+1] ) border[i] = cuts[i]/size;
280 ef018c1b Leszek Koltunski
        else
281
          {
282
          int found = -1;
283
284
          for(int j=i+2; j<=len; j++)
285
            {
286
            if( rotatable[j] )
287
              {
288
              found=j;
289
              break;
290
              }
291
            }
292
293 4946b635 Leszek Koltunski
          border[i] = found>0 ? (cuts[i]+cuts[found-1])/(2*size) : Float.MAX_VALUE;
294 ef018c1b Leszek Koltunski
          }
295
        }
296
      }
297
298
    return border;
299
    }
300
301
///////////////////////////////////////////////////////////////////////////////////////////////////
302 4946b635 Leszek Koltunski
// size, not numLayers (see Master Skewb where size!=numLayers)
303 ef018c1b Leszek Koltunski
304 4946b635 Leszek Koltunski
  void computeBorders(float[][] cuts, boolean[][] rotatable, int size)
305 ef018c1b Leszek Koltunski
    {
306
    int numCuts = cuts.length;
307 4946b635 Leszek Koltunski
    mTouchBorders = new float[numCuts][];
308 ef018c1b Leszek Koltunski
309
    for(int i=0; i<numCuts; i++)
310
      {
311 4946b635 Leszek Koltunski
      mTouchBorders[i] = computeBorder(cuts[i],rotatable[i],size);
312
      }
313
    }
314
315
///////////////////////////////////////////////////////////////////////////////////////////////////
316
317
  private int computeSign(Static3D a, Static3D b)
318
    {
319
    float a1 = a.get0();
320
    float a2 = a.get1();
321
    float a3 = a.get2();
322
    float b1 = b.get0();
323
    float b2 = b.get1();
324
    float b3 = b.get2();
325
326
    return a1*b1+a2*b2+a3*b3 < 0 ? 1:-1;
327
    }
328
329
///////////////////////////////////////////////////////////////////////////////////////////////////
330
331
  private float crossProductLen(Static3D a, Static3D b)
332
    {
333
    float a1 = a.get0();
334
    float a2 = a.get1();
335
    float a3 = a.get2();
336
    float b1 = b.get0();
337
    float b2 = b.get1();
338
    float b3 = b.get2();
339
340
    float x1 = a2*b3-a3*b2;
341
    float x2 = a3*b1-a1*b3;
342
    float x3 = a1*b2-a2*b1;
343
344
    return (float)Math.sqrt(x1*x1 + x2*x2 + x3*x3);
345
    }
346
347
///////////////////////////////////////////////////////////////////////////////////////////////////
348
// compute the array of 'A' and 'B' coeffs of the Ax+B linear function by which we need to multiply
349
// the 3D 'cuts' to translate it from 3D (i.e. with respect to the rotAxis) to 2D in-face (i.e. with
350
// respect to the 2D rotAxis cast into a particular face)
351
352 a76d9cb4 Leszek Koltunski
  private void computeLinear(float distance3D, Static3D[] rotAxis, Static3D[] faceAxis)
353 4946b635 Leszek Koltunski
    {
354
    int numFaces = faceAxis.length;
355
    int numRot   = rotAxis.length;
356
357
    mA = new float[numFaces][numRot];
358
    mB = new float[numFaces][numRot];
359
360
    for(int i=0; i<numFaces; i++)
361
      for(int j=0; j<numRot; j++)
362
        {
363
        mA[i][j] = crossProductLen(faceAxis[i],rotAxis[j]);
364
365
        if( mA[i][j]!=0.0f )
366
          {
367
          float coeff = (float)Math.sqrt(1/(mA[i][j]*mA[i][j]) -1);
368
          int sign = computeSign(faceAxis[i],rotAxis[j]);
369
          mB[i][j] = sign*distance3D*coeff;
370
          }
371
        else mB[i][j] = 0.0f;
372
        }
373
    }
374
375
///////////////////////////////////////////////////////////////////////////////////////////////////
376
377
  private int computeRowFromOffset(int face, int axisIndex, float offset)
378
    {
379
    float[] borders = mTouchBorders[axisIndex];
380
    int len = borders.length;
381
    float A = mA[face][axisIndex];
382
383
    if( A!=0.0f )
384
      {
385
      float B = mB[face][axisIndex];
386
387
      for(int i=0; i<len; i++)
388
        {
389
        float translated = B + borders[i]/A;
390
        if( offset<translated ) return i;
391
        }
392 ef018c1b Leszek Koltunski
      }
393
394 4946b635 Leszek Koltunski
    return len;
395 ef018c1b Leszek Koltunski
    }
396
397 967c1d17 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
398
399
  void computeEnabledAxis(int face, float[] touchPoint, int[] enabled)
400
    {
401
    int part = returnPart(mType,face,touchPoint);
402
403 7ee89540 Leszek Koltunski
    int num = mEnabled[face][0].length;
404 967c1d17 Leszek Koltunski
    enabled[0] = num;
405
    System.arraycopy(mEnabled[face][part], 0, enabled, 1, num);
406
    }
407
408 dd65ead3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
409
// PUBLIC API
410
///////////////////////////////////////////////////////////////////////////////////////////////////
411
412 c7c83fb7 Leszek Koltunski
  public boolean faceTouched(Static4D rotatedTouchPoint, Static4D rotatedCamera, float objectRatio)
413 dd65ead3 Leszek Koltunski
    {
414 c7b00dfb Leszek Koltunski
    mPoint[0]  = rotatedTouchPoint.get0()/objectRatio;
415
    mPoint[1]  = rotatedTouchPoint.get1()/objectRatio;
416
    mPoint[2]  = rotatedTouchPoint.get2()/objectRatio;
417
418
    mCamera[0] = rotatedCamera.get0()/objectRatio;
419
    mCamera[1] = rotatedCamera.get1()/objectRatio;
420
    mCamera[2] = rotatedCamera.get2()/objectRatio;
421 dd65ead3 Leszek Koltunski
422 fb377dae Leszek Koltunski
    for( mLastTouchedFace=0; mLastTouchedFace<mNumFaceAxis; mLastTouchedFace++)
423 dd65ead3 Leszek Koltunski
      {
424 fb377dae Leszek Koltunski
      if( faceIsVisible(mFaceAxis[mLastTouchedFace]) )
425 dd65ead3 Leszek Koltunski
        {
426 fb377dae Leszek Koltunski
        castTouchPointOntoFace(mFaceAxis[mLastTouchedFace], mTouch);
427
        convertTo2Dcoords(mTouch, mFaceAxis[mLastTouchedFace], mPoint2D);
428 cc99cf91 Leszek Koltunski
        if( isInsideFace(mLastTouchedFace,mPoint2D) ) return true;
429 dd65ead3 Leszek Koltunski
        }
430
      }
431
432
    return false;
433
    }
434
435
///////////////////////////////////////////////////////////////////////////////////////////////////
436
437 4946b635 Leszek Koltunski
  public Static2D newRotation(Static4D rotatedTouchPoint, float objectRatio)
438 dd65ead3 Leszek Koltunski
    {
439 c7b00dfb Leszek Koltunski
    mPoint[0] = rotatedTouchPoint.get0()/objectRatio;
440
    mPoint[1] = rotatedTouchPoint.get1()/objectRatio;
441
    mPoint[2] = rotatedTouchPoint.get2()/objectRatio;
442 dd65ead3 Leszek Koltunski
443 fb377dae Leszek Koltunski
    castTouchPointOntoFace(mFaceAxis[mLastTouchedFace], mTouch);
444
    convertTo2Dcoords(mTouch, mFaceAxis[mLastTouchedFace], mMove2D);
445 14a4712f Leszek Koltunski
446
    mMove2D[0] -= mPoint2D[0];
447
    mMove2D[1] -= mPoint2D[1];
448
449 fb377dae Leszek Koltunski
    computeEnabledAxis(mLastTouchedFace, mPoint2D, mEnabledRotAxis);
450
    int rotIndex = computeRotationIndex(mLastTouchedFace, mMove2D, mEnabledRotAxis);
451 935f3663 Leszek Koltunski
    float offset = computeOffset(mPoint2D, mCastedRotAxis[mLastTouchedFace][rotIndex]);
452 4946b635 Leszek Koltunski
    int row      = computeRowFromOffset(mLastTouchedFace,rotIndex,offset);
453 dd65ead3 Leszek Koltunski
454 ee39837d Leszek Koltunski
    return new Static2D(rotIndex,row);
455 dd65ead3 Leszek Koltunski
    }
456 473611ee Leszek Koltunski
457 935f3663 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
458
459
  public Static4D getCastedRotAxis(int rotIndex)
460
    {
461
    return mCastedRotAxis4D[mLastTouchedFace][rotIndex];
462
    }
463
464 473611ee Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
465
466
  public int getTouchedFace()
467
    {
468 fb377dae Leszek Koltunski
    return mLastTouchedFace;
469 473611ee Leszek Koltunski
    }
470
471
///////////////////////////////////////////////////////////////////////////////////////////////////
472
473 9621255f Leszek Koltunski
  public float[] getTouchedPoint3D()
474 473611ee Leszek Koltunski
    {
475 9621255f Leszek Koltunski
    return mTouch;
476 473611ee Leszek Koltunski
    }
477 27a70eae Leszek Koltunski
  }