Optimize invoking skinview3d

This commit is contained in:
Pig Fang 2019-12-24 19:33:35 +08:00
parent 2b827cf651
commit 78ae974e7a
3 changed files with 8 additions and 13 deletions

View File

@ -75,14 +75,6 @@ export default {
},
},
data: () => ({
/** @type {skinview3d.SkinViewer} */
viewer: null,
handles: {
walk: null,
run: null,
rotate: null,
},
control: null,
paused: false,
}),
computed: {
@ -135,9 +127,12 @@ export default {
})
this.viewer.camera.position.z = this.initPositionZ
this.viewer.animation = new skinview3d.CompositeAnimation()
this.handles.walk = this.viewer.animation.add(skinview3d.WalkingAnimation)
this.handles.run = this.viewer.animation.add(skinview3d.RunningAnimation)
this.handles.rotate = this.viewer.animation.add(skinview3d.RotatingAnimation)
this.handles = {
walk: this.viewer.animation.add(skinview3d.WalkingAnimation),
run: this.viewer.animation.add(skinview3d.RunningAnimation),
rotate: this.viewer.animation.add(skinview3d.RotatingAnimation),
}
this.handles.run.paused = true
this.control = skinview3d.createOrbitControls(this.viewer)
},
@ -154,8 +149,6 @@ export default {
},
reset() {
this.viewer.dispose()
this.handles = {}
this.control = null
this.initPreviewer()
this.handles.walk.paused = true
this.handles.run.paused = true

View File

@ -28,6 +28,7 @@
- Upgraded AdminLTE to v3.
- Lengthened `ip` field in order to support IPv6.
- Optimized performance of validating player name.
- Optimized performance of invoking texture previewer (skinview3d).
## Fixed

View File

@ -28,6 +28,7 @@
- AdminLTE 升级到 v3
- 将 `ip` 字段的长度增加到 39 以支持 IPv6
- 优化角色名校验的性能
- 优化调用材质预览器skinview3d的性能
## 修复