Revision 044b5494
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
68 | 68 |
private int mNumVertices; |
69 | 69 |
private float[] mVertAttribs; // packed: PosX,PosY,PosZ, NorX,NorY,NorZ, InfX,InfY,InfZ, TexS,TexT |
70 | 70 |
private float mInflate; |
71 |
private float mStretchX, mStretchY, mStretchZ; |
|
71 | 72 |
|
72 | 73 |
private class Component |
73 | 74 |
{ |
... | ... | |
100 | 101 |
|
101 | 102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
102 | 103 |
|
103 |
MeshBase() |
|
104 |
MeshBase(float width, float height, float depth)
|
|
104 | 105 |
{ |
106 |
mStretchX = width; |
|
107 |
mStretchY = height; |
|
108 |
mStretchZ = depth; |
|
109 |
|
|
105 | 110 |
mShowNormals = false; |
106 | 111 |
mInflate = 0.0f; |
107 | 112 |
mComponent = new ArrayList<>(); |
... | ... | |
116 | 121 |
|
117 | 122 |
MeshBase(MeshBase original) |
118 | 123 |
{ |
124 |
mStretchX = original.mStretchX; |
|
125 |
mStretchY = original.mStretchY; |
|
126 |
mStretchZ = original.mStretchZ; |
|
127 |
|
|
119 | 128 |
mShowNormals = original.mShowNormals; |
120 | 129 |
mInflate = original.mInflate; |
121 | 130 |
|
... | ... | |
173 | 182 |
return mNumVertices; |
174 | 183 |
} |
175 | 184 |
|
185 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
186 |
/** |
|
187 |
* Sets the stretch parameters. Coordinates of all vertices will be first pre-multiplied by those. |
|
188 |
*/ |
|
189 |
public void setStretch(int sx, int sy, int sz) |
|
190 |
{ |
|
191 |
mStretchX = sx; |
|
192 |
mStretchY = sy; |
|
193 |
mStretchZ = sz; |
|
194 |
} |
|
195 |
|
|
196 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
197 |
/** |
|
198 |
* X coordinates of all vertices will be first pre-multiplied by this parameter. |
|
199 |
*/ |
|
200 |
public float getStretchX() |
|
201 |
{ |
|
202 |
return mStretchX; |
|
203 |
} |
|
204 |
|
|
205 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
206 |
/** |
|
207 |
* Y coordinates of all vertices will be first pre-multiplied by this parameter. |
|
208 |
*/ |
|
209 |
public float getStretchY() |
|
210 |
{ |
|
211 |
return mStretchY; |
|
212 |
} |
|
213 |
|
|
214 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
215 |
/** |
|
216 |
* Z coordinates of all vertices will be first pre-multiplied by this parameter. |
|
217 |
*/ |
|
218 |
public float getStretchZ() |
|
219 |
{ |
|
220 |
return mStretchZ; |
|
221 |
} |
|
222 |
|
|
176 | 223 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
177 | 224 |
/** |
178 | 225 |
* Not part of public API, do not document (public only because has to be used from the main package) |
Also available in: Unified diff
Move the Effects.setStretch to Meshbase.setStretch