Project

General

Profile

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

magiccube / src / main / java / org / distorted / bandaged / BandagedCreatorRenderer.java @ 13a3dfa9

1 9530f6b0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2 da56b12f Leszek Koltunski
// Copyright 2022 Leszek Koltunski                                                               //
3 9530f6b0 Leszek Koltunski
//                                                                                               //
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
package org.distorted.bandaged;
21
22 77efd5ad Leszek Koltunski
import javax.microedition.khronos.egl.EGLConfig;
23
import javax.microedition.khronos.opengles.GL10;
24
25 72e386ef Leszek Koltunski
import android.app.Activity;
26 7cb8d4b0 Leszek Koltunski
import android.opengl.GLES31;
27 9530f6b0 Leszek Koltunski
import android.opengl.GLSurfaceView;
28 72e386ef Leszek Koltunski
import android.widget.Toast;
29 9530f6b0 Leszek Koltunski
30 61a7b812 Leszek Koltunski
import org.distorted.dialogs.RubikDialogSaveBandaged;
31 7cb8d4b0 Leszek Koltunski
import org.distorted.library.effect.PostprocessEffectBorder;
32
import org.distorted.library.main.DistortedEffects;
33
import org.distorted.library.main.DistortedFramebuffer;
34 9530f6b0 Leszek Koltunski
import org.distorted.library.main.DistortedLibrary;
35 da56b12f Leszek Koltunski
import org.distorted.library.main.DistortedNode;
36 9530f6b0 Leszek Koltunski
import org.distorted.library.main.DistortedScreen;
37
38 20b60ad9 Leszek Koltunski
import org.distorted.library.main.InternalOutputSurface;
39 7cb8d4b0 Leszek Koltunski
import org.distorted.library.type.Static1D;
40 77efd5ad Leszek Koltunski
import org.distorted.library.type.Static3D;
41
import org.distorted.library.type.Static4D;
42 72e386ef Leszek Koltunski
import org.distorted.objectlib.json.JsonWriter;
43 7cb8d4b0 Leszek Koltunski
import org.distorted.objectlib.main.ShapeHexahedron;
44 72e386ef Leszek Koltunski
import org.distorted.objectlib.main.TwistyObject;
45
import org.distorted.objectlib.objects.TwistyBandagedGeneric;
46
import org.json.JSONException;
47
48
import java.io.File;
49
import java.io.FileNotFoundException;
50
import java.io.IOException;
51 7cb8d4b0 Leszek Koltunski
import java.nio.ByteBuffer;
52
import java.nio.ByteOrder;
53 9530f6b0 Leszek Koltunski
54
///////////////////////////////////////////////////////////////////////////////////////////////////
55
56
public class BandagedCreatorRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener
57
{
58 7cb8d4b0 Leszek Koltunski
   public static final float BRIGHTNESS = 0.333f;
59 e0b71e6e Leszek Koltunski
   private static final int DURATION = 1000;
60
61 903041cd Leszek Koltunski
   static final int COLOR_DEFAULT = 0xffffff55;
62
   static final int COLOR_MARKED  = 0xffff0000;
63
64
   static final float SCREEN_RATIO = 0.5f;
65
   static final float OBJECT_SIZE  = 3.0f;
66 9530f6b0 Leszek Koltunski
67 77efd5ad Leszek Koltunski
   private final float[][] POSITIONS = new float[][]
68 da56b12f Leszek Koltunski
        {
69 50ec342b Leszek Koltunski
          {-1,  1,  1},
70
          {-1,  1,  0},
71
          {-1,  1, -1},
72
          {-1,  0,  1},
73
          {-1,  0,  0},
74
          {-1,  0, -1},
75
          {-1, -1,  1},
76
          {-1, -1,  0},
77
          {-1, -1, -1},
78
          { 0, -1,  1},
79
          { 0, -1,  0},
80
          { 0,  1,  1},
81
          { 0,  1,  0},
82
          { 0,  1, -1},
83
          { 0,  0,  1},
84
          { 0,  0, -1},
85
          { 1,  1,  1},
86
          { 1,  1,  0},
87
          { 1,  1, -1},
88
          { 1,  0,  1},
89
          { 1,  0,  0},
90
          { 1, -1,  1},
91
          { 1,  0, -1},
92
          { 1, -1, -1},
93
          { 1, -1,  0},
94
          { 0, -1, -1},
95 da56b12f Leszek Koltunski
        };
96
97 75173f81 Leszek Koltunski
   private final BandagedCreatorView mView;
98
   private final DistortedScreen mScreen;
99
   private final Static3D mScale;
100
   private final BandagedCubit[] mCubits;
101 50ec342b Leszek Koltunski
   private final Static4D mQuatT, mQuatA;
102 75173f81 Leszek Koltunski
103 e0b71e6e Leszek Koltunski
   private boolean mInitialPhase;
104
   private long mStartTime;
105
   private float mScaleValue;
106 75173f81 Leszek Koltunski
   private float mX, mY, mZ, mW;
107 e0b71e6e Leszek Koltunski
   private boolean mResetQuats, mSetQuatT, mResettingObject;
108 7cb8d4b0 Leszek Koltunski
   private int mSaveIcon;
109
   private DistortedFramebuffer mFramebuffer;
110
   private String mPath;
111 da56b12f Leszek Koltunski
112 9530f6b0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
113
114
   BandagedCreatorRenderer(BandagedCreatorView v)
115
     {
116 50ec342b Leszek Koltunski
     mQuatT = new Static4D(0,0,0,1);
117
     mQuatA = new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f);
118 da56b12f Leszek Koltunski
119 9530f6b0 Leszek Koltunski
     mView = v;
120 77efd5ad Leszek Koltunski
121 e0b71e6e Leszek Koltunski
     mResetQuats     = false;
122
     mSetQuatT       = false;
123
     mResettingObject= false;
124 75173f81 Leszek Koltunski
125 7cb8d4b0 Leszek Koltunski
     mSaveIcon = -1;
126
127 9530f6b0 Leszek Koltunski
     mScreen = new DistortedScreen();
128
     mScreen.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f);
