Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/three_js_core/lib/objects/group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,18 @@ class Group extends Object3D {
Group.fromJson(Map<String, dynamic> json, Map<String, dynamic> rootJson):super.fromJson(json, rootJson) {
type = 'Group';
}

@override
Group clone ([bool? recursive = true]) {
return Group()..copy(this, recursive);
}

@override
Group copy(Object3D source, [bool? recursive]) {
super.copy(source, recursive);
if(source is Group) {
this.userData = Map<String, dynamic>.from(source.userData);
}
return this;
}
}
4 changes: 2 additions & 2 deletions packages/three_js_core/lib/objects/line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Line extends Object3D {
Line copy(Object3D source, [bool? recursive]) {
super.copy(source);

material = source.material;
geometry = source.geometry;
material = source.material?.clone();
geometry = source.geometry?.clone();

return this;
}
Expand Down
5 changes: 5 additions & 0 deletions packages/three_js_core/lib/objects/line_segments.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ class LineSegments extends Line {

return this;
}

@override
LineSegments clone([bool? recursive = true]) {
return LineSegments(this.geometry)..copy(this, recursive);
}
}
Loading