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