129 550db260 Leszek Koltunski
     mScale = new Static3D(1,1,1);
130
     mCubits= createCubits();
131 da56b12f Leszek Koltunski
     }
132
133 e0b71e6e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
134
135
   private boolean isAdjacent(float[] pos1, float[] pos2)
136
     {
137
     int len1 = pos1.length/3;
138
     int len2 = pos2.length/3;
139
140
     for(int i=0; i<len1; i++)
141
       for(int j=0; j<len2; j++)
142
         {
143
         float d0 = pos1[3*i  ] - pos2[3*j  ];
144
         float d1 = pos1[3*i+1] - pos2[3*j+1];
145
         float d2 = pos1[3*i+2] - pos2[3*j+2];
146
147
         if( d0*d0 + d1*d1 + d2*d2 == 1 ) return true;
148
         }
149
150
     return false;
151
     }
152
153 da56b12f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
154 a76cc4f4 Leszek Koltunski
155 da56b12f Leszek Koltunski
   private BandagedCubit[] createCubits()
156
     {
157
     int len = POSITIONS.length;
158
     BandagedCubit[] cubits = new BandagedCubit[len];
159
160
     for(int c=0; c<len; c++)
161
       {
162 50ec342b Leszek Koltunski
       cubits[c] = new BandagedCubit(POSITIONS[c],mQuatT,mQuatA,mScale,COLOR_DEFAULT);
163 da56b12f Leszek Koltunski
       }
164
165
     return cubits;
166 9530f6b0 Leszek Koltunski
     }
167 a76cc4f4 Leszek Koltunski
168 e0b71e6e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
169
170
   private void resetObject()
171
     {
172
     mView.resetCubits();
173
174
     int len = POSITIONS.length;
175
176
     for(int c=0; c<len; c++)
177
       {
178
       if( !mCubits[c].isAttached() )
179
         {
180
         mCubits[c].attach();
181
         mScreen.attach(mCubits[c].getNode());
182
         }
183
       if( mCubits[c].getPosition().length>3 )
184
         {
185
         mCubits[c].reset(mScaleValue);
186
         }
187
       }
188
     }
189
190 9530f6b0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
191
192
   @Override
193
   public void onDrawFrame(GL10 glUnused)
194
     {
195
     long time = System.currentTimeMillis();
196
     mScreen.render(time);
197 75173f81 Leszek Koltunski
198 50ec342b Leszek Koltunski
     if( mSetQuatT )
199 75173f81 Leszek Koltunski
       {
200 50ec342b Leszek Koltunski
       mSetQuatT = false;
201
       mQuatT.set(mX,mY,mZ,mW);
202 75173f81 Leszek Koltunski
       }
203
204
     if( mResetQuats )
205
       {
206
       mResetQuats = false;
207
208 50ec342b Leszek Koltunski
       float qx = mQuatT.get0();
209
       float qy = mQuatT.get1();
210
       float qz = mQuatT.get2();
211
       float qw = mQuatT.get3();
212 75173f81 Leszek Koltunski
213 50ec342b Leszek Koltunski
       float rx = mQuatA.get0();
214
       float ry = mQuatA.get1();
215
       float rz = mQuatA.get2();
216
       float rw = mQuatA.get3();
217 75173f81 Leszek Koltunski
218
       float tx = rw*qx - rz*qy + ry*qz + rx*qw;
219
       float ty = rw*qy + rz*qx + ry*qw - rx*qz;
220
       float tz = rw*qz + rz*qw - ry*qx + rx*qy;
221
       float tw = rw*qw - rz*qz - ry*qy - rx*qx;
222
223 50ec342b Leszek Koltunski
       mQuatT.set(0f, 0f, 0f, 1f);
224
       mQuatA.set(tx, ty, tz, tw);
225 75173f81 Leszek Koltunski
       }
226 e0b71e6e Leszek Koltunski
227
     if( mResettingObject )
228
       {
229
       boolean done = continueResetting(time);
230
       if( done ) mResettingObject = false;
231
       }
232 7cb8d4b0 Leszek Koltunski
233 eb6bccbd Leszek Koltunski
     if( mSaveIcon>=0 )
234
       {
235 f203ffa0 Leszek Koltunski
       renderIcon(time); // for some reason we need to call render() twice here, otherwise the
236
       mSaveIcon++;      // icon turns out black. Probably some problem with binding the texture.
237 eb6bccbd Leszek Koltunski
       }
238
     if( mSaveIcon>=2 )
239
       {
240
       saveIcon();
241
       mSaveIcon = -1;
242
       }
243 9530f6b0 Leszek Koltunski
     }
244
245
///////////////////////////////////////////////////////////////////////////////////////////////////
246
247
   @Override
248
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
249
      {
250 903041cd Leszek Koltunski
      final float Q = SCREEN_RATIO/OBJECT_SIZE;
251 550db260 Leszek Koltunski
      mScaleValue = width<height ? Q*width : Q*height;
252 a76cc4f4 Leszek Koltunski
253 c279ea6d Leszek Koltunski
      mScreen.detachAll();
254 a76cc4f4 Leszek Koltunski
      int len = POSITIONS.length;
255 13a3dfa9 Leszek Koltunski
      int touched = mView.getTouched();
256 a76cc4f4 Leszek Koltunski
257
      for(int i=0; i<len; i++)
258 28cb1607 Leszek Koltunski
        if( mCubits[i].isAttached() )
259
          {
260
          mCubits[i].scaleMove(mScaleValue);
261 13a3dfa9 Leszek Koltunski
          mCubits[i].setTexture( touched==i ? COLOR_MARKED : COLOR_DEFAULT);
262 28cb1607 Leszek Koltunski
          DistortedNode node = mCubits[i].getNode();
263
          mScreen.attach(node);
264
          }
265 c279ea6d Leszek Koltunski
266 550db260 Leszek Koltunski
      mScale.set( mScaleValue,mScaleValue,mScaleValue );
267 28cb1607 Leszek Koltunski
      mView.setScreenSize(width,height);
268 9530f6b0 Leszek Koltunski
      mScreen.resize(width,height);
269
      }
270
271
///////////////////////////////////////////////////////////////////////////////////////////////////
272
273
   @Override
274
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
275
      {
276
      DistortedLibrary.onSurfaceCreated(mView.getContext(),this,1);
277
      }
278
279
///////////////////////////////////////////////////////////////////////////////////////////////////
280
281
   public void distortedException(Exception ex)
282
     {
283
     android.util.Log.e("CREATOR", "unexpected exception: "+ex.getMessage() );
284
     }
285 550db260 Leszek Koltunski
286
///////////////////////////////////////////////////////////////////////////////////////////////////
287
288
   public BandagedCubit[] getCubits()
289
     {
290
     return mCubits;
291
     }
292
293
///////////////////////////////////////////////////////////////////////////////////////////////////
294
295
   public DistortedScreen getScreen()
296
     {
297
     return mScreen;
298
     }
299
300
///////////////////////////////////////////////////////////////////////////////////////////////////
301
302
   public void tryConnectingCubits(int index1, int index2)
303
     {
304
     if( index1!=index2 )
305
       {
306
       float[] pos1 = mCubits[index1].getPosition();
307
       float[] pos2 = mCubits[index2].getPosition();
308
309
       if( isAdjacent(pos1,pos2) )
310
         {
311 28cb1607 Leszek Koltunski
         mCubits[index2].join(pos1,mScaleValue);
312 550db260 Leszek Koltunski
         mCubits[index1].detach();
313 28cb1607 Leszek Koltunski
         mScreen.detach(mCubits[index1].getNode());
314 550db260 Leszek Koltunski
         }
315
       }
316
     }
317 75173f81 Leszek Koltunski
318
///////////////////////////////////////////////////////////////////////////////////////////////////
319
320 50ec342b Leszek Koltunski
   public Static4D getQuatAccu()
321
     {
322
     return mQuatA;
323
     }
324 75173f81 Leszek Koltunski
325
///////////////////////////////////////////////////////////////////////////////////////////////////
326
327 50ec342b Leszek Koltunski
   public void setQuatTemp(float x, float y, float z, float w)
328
     {
329
     mX = x;
330
     mY = y;
331
     mZ = z;
332
     mW = w;
333 75173f81 Leszek Koltunski
334 50ec342b Leszek Koltunski
     mSetQuatT = true;
335
     }
336 75173f81 Leszek Koltunski
337
///////////////////////////////////////////////////////////////////////////////////////////////////
338
339 50ec342b Leszek Koltunski
   public void resetQuats()
340
     {
341
     mResetQuats = true;
342
     }
343
344
///////////////////////////////////////////////////////////////////////////////////////////////////
345
346 e0b71e6e Leszek Koltunski
   public boolean isBusy()
347 50ec342b Leszek Koltunski
     {
348 e0b71e6e Leszek Koltunski
     return mResettingObject;
349
     }
350
351
///////////////////////////////////////////////////////////////////////////////////////////////////
352
353
   public void saveObject()
354 72e386ef Leszek Koltunski
     {
355
     int len = POSITIONS.length;
356
     int numAttached=0;
357
358
     for(int i=0; i<len; i++)
359
       if( mCubits[i].isAttached() ) numAttached++;
360
361
     float[][] pos = new float[numAttached][];
362
     int attached=0;
363
364
     for(int i=0; i<len; i++)
365
       if( mCubits[i].isAttached() )
366
         {
367
         pos[attached++] = mCubits[i].getPosition();
368
         }
369
370
     TwistyBandagedGeneric.setPositions(pos);
371 20b60ad9 Leszek Koltunski
     TwistyObject obj = new TwistyBandagedGeneric( new Static4D(0,0,0,1), 1.0f, TwistyObject.MODE_NORM);
372 72e386ef Leszek Koltunski
     BandagedCreatorActivity act = (BandagedCreatorActivity) mView.getContext();
373
374 e48ad1af Leszek Koltunski
     boolean success = createObjectJson(obj,act);
375 20b60ad9 Leszek Koltunski
     setupIconCreation(act);
376 e48ad1af Leszek Koltunski
377
     if( success )
378
       {
379
       act.addObject(obj.getShortName());
380
       }
381 72e386ef Leszek Koltunski
     }
