bottle.js/下的_jump方法/的这行代码this.obj.translateY(translateY)报错了
代码段为:
_jump (tickTime) {
const t =tickTime / 1000
this.flyingTime = this.flyingTime + t
const translateH = this.velocity.vx * t
const translateY = this.velocity.vy * t - 0.5 * gamekConf.gravity * t * t - gamekConf.gravity * this.flyingTime * t
this.obj.translateY(translateY)
this.obj.translateOnAxis(this.axis, translateH)
}
报错信息为:
this.position.add is not a function
TypeError: this.position.add is not a function
at Object3D.translateOnAxis (http://127.0.0.1:64645/game/libs/three.js:8371:19)
at Object3D.translateY (http://127.0.0.1:64645/game/libs/three.js:8397:17)
at Bottle._jump (http://127.0.0.1:64645/game/src/objects/bottle.js:195:22)
at Bottle.update (http://127.0.0.1:64645/game/src/objects/bottle.js:145:22)
at GamePage.render (http://127.0.0.1:64645/game/src/pages/game-page.js:105:29)
1.4k 16
1.0k 11
1.1k 11
4.8k 10
2.2k 9