Browse Source

Added copy and clone methods

WestLangley 6 năm trước cách đây
mục cha
commit
b52044b257
1 tập tin đã thay đổi với 15 bổ sung0 xóa
  1. 15 0
      src/helpers/BoxHelper.js

+ 15 - 0
src/helpers/BoxHelper.js

@@ -101,5 +101,20 @@ BoxHelper.prototype.setFromObject = function ( object ) {
 
 };
 
+BoxHelper.prototype.copy = function ( source ) {
+
+	LineSegments.prototype.copy.call( this, source );
+
+	this.object = source.object;
+
+	return this;
+
+};
+
+BoxHelper.prototype.clone = function () {
+
+	return new this.constructor().copy( this );
+
+};
 
 export { BoxHelper };