Project

General

Profile

Download (16.1 KB) Statistics
| Branch: | Revision:

examples / src / main / java / org / distorted / examples / meshfile / MeshFileRenderer.java @ 45b6b6b5

1 42aa970f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// Distorted 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
// Distorted 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 Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20
package org.distorted.examples.meshfile;
21
22 1af8e143 Leszek Koltunski
import android.content.Context;
23
import android.content.res.Resources;
24 42aa970f Leszek Koltunski
import android.graphics.Bitmap;
25
import android.graphics.Canvas;
26
import android.graphics.Paint;
27
import android.opengl.GLSurfaceView;
28
29 8ac4c0bc Leszek Koltunski
import org.distorted.examples.R;
30 a65604a7 Leszek Koltunski
import org.distorted.library.effect.Effect;
31 6991ece5 Leszek Koltunski
import org.distorted.library.effect.EffectType;
32 42aa970f Leszek Koltunski
import org.distorted.library.effect.MatrixEffectQuaternion;
33
import org.distorted.library.effect.MatrixEffectScale;
34 39b925d5 Leszek Koltunski
import org.distorted.library.effect.VertexEffectDisappear;
35 42aa970f Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
36
import org.distorted.library.main.DistortedLibrary;
37
import org.distorted.library.main.DistortedScreen;
38
import org.distorted.library.main.DistortedTexture;
39 6991ece5 Leszek Koltunski
import org.distorted.library.mesh.MeshBase;
40 1af8e143 Leszek Koltunski
import org.distorted.library.mesh.MeshFile;
41 b2adcd57 Leszek Koltunski
import org.distorted.library.mesh.MeshMultigon;
42 1bb5d3b7 Leszek Koltunski
import org.distorted.library.mesh.MeshPolygon;
43 42aa970f Leszek Koltunski
import org.distorted.library.type.DynamicQuat;
44
import org.distorted.library.type.Static3D;
45
import org.distorted.library.type.Static4D;
46
47 1bb5d3b7 Leszek Koltunski
import org.distorted.objectlib.helpers.FactoryCubit;
48 0dee575b Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectFaceShape;
49
import org.distorted.objectlib.helpers.ObjectShape;
50 acb2aaae Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectVertexEffects;
51 2f250195 Leszek Koltunski
import org.distorted.objectlib.main.InitData;
52 d32fe3d9 Leszek Koltunski
import org.distorted.objectlib.main.TwistyObject;
53 cfbd047c Leszek Koltunski
import org.distorted.objectlib.objects.*;
54 1bb5d3b7 Leszek Koltunski
55 1af8e143 Leszek Koltunski
import java.io.DataInputStream;
56
import java.io.IOException;
57
import java.io.InputStream;
58
59 42aa970f Leszek Koltunski
import javax.microedition.khronos.egl.EGLConfig;
60
import javax.microedition.khronos.opengles.GL10;
61
62 b2adcd57 Leszek Koltunski
import static org.distorted.examples.meshfile.MeshFileActivity.MULTIGON;
63 1bb5d3b7 Leszek Koltunski
import static org.distorted.examples.meshfile.MeshFileActivity.POLYGON;
64 6991ece5 Leszek Koltunski
import static org.distorted.examples.meshfile.MeshFileActivity.PROCEDURAL;
65 baace8e9 Leszek Koltunski
import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
66 3e129d0b Leszek Koltunski
import static org.distorted.objectlib.main.TwistyObject.MODE_NORM;
67 6991ece5 Leszek Koltunski
68 42aa970f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
69
70 dc10a48d Leszek Koltunski
class MeshFileRenderer implements GLSurfaceView.Renderer, DistortedLibrary.LibraryUser
71 42aa970f Leszek Koltunski
{
72 7edab735 Leszek Koltunski
    private static final float SQ3 = (float)Math.sqrt(3);
73 16b336db Leszek Koltunski
    private final float DEFAULT_SCALE = 0.3f;
74
75 140f2c4e Leszek Koltunski
    private final GLSurfaceView mView;
76 dc10a48d Leszek Koltunski
    private final Resources mResources;
77 140f2c4e Leszek Koltunski
    private final DistortedScreen mScreen;
78
    private final DistortedEffects mEffects;
79
    private final Static3D mScale;
80 dc10a48d Leszek Koltunski
81
    private DistortedTexture mTexture;
82
    private MeshBase mMesh;
83 48c88f57 Leszek Koltunski
    private long mTime;
84 16b336db Leszek Koltunski
    private float mCurrentScale;
85 42aa970f Leszek Koltunski
86
    Static4D mQuat1, mQuat2;
87
    int mScreenMin;
88
89
///////////////////////////////////////////////////////////////////////////////////////////////////
90
91
    MeshFileRenderer(GLSurfaceView v)
92
      {
93
      mView = v;
94 dc10a48d Leszek Koltunski
      mResources = v.getResources();
95
96 42aa970f Leszek Koltunski
      mScreen = new DistortedScreen();
97
      mScale= new Static3D(1,1,1);
98
      Static3D center=new Static3D(0,0,0);
99
100 16b336db Leszek Koltunski
      mCurrentScale = DEFAULT_SCALE;
101
102 42aa970f Leszek Koltunski
      mQuat1 = new Static4D(0,0,0,1);
103 fe032f52 Leszek Koltunski
      mQuat2 = new Static4D(0,0,0,1);
104 42aa970f Leszek Koltunski
105
      DynamicQuat quatInt1 = new DynamicQuat(0,0.5f);
106
      DynamicQuat quatInt2 = new DynamicQuat(0,0.5f);
107
108
      quatInt1.add(mQuat1);
109
      quatInt2.add(mQuat2);
110
111 39b925d5 Leszek Koltunski
      VertexEffectDisappear disappear = new VertexEffectDisappear();
112
      disappear.setMeshAssociation(1,-1);
113
114 42aa970f Leszek Koltunski
      mEffects = new DistortedEffects();
115
      mEffects.apply( new MatrixEffectQuaternion(quatInt2, center) );
116
      mEffects.apply( new MatrixEffectQuaternion(quatInt1, center) );
117
      mEffects.apply( new MatrixEffectScale(mScale));
118
119 39b925d5 Leszek Koltunski
      mEffects.apply( disappear );
120
121 42aa970f Leszek Koltunski
      mScreen.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
122 48c88f57 Leszek Koltunski
      mScreen.showFPS();
123 42aa970f Leszek Koltunski
      }
124
125
///////////////////////////////////////////////////////////////////////////////////////////////////
126
   
127
    public void onDrawFrame(GL10 glUnused) 
128
      {
129
      mScreen.render( System.currentTimeMillis() );
130
      }
131
132
///////////////////////////////////////////////////////////////////////////////////////////////////
133
    
134
    public void onSurfaceChanged(GL10 glUnused, int width, int height) 
135
      {
136
      mScreenMin = Math.min(width, height);
137 16b336db Leszek Koltunski
      float factor = mCurrentScale*mScreenMin;
138 42aa970f Leszek Koltunski
      mScale.set(factor,factor,factor);
139
      mScreen.resize(width, height);
140
      }
141
142
///////////////////////////////////////////////////////////////////////////////////////////////////
143
    
144
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
145
      {
146
      if( mTexture==null ) mTexture = new DistortedTexture();
147
148 a65604a7 Leszek Koltunski
      Effect.enableEffects(EffectType.VERTEX);
149 04a21ed6 Leszek Koltunski
      DistortedLibrary.setMax(EffectType.VERTEX, 20);
150 ef02f5e0 Leszek Koltunski
      DistortedLibrary.needTransformFeedback();
151 dc10a48d Leszek Koltunski
      DistortedLibrary.onSurfaceCreated(this);
152 42aa970f Leszek Koltunski
      }
153
154 16b336db Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
155
//   0 ---> 0
156
//  50 ---> DEFAULT_SCALE
157
// 100 ---> 4*DEFAULT_SCALE
158
159
    void setScale(int scale)
160
      {
161
      if( scale<= 50 )
162
        {
163
        mCurrentScale = DEFAULT_SCALE * scale / 50.0f;
164
        }
165
      else
166
        {
167
        mCurrentScale = DEFAULT_SCALE * ( 3*(scale/50.0f) - 2.0f);
168
        }
169
170
      float factor = mCurrentScale*mScreenMin;
171
      mScale.set(factor,factor,factor);
172
      }
173
174 42aa970f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
175
176 1af8e143 Leszek Koltunski
    void open(int resourceID)
177 42aa970f Leszek Koltunski
      {
178 099d8f8b Leszek Koltunski
      if( mTexture==null ) mTexture = new DistortedTexture();
179 8ac4c0bc Leszek Koltunski
      mTexture.setTexture( createTexture(resourceID) );
180
181 acad428e Leszek Koltunski
      long t1 = System.currentTimeMillis();
182 6991ece5 Leszek Koltunski
183 1bb5d3b7 Leszek Koltunski
      if( resourceID==PROCEDURAL )
184 6991ece5 Leszek Koltunski
        {
185 1bb5d3b7 Leszek Koltunski
        createMesh();
186
        }
187
      else if( resourceID==POLYGON )
188
        {
189
        createPolygon();
190 6991ece5 Leszek Koltunski
        }
191 b2adcd57 Leszek Koltunski
      else if( resourceID==MULTIGON )
192
        {
193
        createMultigon();
194
        }
195 6991ece5 Leszek Koltunski
      else
196
        {
197 1bb5d3b7 Leszek Koltunski
        openMesh(resourceID);
198 6991ece5 Leszek Koltunski
        }
199
200 acad428e Leszek Koltunski
      long t2 = System.currentTimeMillis();
201
202 48c88f57 Leszek Koltunski
      mTime = t2-t1;
203 42aa970f Leszek Koltunski
204 71c7624f Leszek Koltunski
      mScreen.detachAll();
205 7198e5c9 Leszek Koltunski
      mScreen.attach(mTexture,mEffects,mMesh);
206 42aa970f Leszek Koltunski
      }
207
208
///////////////////////////////////////////////////////////////////////////////////////////////////
209
210 1af8e143 Leszek Koltunski
    private Bitmap createTexture(int resourceID)
211 42aa970f Leszek Koltunski
      {
212 7edab735 Leszek Koltunski
      TextureFactory factory = TextureFactory.getInstance();
213
214
      float[] vertices;
215
      int[] colors;
216
      float F = 0.5f;
217
      float E = SQ3/2;
218
219 77e66c58 Leszek Koltunski
      if( resourceID == R.raw.deferredjob ||
220
          resourceID == R.raw.meshjoin    ||
221
          resourceID == PROCEDURAL        ||
222
          resourceID == POLYGON           ||
223 b2adcd57 Leszek Koltunski
          resourceID == MULTIGON          ||
224 77e66c58 Leszek Koltunski
          resourceID == R.raw.predeform    ) return createWhiteTexture();
225
226
      if( resourceID == R.raw.cube2       ||
227
          resourceID == R.raw.cube3       ||
228
          resourceID == R.raw.cube4       ||
229
          resourceID == R.raw.cube5        )
230
        {
231
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
232
        vertices = new float[] { -F,-F, +F,-F, +F,+F, -F,+F};
233
        return factory.createTexture(vertices,colors,0.10f, 0.10f, true);
234
        }
235
      if( resourceID == R.raw.pyra3       ||
236
          resourceID == R.raw.pyra4       ||
237
          resourceID == R.raw.pyra5        )
238
        {
239
        colors = new int[] { 0xffffff00, 0xff00ff00, 0xff0000ff, 0xffff0000 };
240
        vertices = new float[] { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
241
        return factory.createTexture(vertices,colors,0.05f, 0.05f, true);
242
        }
243
      if( resourceID == R.raw.dino )
244
        {
245
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
246
        vertices = new float[] { -F,F/3, 0,-2*F/3, +F,F/3 };
247
        return factory.createTexture(vertices,colors,0.05f, 0.03f, true);
248
        }
249
      if( resourceID == R.raw.skewb )
250
        {
251
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
252
        vertices = new float[] { -F+F/4,F/4, F/4,-F+F/4, F/4,F/4};
253
        return factory.createTexture(vertices,colors,0.05f, 0.08f, true);
254
        }
255 8ac4c0bc Leszek Koltunski
256 7edab735 Leszek Koltunski
      return null;
257 8ac4c0bc Leszek Koltunski
      }
258
259
///////////////////////////////////////////////////////////////////////////////////////////////////
260
261 7edab735 Leszek Koltunski
    private Bitmap createWhiteTexture()
262 8ac4c0bc Leszek Koltunski
      {
263 7edab735 Leszek Koltunski
      int SIZE = 1;
264 8ac4c0bc Leszek Koltunski
      Bitmap bitmap = Bitmap.createBitmap(SIZE,SIZE, Bitmap.Config.ARGB_8888);
265
      Canvas canvas = new Canvas(bitmap);
266
267
      Paint paint = new Paint();
268 36793c52 Leszek Koltunski
      paint.setColor(0xffffff55);
269 1beffb69 Leszek Koltunski
      paint.setStyle(Paint.Style.FILL);
270 7edab735 Leszek Koltunski
      canvas.drawRect(0, 0, SIZE, SIZE, paint);
271 6991ece5 Leszek Koltunski
272 72059460 Leszek Koltunski
      return bitmap;
273 6991ece5 Leszek Koltunski
      }
274
275 1bb5d3b7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
276
277
    private void createPolygon()
278
      {
279
      float A = 0.5f;
280 46a0999e Leszek Koltunski
      float B = 0.04f;
281 1bb5d3b7 Leszek Koltunski
282 46a0999e Leszek Koltunski
      int extraIndex    = 1;
283
      int extraVertices = 1;
284 1bb5d3b7 Leszek Koltunski
      float[] vertices = new float[] { -A,-A, A,-A, A,A, -A,A };
285 46a0999e Leszek Koltunski
286
      float C = 0.5f;
287
      float[] bands = new float[] { 1.0f, 0.00f*C, 0.9f, 0.04f*C,  0.8f, 0.07f*C, 0.5f, 0.09f*C, 0.0f, 0.10f*C};
288
289
/*
290
      int numBands      = 5;
291 1bb5d3b7 Leszek Koltunski
      float[] bands = new float[2*numBands];
292
293
      for(int i=0; i<numBands; i++)
294
        {
295
        bands[2*i  ] = 1 + i/(1.0f-numBands);
296
        bands[2*i+1] = B/(numBands-1)*i;
297
        }
298 46a0999e Leszek Koltunski
*/
299
      boolean[] up = new boolean[] {true,false,false,false};
300 1bb5d3b7 Leszek Koltunski
301 46a0999e Leszek Koltunski
      mMesh = new MeshPolygon(vertices,bands,up,extraIndex,extraVertices,0.0f,0.0f);
302 1bb5d3b7 Leszek Koltunski
      mMesh.setEffectAssociation(0,0,0);
303 b2adcd57 Leszek Koltunski
      mMesh.setShowNormals(true);
304
      }
305
306
///////////////////////////////////////////////////////////////////////////////////////////////////
307
308
    private void createMultigon()
309
      {
310
      float A = 0.5f;
311 45b6b6b5 Leszek Koltunski
      int extraIndex    = 0;
312
      int extraVertices = 0;
313 b2adcd57 Leszek Koltunski
314
      float[] v1 = new float[] { -A,-A,  A,-A,  A,A, -A,A };
315
      float[] v2 = new float[] {  A,-A,2*A,-A,2*A,A,  A,A };
316
      float[][] vertices = new float[][] {v1,v2};
317
318
      float[] c1 = new float[] { 0,0 };
319
      float[] c2 = new float[] { 1.5f*A,0 };
320
      float[][] centers = new float[][] { c1,c2 };
321 45b6b6b5 Leszek Koltunski
/*
322 b2adcd57 Leszek Koltunski
      float C = 0.5f;
323
      float[] bands = new float[] { 1.0f, 0.00f*C, 0.9f, 0.04f*C,  0.8f, 0.07f*C, 0.5f, 0.09f*C, 0.0f, 0.10f*C};
324 45b6b6b5 Leszek Koltunski
*/
325 b2adcd57 Leszek Koltunski
326 45b6b6b5 Leszek Koltunski
      float B = 0.05f;
327
      int numBands = 2;
328 b2adcd57 Leszek Koltunski
      float[] bands = new float[2*numBands];
329
330
      for(int i=0; i<numBands; i++)
331
        {
332
        bands[2*i  ] = 1 + i/(1.0f-numBands);
333
        bands[2*i+1] = B/(numBands-1)*i;
334
        }
335 45b6b6b5 Leszek Koltunski
336 b2adcd57 Leszek Koltunski
      mMesh = new MeshMultigon(vertices,bands,extraIndex,extraVertices,centers);
337 45b6b6b5 Leszek Koltunski
338
      int numEff = mMesh.getNumEffComponents();
339
340
      for(int i=0; i<numEff; i++)
341
        {
342
        mMesh.setEffectAssociation(i, 0, i);
343
        }
344
345 1bb5d3b7 Leszek Koltunski
      mMesh.setShowNormals(true);
346
      }
347
348 6991ece5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
349
350
    private void createMesh()
351
      {
352 d32fe3d9 Leszek Koltunski
      Static4D quat = new Static4D(0,0,0,1);
353
      Static3D move = new Static3D(0,0,0);
354
      float scale   = 1.0f;
355 cfbd047c Leszek Koltunski
      int variant   = 1;
356 6983badf Leszek Koltunski
357 2f250195 Leszek Koltunski
      InitData data = new InitData(new int[] {2,3,2});
358 82f297f2 Leszek Koltunski
      TwistyObject puzzle = new TwistyCuboid(MESH_NICE,MODE_NORM,quat,move,scale,data,null);
359 3083fab8 Leszek Koltunski
360 acb2aaae Leszek Koltunski
      ObjectShape shape           = puzzle.getObjectShape(variant);
361
      ObjectFaceShape face        = puzzle.getObjectFaceShape(variant);
362
      ObjectVertexEffects effects = puzzle.getVertexEffects(variant);
363 6983badf Leszek Koltunski
364 d32fe3d9 Leszek Koltunski
      int[][] indices = shape.getVertIndices();
365
      int numComponents = indices.length;
366
      int[] outer = new int[numComponents];
367 db9903e8 Leszek Koltunski
368 33647db9 Leszek Koltunski
      FactoryCubit factory = FactoryCubit.getInstance();
369 6983badf Leszek Koltunski
      factory.clear();
370 fa96775c Leszek Koltunski
      factory.createNewFaceTransform(shape,outer);
371 acb2aaae Leszek Koltunski
      mMesh = factory.createRoundedSolid(shape,face,effects,MESH_NICE,numComponents);
372 6983badf Leszek Koltunski
373
      int numEff = mMesh.getNumEffComponents();
374 6991ece5 Leszek Koltunski
375 d32fe3d9 Leszek Koltunski
      for(int i=0; i<numEff; i++) mMesh.setEffectAssociation(i, 0, i);
376 6991ece5 Leszek Koltunski
      }
377 42aa970f Leszek Koltunski
378
///////////////////////////////////////////////////////////////////////////////////////////////////
379
380 6991ece5 Leszek Koltunski
    private void openMesh(int resourceID)
381 42aa970f Leszek Koltunski
      {
382 1af8e143 Leszek Koltunski
      Context con = mView.getContext();
383
      Resources res = con.getResources();
384
      InputStream is = res.openRawResource(resourceID);
385
      DataInputStream dos = new DataInputStream(is);
386 7198e5c9 Leszek Koltunski
      mMesh = new MeshFile(dos);
387 1af8e143 Leszek Koltunski
388 6983badf Leszek Koltunski
      int numEff = mMesh.getNumEffComponents();
389 39b925d5 Leszek Koltunski
390
      for(int i=0; i<numEff; i++)
391
        {
392
        mMesh.setEffectAssociation(i, 0, i);
393
        }
394
395 1af8e143 Leszek Koltunski
      try
396
        {
397
        is.close();
398
        }
399
      catch(IOException e)
400
        {
401 48c88f57 Leszek Koltunski
        android.util.Log.e("MeshFile", "Error closing InputStream: "+e.toString());
402 1af8e143 Leszek Koltunski
        }
403 42aa970f Leszek Koltunski
      }
404 48c88f57 Leszek Koltunski
405 39b925d5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
406
407 6991ece5 Leszek Koltunski
    MeshBase getMesh()
408 39b925d5 Leszek Koltunski
      {
409
      return mMesh;
410
      }
411
412 48c88f57 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
413
414
    long getTime()
415
      {
416
      return mTime;
417
      }
418
419
///////////////////////////////////////////////////////////////////////////////////////////////////
420
421
    int getBytes()
422
      {
423 6991ece5 Leszek Koltunski
      if( mMesh instanceof MeshFile )
424
        {
425
        return ((MeshFile)mMesh).getNumBytes();
426
        }
427
428
      return 0;
429 48c88f57 Leszek Koltunski
      }
430
431
///////////////////////////////////////////////////////////////////////////////////////////////////
432
433
    int getVertices()
434
      {
435 7198e5c9 Leszek Koltunski
      return mMesh.getNumVertices();
436
      }
437
438
///////////////////////////////////////////////////////////////////////////////////////////////////
439
440
    int getEndEffIndex(int component)
441
      {
442
      return mMesh.getLastVertexEff(component);
443
      }
444
445
///////////////////////////////////////////////////////////////////////////////////////////////////
446
447
    int getEndTexIndex(int component)
448
      {
449
      return mMesh.getLastVertexTex(component);
450
      }
451
452
///////////////////////////////////////////////////////////////////////////////////////////////////
453
454
    int getEffComponentNum()
455
      {
456 6983badf Leszek Koltunski
      return mMesh.getNumEffComponents();
457 7198e5c9 Leszek Koltunski
      }
458
459
///////////////////////////////////////////////////////////////////////////////////////////////////
460
461
    int getTexComponentNum()
462
      {
463 6983badf Leszek Koltunski
      return mMesh.getNumTexComponents();
464 48c88f57 Leszek Koltunski
      }
465 dc10a48d Leszek Koltunski
466
///////////////////////////////////////////////////////////////////////////////////////////////////
467
468
    public void distortedException(Exception ex)
469
      {
470
      android.util.Log.e("MeshFile", ex.getMessage() );
471
      }
472
473
///////////////////////////////////////////////////////////////////////////////////////////////////
474
475
    public InputStream localFile(int fileID)
476
      {
477
      return mResources.openRawResource(fileID);
478
      }
479
480
///////////////////////////////////////////////////////////////////////////////////////////////////
481
482
    public void logMessage(String message)
483
      {
484
      android.util.Log.e("MeshFile", message );
485
      }
486 42aa970f Leszek Koltunski
}