Project

General

Profile

« Previous | Next » 

Revision b1fca44e

Added by Leszek Koltunski almost 4 years ago

Convert Generic to stretchless API.

View differences:

src/main/java/org/distorted/examples/generic/GenericActivity2.java
52 52
  private GenericViewPager mViewPager;
53 53

  
54 54
  private boolean mShowCenter, mShowRegion, mShowNormal, mUseOIT;
55
  private float mScaleX, mScaleY, mScaleZ;
55 56

  
56 57
///////////////////////////////////////////////////////////////////////////////////////////////////
57 58

  
......
76 77
    mShowNormal = false;
77 78
    mUseOIT     = false;
78 79

  
80
    mScaleX = numCols;
81
    mScaleY = numRows;
82
    mScaleZ = numSlic;
83

  
79 84
    int maxsize = numCols > numRows ? (Math.max(numCols, numSlic)) : (Math.max(numRows, numSlic));
80 85
    createBitmap(maxsize, bitmapID);
81 86
    mMesh =  GenericMeshList.createMesh(objectType, numCols, numRows, numSlic, bitmapID, str);
82
    mMesh.setStretch(numCols, numRows, numSlic);
83 87

  
84 88
    mMesh.setShowNormals(mShowNormal);
85 89
    mTexture= new DistortedTexture();
......
178 182

  
179 183
  public float getWidth()
180 184
    {
181
    return mMesh==null ? 0: mMesh.getStretchX();
185
    return mScaleX;
182 186
    }
183 187

  
184 188
///////////////////////////////////////////////////////////////////////////////////////////////////
185 189

  
186 190
  public float getHeight()
187 191
    {
188
    return mMesh==null ? 0: mMesh.getStretchY();
192
    return mScaleY;
189 193
    }
190 194

  
191 195
///////////////////////////////////////////////////////////////////////////////////////////////////
192 196

  
193 197
  public float getDepth()
194 198
    {
195
    return mMesh==null ? 0: mMesh.getStretchZ();
199
    return mScaleZ;
196 200
    }
197 201

  
198 202
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff