Project

General

Profile

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

library / src / main / java / org / distorted / library / EffectQueueMatrix.java @ bdb341bc

1 d333eb6b 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 6a06a912 Leszek Koltunski
package org.distorted.library;
21
22
import android.opengl.GLES20;
23
import android.opengl.Matrix;
24
25 e458a4ba Leszek Koltunski
import org.distorted.library.message.EffectMessage;
26 568b29d8 Leszek Koltunski
import org.distorted.library.type.Data1D;
27
import org.distorted.library.type.Data3D;
28
import org.distorted.library.type.Data4D;
29
import org.distorted.library.type.Dynamic1D;
30
import org.distorted.library.type.Dynamic3D;
31
import org.distorted.library.type.Dynamic4D;
32
import org.distorted.library.type.DynamicQuat;
33
import org.distorted.library.type.Static1D;
34
import org.distorted.library.type.Static3D;
35
import org.distorted.library.type.Static4D;
36 a4835695 Leszek Koltunski
37 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
38
39 d07f2950 Leszek Koltunski
class EffectQueueMatrix extends EffectQueue
40 6a06a912 Leszek Koltunski
  {   
41 1e438fc7 Leszek Koltunski
  private static final int NUM_UNIFORMS = 7;
42
  private static final int INDEX = EffectTypes.MATRIX.ordinal();
43 6a06a912 Leszek Koltunski
  private static float[] mMVPMatrix= new float[16];
44
  private static float[] mTmpMatrix= new float[16];
45
  
46 8aac2acc Leszek Koltunski
  private static int mObjDH;      // This is a handle to half a Object dimensions
47 6a06a912 Leszek Koltunski
  private static int mDepthH;     // Handle to the max Depth, i.e (farplane-nearplane)/2
48
  private static int mMVPMatrixH; // pass in the transformation matrix
49
  private static int mMVMatrixH;  // pass in the modelview matrix.
50
  
51
///////////////////////////////////////////////////////////////////////////////////////////////////
52
   
53 350cc2f5 Leszek Koltunski
  EffectQueueMatrix(DistortedObject obj)
54 6a06a912 Leszek Koltunski
    { 
55 1e438fc7 Leszek Koltunski
    super(obj,NUM_UNIFORMS, INDEX );
56 6a06a912 Leszek Koltunski
    }
57
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59
60
  private static void multiplyByQuat(float[] matrix, float X, float Y, float Z, float W)
61
    {
62
    float xx= X * X;
63
    float xy= X * Y;
64
    float xz= X * Z;
65
    float xw= X * W;
66
    float yy= Y * Y;
67
    float yz= Y * Z;
68
    float yw= Y * W;
69
    float zz= Z * Z;
70
    float zw= Z * W;
71
72
    mTmpMatrix[0]  = 1 - 2 * ( yy + zz );
73
    mTmpMatrix[1]  =     2 * ( xy - zw );
74
    mTmpMatrix[2]  =     2 * ( xz + yw );
75
    mTmpMatrix[4]  =     2 * ( xy + zw );
76
    mTmpMatrix[5]  = 1 - 2 * ( xx + zz );
77
    mTmpMatrix[6]  =     2 * ( yz - xw );
78
    mTmpMatrix[8]  =     2 * ( xz - yw );
79
    mTmpMatrix[9]  =     2 * ( yz + xw );
80
    mTmpMatrix[10] = 1 - 2 * ( xx + yy );
81
    mTmpMatrix[3]  = mTmpMatrix[7] = mTmpMatrix[11] = mTmpMatrix[12] = mTmpMatrix[13] = mTmpMatrix[14] = 0;
82
    mTmpMatrix[15] = 1;
83
    
84
    Matrix.multiplyMM(mMVPMatrix, 0, matrix, 0, mTmpMatrix, 0);  
85
    for(int j=0; j<16; j++) matrix[j] = mMVPMatrix[j];   
86
    }
87
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89
90
  static void getUniforms(int mProgramH)
91
    {
92 8aac2acc Leszek Koltunski
    mObjDH     = GLES20.glGetUniformLocation(mProgramH, "u_objD");
93 6a06a912 Leszek Koltunski
    mDepthH    = GLES20.glGetUniformLocation(mProgramH, "u_Depth");
94
    mMVPMatrixH= GLES20.glGetUniformLocation(mProgramH, "u_MVPMatrix");
95
    mMVMatrixH = GLES20.glGetUniformLocation(mProgramH, "u_MVMatrix"); 
96
    }
97
98
///////////////////////////////////////////////////////////////////////////////////////////////////
99
  
100
  synchronized void compute(long currTime) 
101
    {
102
    if( currTime==mTime ) return;
103
    if( mTime==0 ) mTime = currTime;
104
    long step = (currTime-mTime);
105
   
106
    for(int i=0; i<mNumEffects; i++)
107
      {
108 0df17fad Leszek Koltunski
      if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
109 6a06a912 Leszek Koltunski
        {
110 a595ee16 Leszek Koltunski
        for(int j=0; j<mNumListeners; j++)
111 6a06a912 Leszek Koltunski
          EffectMessageSender.newMessage( mListeners.elementAt(j),
112 e458a4ba Leszek Koltunski
                                          EffectMessage.EFFECT_FINISHED,
113 1e438fc7 Leszek Koltunski
                                         (mID[i]<<EffectTypes.LENGTH)+EffectTypes.MATRIX.type,
114 e8c81a8e Leszek Koltunski
                                          mName[i],
115 c6e1c219 Leszek Koltunski
                                          mBitmapID,
116
                                          null);
117 a595ee16 Leszek Koltunski
118 e8c81a8e Leszek Koltunski
        if( EffectNames.isUnity(mName[i], mUniforms, NUM_UNIFORMS*i) )
119 a595ee16 Leszek Koltunski
          {
120 6a06a912 Leszek Koltunski
          remove(i);
121
          i--;
122
          continue;
123
          }
124 e8c81a8e Leszek Koltunski
        else mInter[0][i] = null;
125 6a06a912 Leszek Koltunski
        }
126 a595ee16 Leszek Koltunski
127
      if( mInter[1][i]!=null )
128
        {
129 bdb341bc Leszek Koltunski
        mInter[1][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+4, mCurrentDuration[i], step);
130 a595ee16 Leszek Koltunski
        }
131
132 6a06a912 Leszek Koltunski
      mCurrentDuration[i] += step;
133
      }
134
     
135
    mTime = currTime;  
136
    }  
137
138
///////////////////////////////////////////////////////////////////////////////////////////////////
139
140
  protected void moveEffect(int index)
141
    {
142
    mUniforms[NUM_UNIFORMS*index  ] = mUniforms[NUM_UNIFORMS*(index+1)  ];
143
    mUniforms[NUM_UNIFORMS*index+1] = mUniforms[NUM_UNIFORMS*(index+1)+1];
144
    mUniforms[NUM_UNIFORMS*index+2] = mUniforms[NUM_UNIFORMS*(index+1)+2];
145
    mUniforms[NUM_UNIFORMS*index+3] = mUniforms[NUM_UNIFORMS*(index+1)+3];
146
    mUniforms[NUM_UNIFORMS*index+4] = mUniforms[NUM_UNIFORMS*(index+1)+4];
147
    mUniforms[NUM_UNIFORMS*index+5] = mUniforms[NUM_UNIFORMS*(index+1)+5];
148
    mUniforms[NUM_UNIFORMS*index+6] = mUniforms[NUM_UNIFORMS*(index+1)+6];
149
    }
150
151
///////////////////////////////////////////////////////////////////////////////////////////////////
152
// here construct the ModelView Matrix
153
154
  synchronized void send(float[] viewMatrix, DistortedProjection dp) 
155
    {
156
    Matrix.setIdentityM(viewMatrix, 0);
157
    Matrix.translateM(viewMatrix, 0, -dp.width/2, dp.height/2, -dp.distance);
158
    
159 a595ee16 Leszek Koltunski
    float x,y,z, sx,sy,sz;
160 6a06a912 Leszek Koltunski
   
161
    for(int i=0; i<mNumEffects; i++)
162
      {
163 e8c81a8e Leszek Koltunski
      if (mName[i] == EffectNames.ROTATE.ordinal() )
164 6a06a912 Leszek Koltunski
        {
165 0df17fad Leszek Koltunski
        x = mUniforms[NUM_UNIFORMS*i+4];
166
        y = mUniforms[NUM_UNIFORMS*i+5];
167
        z = mUniforms[NUM_UNIFORMS*i+6];
168 568b29d8 Leszek Koltunski
169 6a06a912 Leszek Koltunski
        Matrix.translateM(viewMatrix, 0, x,-y, z); 
170 0df17fad Leszek Koltunski
        Matrix.rotateM( viewMatrix, 0, mUniforms[NUM_UNIFORMS*i], mUniforms[NUM_UNIFORMS*i+1], mUniforms[NUM_UNIFORMS*i+2], mUniforms[NUM_UNIFORMS*i+3]);
171 6a06a912 Leszek Koltunski
        Matrix.translateM(viewMatrix, 0,-x, y,-z);  
172
        }
173 e8c81a8e Leszek Koltunski
      else if(mName[i] == EffectNames.QUATERNION.ordinal() )
174 6a06a912 Leszek Koltunski
        {
175 0df17fad Leszek Koltunski
        x = mUniforms[NUM_UNIFORMS*i+4];
176
        y = mUniforms[NUM_UNIFORMS*i+5];
177
        z = mUniforms[NUM_UNIFORMS*i+6];
178 6a06a912 Leszek Koltunski
     	
179
        Matrix.translateM(viewMatrix, 0, x,-y, z); 
180 0df17fad Leszek Koltunski
        multiplyByQuat(viewMatrix, mUniforms[NUM_UNIFORMS*i], mUniforms[NUM_UNIFORMS*i+1], mUniforms[NUM_UNIFORMS*i+2], mUniforms[NUM_UNIFORMS*i+3]);
181 6a06a912 Leszek Koltunski
        Matrix.translateM(viewMatrix, 0,-x, y,-z);  
182
        }
183 e8c81a8e Leszek Koltunski
      else if(mName[i] == EffectNames.MOVE.ordinal() )
184 6a06a912 Leszek Koltunski
        {
185 0df17fad Leszek Koltunski
        sx = mUniforms[NUM_UNIFORMS*i  ];
186
        sy = mUniforms[NUM_UNIFORMS*i+1];
187
        sz = mUniforms[NUM_UNIFORMS*i+2];
188 6a06a912 Leszek Koltunski
        
189
        Matrix.translateM(viewMatrix, 0, sx,-sy, sz);   
190
        }
191 e8c81a8e Leszek Koltunski
      else if(mName[i] == EffectNames.SCALE.ordinal() )
192 6a06a912 Leszek Koltunski
        {
193 0df17fad Leszek Koltunski
        sx = mUniforms[NUM_UNIFORMS*i  ];
194
        sy = mUniforms[NUM_UNIFORMS*i+1];
195
        sz = mUniforms[NUM_UNIFORMS*i+2];
196 6a06a912 Leszek Koltunski
197
        Matrix.scaleM(viewMatrix, 0, sx, sy, sz);  
198
        }
199 e8c81a8e Leszek Koltunski
      else if(mName[i] == EffectNames.SHEAR.ordinal() )
200 6a06a912 Leszek Koltunski
        {
201 0df17fad Leszek Koltunski
        sx = mUniforms[NUM_UNIFORMS*i  ];
202
        sy = mUniforms[NUM_UNIFORMS*i+1];
203
        sz = mUniforms[NUM_UNIFORMS*i+2];
204
205
        x  = mUniforms[NUM_UNIFORMS*i+4];
206
        y  = mUniforms[NUM_UNIFORMS*i+5];
207
        z  = mUniforms[NUM_UNIFORMS*i+6];
208
209 6a06a912 Leszek Koltunski
        Matrix.translateM(viewMatrix, 0, x,-y, z); 
210
      
211 beb70e07 Leszek Koltunski
        viewMatrix[4] += sx*viewMatrix[0]; // Multiply viewMatrix by 1 x 0 0 , i.e. X-shear.
212 6a06a912 Leszek Koltunski
        viewMatrix[5] += sx*viewMatrix[1]; //                        0 1 0 0 
213
        viewMatrix[6] += sx*viewMatrix[2]; //                        0 0 1 0
214
        viewMatrix[7] += sx*viewMatrix[3]; //                        0 0 0 1
215
      
216 beb70e07 Leszek Koltunski
        viewMatrix[0] += sy*viewMatrix[4]; // Multiply viewMatrix by 1 0 0 0 , i.e. Y-shear.
217 6a06a912 Leszek Koltunski
        viewMatrix[1] += sy*viewMatrix[5]; //                        y 1 0 0
218
        viewMatrix[2] += sy*viewMatrix[6]; //                        0 0 1 0
219
        viewMatrix[3] += sy*viewMatrix[7]; //                        0 0 0 1      
220
      
221 beb70e07 Leszek Koltunski
        viewMatrix[4] += sz*viewMatrix[8]; // Multiply viewMatrix by 1 0 0 0 , i.e. Z-shear.
222
        viewMatrix[5] += sz*viewMatrix[9]; //                        0 1 0 0
223
        viewMatrix[6] += sz*viewMatrix[10];//                        0 z 1 0
224
        viewMatrix[7] += sz*viewMatrix[11];//                        0 0 0 1
225
226 6a06a912 Leszek Koltunski
        Matrix.translateM(viewMatrix, 0,-x, y, -z);
227
        }
228
      }
229
   
230 c5b1451b Leszek Koltunski
    Matrix.translateM(viewMatrix, 0, mObjHalfX,-mObjHalfY, 0);
231 6a06a912 Leszek Koltunski
    Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, viewMatrix, 0);
232
    
233 8aac2acc Leszek Koltunski
    GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
234 6a06a912 Leszek Koltunski
    GLES20.glUniform1f( mDepthH, dp.depth);   
235
    GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, viewMatrix, 0);
