From e671b3036a3f21dc4cd541a8a4be0c368f1e3650 Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Tue, 30 Mar 2021 22:54:21 +0800 Subject: [PATCH 1/3] Bone: Covert to ES6. --- src/objects/Bone.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/objects/Bone.js b/src/objects/Bone.js index 3d375cadd40ec3..042eee17af248a 100644 --- a/src/objects/Bone.js +++ b/src/objects/Bone.js @@ -1,20 +1,15 @@ import { Object3D } from '../core/Object3D.js'; -function Bone() { +class Bone extends Object3D { - Object3D.call( this ); + constructor() { - this.type = 'Bone'; + this.type = 'Bone'; -} - -Bone.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Bone, + } - isBone: true - -} ); +} +Bone.prototype.isBone = true; export { Bone }; From ace203cf300f70f4baee5b9c67b27ab2cb819912 Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Wed, 31 Mar 2021 08:40:26 +0800 Subject: [PATCH 2/3] Add super(); --- src/objects/Bone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/objects/Bone.js b/src/objects/Bone.js index 042eee17af248a..96ec242ba25796 100644 --- a/src/objects/Bone.js +++ b/src/objects/Bone.js @@ -3,6 +3,8 @@ import { Object3D } from '../core/Object3D.js'; class Bone extends Object3D { constructor() { + + super(); this.type = 'Bone'; From 59b58526ce72eb45849a4d65b3a9306495b60798 Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Wed, 31 Mar 2021 09:16:13 +0800 Subject: [PATCH 3/3] Clean up. --- src/objects/Bone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/Bone.js b/src/objects/Bone.js index 96ec242ba25796..01d87b5fb944b5 100644 --- a/src/objects/Bone.js +++ b/src/objects/Bone.js @@ -3,7 +3,7 @@ import { Object3D } from '../core/Object3D.js'; class Bone extends Object3D { constructor() { - + super(); this.type = 'Bone';