cocos3D-物体旋转


1、物体给定某个旋转力度,然后形成旋转。

2、准备

  

 

   绑定代码:
  

 

 

 

  3、代码实现

  

    @property
    readonly USE_ROTATION = false;
    private readonly _rot = new Quat();
    @property({ visible: function (this: rotation) { return this.USE_ROTATION } })
    readonly deltaEuler = new Vec3();
   
    start () {
        Quat.fromEuler(this._rot, this.deltaEuler.x, this.deltaEuler.y, this.deltaEuler.z);
    }

    update(deltaTime: number): void{
        this.node.rotate(this._rot, Node.NodeSpace.WORLD);
    }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM