|
|
|
@ -158,12 +158,12 @@ export default class Viewport { |
|
|
|
$(statsControls.dom).children().css('height', '28px') |
|
|
|
|
|
|
|
// 监听事件
|
|
|
|
this.watchList.push(watch(() => this.state.camera.position.y, (newVal) => { |
|
|
|
if (!this.state.isReady) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.updateGridVisibility() |
|
|
|
})) |
|
|
|
// this.watchList.push(watch(() => this.state.camera.position.y, (newVal) => {
|
|
|
|
// if (!this.state.isReady) {
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// this.updateGridVisibility()
|
|
|
|
// }))
|
|
|
|
|
|
|
|
// 监听窗口大小变化
|
|
|
|
if (this.resizeObserver) { |
|
|
|
@ -292,7 +292,7 @@ export default class Viewport { |
|
|
|
const camera = this.camera |
|
|
|
|
|
|
|
this.state.camera.position.x = camera.position.x |
|
|
|
this.state.camera.position.y = this.getEffectiveViewDistance() |
|
|
|
this.state.camera.position.y = camera.zoom // this.getEffectiveViewDistance()
|
|
|
|
this.state.camera.position.z = camera.position.z |
|
|
|
} |
|
|
|
} |
|
|
|
|