We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InstancedMesh.setMatrixAt 实例网格中实例姿态数据设置无法生效
InstancedMesh.setMatrixAt
通过以下步骤产生bug:
以下代码导致bug产生
orillusion\src\core\entities\InstancedMesh.ts
public setMatrixAt(index: number, matrix: Matrix4): this { let instance = this._instanceList[index]; let prs: Vector3[] = matrix.decompose(Orientation3D.QUATERNION); let transform = instance.transform; //localRotQuat经过copy后,已经存在最新的x,y,z,w值 transform.localRotQuat.copyFrom(prs[1]); //触发setter,但因x,y,z,w全等,导致Transform._localRot无法设置,最终旋转姿态错误(原始姿态) transform.localRotQuat = transform.localRotQuat; transform.localPosition.copyFrom(prs[0]); transform.localPosition = transform.localPosition; transform.localScale.copyFrom(prs[2]); transform.localScale = transform.localScale; return this; }
orillusion\src\components\Transform.ts
public set localRotQuat(value: Quaternion) { //此处为全等,返回false,无法进入代码块 if (value.x != this._localRotQuat.x || value.y != this._localRotQuat.y || value.z != this._localRotQuat.z || value.w != this._localRotQuat.w) { this._localRotQuat.copyFrom(value); this._localRotQuat.getEulerAngles(this._localRot); WasmMatrix.setRotation(this.index, this._localRot.x, this._localRot.y, this._localRot.z); this.notifyLocalChange(); this.onRotationChange?.(); if (this.eventRotationChange) { this.eventDispatcher.dispatchEvent(this.eventRotationChange); } } }
实例姿态正确
错误:
正确:
本地运行出错的Orillusion引擎版本0.7.2
The text was updated successfully, but these errors were encountered:
我们会修复下setMatrixAt这个API,在下个版本会尝试修复这个问题~
感谢提出的问题!
Sorry, something went wrong.
No branches or pull requests
Bug描述
InstancedMesh.setMatrixAt
实例网格中实例姿态数据设置无法生效Bug复现流程
通过以下步骤产生bug:
以下代码导致bug产生
orillusion\src\core\entities\InstancedMesh.ts
orillusion\src\components\Transform.ts
期待的结果
实例姿态正确
报错截图
错误:
正确:
测试引擎版本:
本地运行出错的Orillusion引擎版本0.7.2
本机系统 (请填写完整):
本机配置
代码示例
其他信息
The text was updated successfully, but these errors were encountered: