8000 Camera view matrix ignore scale · Issue #2748 · galacean/engine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Camera view matrix ignore scale #2748
@cptbtptpbcptdtptp

Description

@cptbtptpbcptdtptp

之前的版本做了 view matrix 忽略相机缩放

    // Ignore scale
    const transform = this._entity.transform;
    Matrix.rotationTranslation(transform.worldRotationQuaternion, transform.worldPosition, viewMatrix);
    viewMatrix.invert();
    return viewMatrix;

但是 inv view matrix 却没有忽略缩放

  /**
   * The inverse matrix of view projection matrix.
   */
  private _getInvViewProjMat(): Matrix {
    if (this._isInvViewProjDirty.flag) {
      this._isInvViewProjDirty.flag = false;
      Matrix.multiply(this._entity.transform.worldMatrix, this._getInverseProjectionMatrix(), this._invViewProjMat);
    }
    return this._invViewProjMat;
  }

如果相机的缩放不为 1 ,viewport 到 world 的空间变换会出错。

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0