猫史档案馆


帮我看看这段代码哪错了

用户:KaNSFKaNSF查看:3 回复:1 评论:3 创建时间:2021-06-29T15:20:54


代码:

for(const e of world.querySelectorAll('*')){
    if(e.id==='车'){
        e.collides = true
        e.onEntityContact(({other})=>{
            if(!other.isPlayer)return
            other.mesh = e.mesh
            other.meshScale = e.meshScale
            other.meshOrientation = Quat.rotateY(Math.PI)
            other.player.invisible = true
            other.player.runSpeed = 2.2
            other.player.runAcceleration = 0.1
            other.player.scale = e.meshScale.scale(e.bounds.y / other.bounds.y)
        })
    }
}

错误:

ReferenceError:Quat is not defind  at eval( index.js:8:37 )


回复

上一页1 页 / 共 1下一页
async_functionasync_function

other.meshOrientation = Quat.rotateY(Math.PI)

Quat未定义,const一下就好了

点赞1


评论