setRotation, setWorldRotation在添加刚体后计算错误

  • Creator 版本:3.6.2

  • 目标平台:
    chrome 110.0.5481.178(正式版本) (64 位)
    微信小程序开发工具

  • 重现方式:
    2d世界中给精灵添加刚体后,使用setRotation 或 setWorldRotation 方法赋予四元数,当旋转角度落在第二和第三象限时,实际旋转是在第一和第四象限,旋转角度在第一和第四象限的情况下方法结果符合预期。
    (PS: 测试时发现在编辑器中预览没有这个问题。)

  • 首个报错:

  • 之前哪个版本是正常的:

  • 手机型号:

  • 手机浏览器:

  • 编辑器操作系统:

  • 重现概率:


是指这个问题?

表现相同,那篇帖子里的demo删除刚体后会旋转正常,应该是同样的问题。

-我想要的效果

   enemy.getRotation(this._temp_quat);

   bullet.setRotation(this._temp_quat);

旋转会有问题

-替代方案

    enemy.getRotation(this._temp_quat);

    let r = Quat.getAxisAngle(this._temp_vec3, this._temp_quat)

    let angle = misc.radiansToDegrees(r);

    bullet.setRotationFromEuler(this._temp_vec3_1.set(0,0,angle))