瀏覽代碼

Added copy and clone methods

WestLangley 6 年之前
父節點
當前提交
b52044b257
共有 1 個文件被更改,包括 15 次插入0 次删除
  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 };
 export { BoxHelper };