Revision cbd502ec
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
137 | 137 |
mVBO = new InternalBuffer(GLES30.GL_ARRAY_BUFFER , GLES30.GL_STATIC_READ); |
138 | 138 |
mTFO = new InternalBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, GLES30.GL_STATIC_READ); |
139 | 139 |
|
140 |
System.arraycopy(original.mVertAttribs,0,mVertAttribs,0,original.mNumVertices*VERT_ATTRIBS); |
|
141 |
setAttribs(mVertAttribs); |
|
140 |
mNumVertices = original.mNumVertices; |
|
141 |
mVertAttribs = new float[mNumVertices*VERT_ATTRIBS]; |
|
142 |
System.arraycopy(original.mVertAttribs,0,mVertAttribs,0,mNumVertices*VERT_ATTRIBS); |
|
143 |
|
|
144 |
mVBO.invalidate(); |
|
145 |
mTFO.invalidate(); |
|
142 | 146 |
} |
143 | 147 |
|
144 | 148 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
330 | 334 |
|
331 | 335 |
for(int i=0; i<numComp; i++) |
332 | 336 |
{ |
333 |
mComponent.get(i).mQueue.send(0.0f,4);
|
|
337 |
mComponent.get(i).mQueue.send(0.0f,3);
|
|
334 | 338 |
} |
335 | 339 |
} |
336 | 340 |
|
... | ... | |
554 | 558 |
{ |
555 | 559 |
return (component>=0 && component<mComponent.size()) ? mComponent.get(component).mTextureMap : null; |
556 | 560 |
} |
561 |
|
|
562 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
563 |
/** |
|
564 |
* Deep copy |
|
565 |
*/ |
|
566 |
public abstract MeshBase deepCopy(); |
|
557 | 567 |
} |
558 | 568 |
|
559 | 569 |
|
src/main/java/org/distorted/library/mesh/MeshCubes.java | ||
---|---|---|
49 | 49 |
private static final float[] mNormalY = new float[4]; |
50 | 50 |
private static final float[] mNormalZ = new float[4]; |
51 | 51 |
|
52 |
private class Edge |
|
52 |
private static class Edge
|
|
53 | 53 |
{ |
54 | 54 |
final int side; |
55 | 55 |
final int row; |
... | ... | |
924 | 924 |
prepareDataStructures(cols,rows,slices); |
925 | 925 |
build(); |
926 | 926 |
} |
927 |
|
|
928 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
929 |
/** |
|
930 |
* deep copy. |
|
931 |
*/ |
|
932 |
public MeshCubes(MeshCubes mesh) |
|
933 |
{ |
|
934 |
super(mesh); |
|
935 |
} |
|
936 |
|
|
937 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
938 |
/** |
|
939 |
* deep copy. |
|
940 |
*/ |
|
941 |
public MeshCubes deepCopy() |
|
942 |
{ |
|
943 |
return new MeshCubes(this); |
|
944 |
} |
|
927 | 945 |
} |
src/main/java/org/distorted/library/mesh/MeshJoined.java | ||
---|---|---|
35 | 35 |
join(meshes); |
36 | 36 |
} |
37 | 37 |
|
38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
39 |
/** |
|
40 |
* deep copy. |
|
41 |
*/ |
|
42 |
public MeshJoined(MeshJoined mesh) |
|
43 |
{ |
|
44 |
super(mesh); |
|
45 |
} |
|
46 |
|
|
47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
48 |
/** |
|
49 |
* deep copy. |
|
50 |
*/ |
|
51 |
public MeshJoined deepCopy() |
|
52 |
{ |
|
53 |
return new MeshJoined(this); |
|
54 |
} |
|
55 |
|
|
38 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | 57 |
/** |
40 | 58 |
* Return how many basic Meshes is this Mesh joined from. |
src/main/java/org/distorted/library/mesh/MeshQuad.java | ||
---|---|---|
66 | 66 |
|
67 | 67 |
setAttribs(attribs); |
68 | 68 |
} |
69 |
|
|
70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
71 |
/** |
|
72 |
* deep copy. |
|
73 |
*/ |
|
74 |
public MeshQuad(MeshQuad mesh) |
|
75 |
{ |
|
76 |
super(mesh); |
|
77 |
} |
|
78 |
|
|
79 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
80 |
/** |
|
81 |
* deep copy. |
|
82 |
*/ |
|
83 |
public MeshQuad deepCopy() |
|
84 |
{ |
|
85 |
return new MeshQuad(this); |
|
86 |
} |
|
69 | 87 |
} |
src/main/java/org/distorted/library/mesh/MeshRectangles.java | ||
---|---|---|
170 | 170 |
|
171 | 171 |
setAttribs(attribs); |
172 | 172 |
} |
173 |
|
|
174 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
175 |
/** |
|
176 |
* deep copy. |
|
177 |
*/ |
|
178 |
public MeshRectangles(MeshRectangles mesh) |
|
179 |
{ |
|
180 |
super(mesh); |
|
181 |
} |
|
182 |
|
|
183 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
184 |
/** |
|
185 |
* deep copy. |
|
186 |
*/ |
|
187 |
public MeshRectangles deepCopy() |
|
188 |
{ |
|
189 |
return new MeshRectangles(this); |
|
190 |
} |
|
173 | 191 |
} |
src/main/java/org/distorted/library/mesh/MeshSphere.java | ||
---|---|---|
267 | 267 |
|
268 | 268 |
setAttribs(attribs); |
269 | 269 |
} |
270 |
|
|
271 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
272 |
/** |
|
273 |
* deep copy. |
|
274 |
*/ |
|
275 |
public MeshSphere(MeshSphere mesh) |
|
276 |
{ |
|
277 |
super(mesh); |
|
278 |
} |
|
279 |
|
|
280 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
281 |
/** |
|
282 |
* deep copy. |
|
283 |
*/ |
|
284 |
public MeshSphere deepCopy() |
|
285 |
{ |
|
286 |
return new MeshSphere(this); |
|
287 |
} |
|
270 | 288 |
} |
src/main/java/org/distorted/library/mesh/MeshTriangles.java | ||
---|---|---|
119 | 119 |
|
120 | 120 |
setAttribs(attribs); |
121 | 121 |
} |
122 |
|
|
123 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
124 |
/** |
|
125 |
* deep copy. |
|
126 |
*/ |
|
127 |
public MeshTriangles(MeshTriangles mesh) |
|
128 |
{ |
|
129 |
super(mesh); |
|
130 |
} |
|
131 |
|
|
132 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
133 |
/** |
|
134 |
* deep copy. |
|
135 |
*/ |
|
136 |
public MeshTriangles deepCopy() |
|
137 |
{ |
|
138 |
return new MeshTriangles(this); |
|
139 |
} |
|
122 | 140 |
} |
Also available in: Unified diff
Progress with the Predeform app; deepCopy for the Meshes; various fixes.