|
@@ -256,6 +256,8 @@ public class MeshAttachment extends VertexAttachment {
|
|
MeshAttachment copy = new MeshAttachment(name);
|
|
MeshAttachment copy = new MeshAttachment(name);
|
|
copy.region = region;
|
|
copy.region = region;
|
|
copy.path = path;
|
|
copy.path = path;
|
|
|
|
+ copy.color.set(color);
|
|
|
|
+ copy.inheritDeform = inheritDeform;
|
|
|
|
|
|
if (parentMesh == null) {
|
|
if (parentMesh == null) {
|
|
copyTo(copy);
|
|
copyTo(copy);
|
|
@@ -265,11 +267,8 @@ public class MeshAttachment extends VertexAttachment {
|
|
System.arraycopy(uvs, 0, copy.uvs, 0, uvs.length);
|
|
System.arraycopy(uvs, 0, copy.uvs, 0, uvs.length);
|
|
copy.triangles = new short[triangles.length];
|
|
copy.triangles = new short[triangles.length];
|
|
System.arraycopy(triangles, 0, copy.triangles, 0, triangles.length);
|
|
System.arraycopy(triangles, 0, copy.triangles, 0, triangles.length);
|
|
- copy.color.set(color);
|
|
|
|
copy.hullLength = hullLength;
|
|
copy.hullLength = hullLength;
|
|
|
|
|
|
- copy.inheritDeform = inheritDeform;
|
|
|
|
-
|
|
|
|
// Nonessential.
|
|
// Nonessential.
|
|
if (edges != null) {
|
|
if (edges != null) {
|
|
copy.edges = new short[edges.length];
|
|
copy.edges = new short[edges.length];
|
|
@@ -284,4 +283,16 @@ public class MeshAttachment extends VertexAttachment {
|
|
|
|
|
|
return copy;
|
|
return copy;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /** returns a mesh linking to this mesh. **/
|
|
|
|
+ public MeshAttachment newLinkedMesh () {
|
|
|
|
+ MeshAttachment linkedMesh = new MeshAttachment(name);
|
|
|
|
+ linkedMesh.region = region;
|
|
|
|
+ linkedMesh.path = path;
|
|
|
|
+ linkedMesh.color.set(color);
|
|
|
|
+ linkedMesh.inheritDeform = inheritDeform;
|
|
|
|
+ linkedMesh.setParentMesh(parentMesh != null ? parentMesh : this);
|
|
|
|
+ linkedMesh.updateUVs();
|
|
|
|
+ return linkedMesh;
|
|
|
|
+ }
|
|
}
|
|
}
|