382
383
///////////////////////////////////////////////////////////////////////////////////////////////////
384
385 e48ad1af Leszek Koltunski
   private boolean createObjectJson(TwistyObject object, Activity act)
386 72e386ef Leszek Koltunski
     {
387
     final String name = object.getShortName()+"_object.json";
388
     File file = new File(act.getFilesDir(), name);
389
     String filename = file.getAbsolutePath();
390
391
     try
392
       {
393
       JsonWriter writer = JsonWriter.getInstance();
394
       String json = writer.createObjectString(object,24);
395
       writer.write(filename,json);
396 e48ad1af Leszek Koltunski
       return true;
397 72e386ef Leszek Koltunski
       }
398
     catch(JSONException ex)
399
       {
400
       act.runOnUiThread(new Runnable()
401
         {
402
         public void run()
403
           {
404
           String message = "JSON Exception saving to \n\n"+filename+"\n\n failed:\n\n"+ex.getMessage();
405
           Toast.makeText(act,message,Toast.LENGTH_LONG).show();
406
           }
407
         });
408 e48ad1af Leszek Koltunski
409
       return false;
410 72e386ef Leszek Koltunski
       }
411
     catch(FileNotFoundException ex)
412
       {
413
       act.runOnUiThread(new Runnable()
414
         {
415
         public void run()
416
           {
417
           String message = "FileNotFound exception saving to \n\n"+filename+"\n\n failed:\n\n"+ex.getMessage();
418
           Toast.makeText(act,message,Toast.LENGTH_LONG).show();
419
           }
420
         });
421 e48ad1af Leszek Koltunski
422
       return false;
423 72e386ef Leszek Koltunski
       }
424
     catch(IOException ex)
425
       {
426
       act.runOnUiThread(new Runnable()
427
         {
428
         public void run()
429
           {
430
           String message = "IO exception saving to \n\n"+filename+"\n\n failed:\n\n"+ex.getMessage();
431
           Toast.makeText(act,message,Toast.LENGTH_LONG).show();
432
           }
433
         });
434 e48ad1af Leszek Koltunski
435
       return false;
436 72e386ef Leszek Koltunski
       }
437
     }
438
439
///////////////////////////////////////////////////////////////////////////////////////////////////
440 7cb8d4b0 Leszek Koltunski
441 20b60ad9 Leszek Koltunski
   private void setupIconCreation(Activity act)
442 72e386ef Leszek Koltunski
     {
443 f203ffa0 Leszek Koltunski
     final float R=1.0f;
444
     final int FBO_WIDTH  = (int)(R*240);
445
     final int FBO_HEIGHT = (int)(R*360);
446
     final float OBJECT_SIZE = R*0.38f;
447
448
     TwistyObject object = new TwistyBandagedGeneric(ShapeHexahedron.DEFAULT_ROT, OBJECT_SIZE, TwistyObject.MODE_ICON);
449 eb6bccbd Leszek Koltunski
     DistortedEffects effects = object.getObjectEffects();
450
     DistortedNode node = object.getNode();
451
452 20b60ad9 Leszek Koltunski
     if( mFramebuffer==null )
453
       {
454 f203ffa0 Leszek Koltunski
       mFramebuffer = new DistortedFramebuffer(FBO_WIDTH,FBO_HEIGHT,1, InternalOutputSurface.DEPTH_NO_STENCIL);
455
       mFramebuffer.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f);
456 20b60ad9 Leszek Koltunski
       }
