copy method
recursive
-- If set to true
, descendants of the object are copied next to the existing ones.
If set to false
, descendants are left unchanged. Default is true
.
Copies the given object into this object. Note: Event listeners and user-defined callbacks (onAfterRender and onBeforeRender) are not copied.
Implementation
@override
Mesh copy(Object3D source, [bool? recursive]) {
super.copy(source, false);
if (source is Mesh) {
if (source.morphTargetInfluences.isNotEmpty) {
morphTargetInfluences = source.morphTargetInfluences.sublist(0);
}
if (source.morphTargetDictionary != null) {
morphTargetDictionary = json.decode(json.encode(source.morphTargetDictionary));
}
material = source.material;
geometry = source.geometry;
}
return this;
}