236
    GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0);
237
    }
238
239
///////////////////////////////////////////////////////////////////////////////////////////////////
240
// here construct the ModelView Matrix, but without any effects
241
242
  synchronized void sendNoEffects(DistortedProjection dp) 
243
    {
244
    Matrix.setIdentityM(mTmpMatrix, 0);
245 c5b1451b Leszek Koltunski
    Matrix.translateM(mTmpMatrix, 0, mObjHalfX-dp.width/2, dp.height/2-mObjHalfY, -dp.distance);
246 6a06a912 Leszek Koltunski
    Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, mTmpMatrix, 0);
247
    
248 8aac2acc Leszek Koltunski
    GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
249 6a06a912 Leszek Koltunski
    GLES20.glUniform1f( mDepthH, dp.depth);  
250
    GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, mTmpMatrix, 0);
251
    GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0);
252
    }
253
254 e0a16874 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
255 568b29d8 Leszek Koltunski
// move, scale
256 e0a16874 Leszek Koltunski
257 568b29d8 Leszek Koltunski
  synchronized long add(EffectNames eln, Data3D vector)
258 e0a16874 Leszek Koltunski
    {
259
    if( mMax[INDEX]>mNumEffects )
260
      {
261 d425545a Leszek Koltunski
      mInter[1][mNumEffects] = null;
262 568b29d8 Leszek Koltunski
263 bdb341bc Leszek Koltunski
      if( vector instanceof Dynamic3D)
264
        {
265
        mInter[0][mNumEffects] = (Dynamic3D)vector;
266
        }
267 568b29d8 Leszek Koltunski
      else if( vector instanceof Static3D )
268
        {
269 d425545a Leszek Koltunski
        mInter[0][mNumEffects] = null;
270 0df17fad Leszek Koltunski
        mUniforms[NUM_UNIFORMS*mNumEffects  ] = ((Static3D)vector).getX();
271
        mUniforms[NUM_UNIFORMS*mNumEffects+1] = ((Static3D)vector).getY();
272
        mUniforms[NUM_UNIFORMS*mNumEffects+2] = ((Static3D)vector).getZ();
273 568b29d8 Leszek Koltunski
        }
274
      else return -1;
275 e0a16874 Leszek Koltunski
276
      return addBase(eln);
277
      }
278
279
    return -1;
280
    }