457 7cb8d4b0 Leszek Koltunski
458 20b60ad9 Leszek Koltunski
     mFramebuffer.detachAll();
459
     mFramebuffer.attach(node);
460 7cb8d4b0 Leszek Koltunski
461
     Static1D halo = new Static1D(5);
462
     Static4D color = new Static4D(0,0,0,1);
463
     PostprocessEffectBorder border = new PostprocessEffectBorder(halo,color);
464
     border.setHaloDepth(false);
465
     effects.apply(border);
466
467
     final String name = object.getShortName()+".png";
468
     File file = new File(act.getFilesDir(), name);
469
     String filename = file.getAbsolutePath();
470
471
     mSaveIcon = 0;
472
     mPath = filename;
473 72e386ef Leszek Koltunski
     }
474 7cb8d4b0 Leszek Koltunski
475
///////////////////////////////////////////////////////////////////////////////////////////////////
476
477 eb6bccbd Leszek Koltunski
   private void renderIcon(long time)
478
     {
479
     mFramebuffer.render(time);
480
     }
481 7cb8d4b0 Leszek Koltunski
482 eb6bccbd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
483 7cb8d4b0 Leszek Koltunski
484 eb6bccbd Leszek Koltunski
   private void saveIcon()
485
     {
486
     int fW = mFramebuffer.getWidth();
487
     int fH = mFramebuffer.getHeight();
488 7cb8d4b0 Leszek Koltunski
489 eb6bccbd Leszek Koltunski
     ByteBuffer buf = ByteBuffer.allocateDirect(fW*fH*4);
490
     buf.order(ByteOrder.LITTLE_ENDIAN);
491
492
     mFramebuffer.setAsReadFramebuffer(0);
493
     GLES31.glReadBuffer(GLES31.GL_COLOR_ATTACHMENT0);
494
     GLES31.glReadPixels( 0, 0, fW, fH, GLES31.GL_RGBA, GLES31.GL_UNSIGNED_BYTE, buf);
495
     BandagedCreatorWorkerThread.newBuffer(buf,fW,fH,6,mPath);
496
     GLES31.glBindFramebuffer(GLES31.GL_READ_FRAMEBUFFER, 0);
497
498
     mSaveIcon = -1;
499
     }
500 7cb8d4b0 Leszek Koltunski
501 72e386ef Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
502
503
   public void displaySavingDialog()
504 e0b71e6e Leszek Koltunski
     {
505 61a7b812 Leszek Koltunski
     BandagedCreatorActivity act = (BandagedCreatorActivity)mView.getContext();
506
     RubikDialogSaveBandaged saveDiag = new RubikDialogSaveBandaged();
507
     saveDiag.show(act.getSupportFragmentManager(), null);
508 e0b71e6e Leszek Koltunski
     }
509
510
///////////////////////////////////////////////////////////////////////////////////////////////////
511
512
   public void setupReset()
513
     {
514
     mResettingObject = true;
515
     mInitialPhase    = true;
516
     mStartTime       = System.currentTimeMillis();
517
     }
518
519
///////////////////////////////////////////////////////////////////////////////////////////////////
520
521
   public boolean continueResetting(long time)
522
     {
523
     long diff = time-mStartTime;
524
     float quotient = ((float)diff)/DURATION;
525
526
     if( mInitialPhase && quotient>0.5f )
527
       {
528
       mInitialPhase=false;
529
       resetObject();
530
       }
531
532
     double angle = 2*Math.PI*quotient*quotient*(3-2*quotient);
533
534
     float sinA = (float)Math.sin(angle);
535
     float cosA = (float)Math.cos(angle);
536
537
     mQuatT.set(0, -sinA, 0, cosA);
538 50ec342b Leszek Koltunski
539 e0b71e6e Leszek Koltunski
     return quotient>1.0f;
540 50ec342b Leszek Koltunski
     }
541 9530f6b0 Leszek Koltunski
}