为什么,取相机的投影矩阵的数值,都是整数1,0呢,自定义的Mat4矩阵,取的值有小数---已解决

this.ty_Camera.camera.matProj —一直取值都是1,0,没有小数部分?

import { _decorator, Component, Node, Camera, Material } from 'cc';

const { ccclass, property } = _decorator;

@ccclass('cammat')

export class cammat extends Component {

    @property(Camera) //投影相机

    public MainCamera: Camera = null;

    @property(Material) //材质

    public ty_Mater: Material = null;

    start() {

        //matProj 和 matView一直是都是整数。。

        console.log("相机  投影矩阵:",this.MainCamera.camera.matProj.m00.toFixed(5));

        console.log("相机  视图矩阵:",this.MainCamera.camera.matView);

        //传值后,小数部分丢失了。。。。

        this.ty_Mater.setProperty('matProj', this.MainCamera.camera.matProj);

    }

    update(deltaTime: number) {

       

    }

}

哈哈,解决了:—看编辑器源码,找到的这两段话:要自己算一下才行,
Mat4.invert(this._matView, this._node.worldMatrix);
Mat4.perspective(this._matProj, this._fov, this._aspect, this._nearClip, this._farClip)