281
282 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
283 568b29d8 Leszek Koltunski
// rotate - static axis
284 6a06a912 Leszek Koltunski
285 0df17fad Leszek Koltunski
  synchronized long add(EffectNames eln, Data1D angle, Static3D axis, Data3D center)
286 6a06a912 Leszek Koltunski
    {
287 1e438fc7 Leszek Koltunski
    if( mMax[INDEX]>mNumEffects )
288 6a06a912 Leszek Koltunski
      {
289 bdb341bc Leszek Koltunski
      if( angle instanceof Dynamic1D)
290
        {
291
        mInter[0][mNumEffects] = (Dynamic1D)angle;
292
        }
293 568b29d8 Leszek Koltunski
      else if( angle instanceof Static1D)
294
        {
295 d425545a Leszek Koltunski
        mInter[0][mNumEffects] = null;
296 0df17fad Leszek Koltunski
        mUniforms[NUM_UNIFORMS*mNumEffects] = ((Static1D)angle).getX();
297 568b29d8 Leszek Koltunski
        }
298
      else return -1;
299
300 0df17fad Leszek Koltunski
      mUniforms[NUM_UNIFORMS*mNumEffects+1] = axis.getX();
301
      mUniforms[NUM_UNIFORMS*mNumEffects+2] = axis.getY();
302
      mUniforms[NUM_UNIFORMS*mNumEffects+3] = axis.getZ();
303
304 bdb341bc Leszek Koltunski
      if( center instanceof Dynamic3D)
305
        {
306
        mInter[1][mNumEffects] = (Dynamic3D)center;
307
        }
308 0df17fad Leszek Koltunski
      else if( center instanceof Static3D )
309
        {
310
        mInter[1][mNumEffects] = null;
311
        mUniforms[NUM_UNIFORMS*mNumEffects+4] = ((Static3D)center).getX();
312
        mUniforms[NUM_UNIFORMS*mNumEffects+5] = ((Static3D)center).getY();
313
        mUniforms[NUM_UNIFORMS*mNumEffects+6] = ((Static3D)center).getZ();
314
        }
315
      else return -1;
316 568b29d8 Leszek Koltunski
317 6a06a912 Leszek Koltunski
      return addBase(eln);
318
      }
319
      
320
    return -1;
321
    }
322
323
///////////////////////////////////////////////////////////////////////////////////////////////////
324 568b29d8 Leszek Koltunski
// quaternion or rotate - dynamic axis
325
326 0df17fad Leszek Koltunski
  synchronized long add(EffectNames eln, Data4D data, Data3D center)
327 6a06a912 Leszek Koltunski
    {
328 1e438fc7 Leszek Koltunski
    if( mMax[INDEX]>mNumEffects )
329 6a06a912 Leszek Koltunski
      {
330 bdb341bc Leszek Koltunski
      if( data instanceof Dynamic4D  )
331
        {
332
        mInter[0][mNumEffects] = (Dynamic4D)data;
333
        }
334
      else if( data instanceof DynamicQuat)
335
        {
336
        mInter[0][mNumEffects] = (DynamicQuat)data;
337
        }
338 568b29d8 Leszek Koltunski
      else if( data instanceof Static4D   )
339
        {
340 d425545a Leszek Koltunski
        mInter[0][mNumEffects] = null;
341 0df17fad Leszek Koltunski
        mUniforms[NUM_UNIFORMS*mNumEffects  ] = ((Static4D)data).getX();
342
        mUniforms[NUM_UNIFORMS*mNumEffects+1] = ((Static4D)data).getY();
343
        mUniforms[NUM_UNIFORMS*mNumEffects+2] = ((Static4D)data).getZ();
344
        mUniforms[NUM_UNIFORMS*mNumEffects+3] = ((Static4D)data).getW();
345
        }
346
      else return -1;
347
348 bdb341bc Leszek Koltunski
      if( center instanceof Dynamic3D)
349
        {
350
        mInter[1][mNumEffects] = (Dynamic3D)center;
351
        }
352 0df17fad Leszek Koltunski
      else if( center instanceof Static3D )
353
        {
354
        mInter[1][mNumEffects] = null;
355
        mUniforms[NUM_UNIFORMS*mNumEffects+4] = ((Static3D)center).getX();
356
        mUniforms[NUM_UNIFORMS*mNumEffects+5] = ((Static3D)center).getY();
357
        mUniforms[NUM_UNIFORMS*mNumEffects+6] = ((Static3D)center).getZ();
358 568b29d8 Leszek Koltunski
        }
359
      else return -1;
360
361 6a06a912 Leszek Koltunski
      return addBase(eln);
362
      }
363 568b29d8 Leszek Koltunski
364 6a06a912 Leszek Koltunski
    return -1;
365
    }
366
367
///////////////////////////////////////////////////////////////////////////////////////////////////
368 568b29d8 Leszek Koltunski
// shear
369
370 0df17fad Leszek Koltunski
  synchronized long add(EffectNames eln, Data3D shear, Data3D center)
371 6a06a912 Leszek Koltunski
    {
372 1e438fc7 Leszek Koltunski
    if( mMax[INDEX]>mNumEffects )
373 6a06a912 Leszek Koltunski
      {
374 bdb341bc Leszek Koltunski
      if( shear instanceof Dynamic3D)
375
        {
376
        mInter[0][mNumEffects] = (Dynamic3D)shear;
377
        }
378 0df17fad Leszek Koltunski
      else if( shear instanceof Static3D )
379 568b29d8 Leszek Koltunski
        {
380 0df17fad Leszek Koltunski
        mInter[0][mNumEffects] = null;
381
        mUniforms[NUM_UNIFORMS*mNumEffects  ] = ((Static3D)shear).getX();
382
        mUniforms[NUM_UNIFORMS*mNumEffects+1] = ((Static3D)shear).getY();
383
        mUniforms[NUM_UNIFORMS*mNumEffects+2] = ((Static3D)shear).getZ();
384 568b29d8 Leszek Koltunski
        }
385
      else return -1;
386
387 bdb341bc Leszek Koltunski
      if( center instanceof Dynamic3D)
388
        {
389
        mInter[1][mNumEffects] = (Dynamic3D)center;
390
        }
391 0df17fad Leszek Koltunski
      else if( center instanceof Static3D )
392 568b29d8 Leszek Koltunski
        {
393 0df17fad Leszek Koltunski
        mInter[1][mNumEffects] = null;
394
        mUniforms[NUM_UNIFORMS*mNumEffects+4] = ((Static3D)center).getX();
395
        mUniforms[NUM_UNIFORMS*mNumEffects+5] = ((Static3D)center).getY();
396
        mUniforms[NUM_UNIFORMS*mNumEffects+6] = ((Static3D)center).getZ();
397 568b29d8 Leszek Koltunski
        }
398
      else return -1;
399
400 6a06a912 Leszek Koltunski
      return addBase(eln);
401
      }
402
      
403
    return -1;
404
    }
405
  }