engine
engine copied to clipboard
Bounding box update problem
Describe the bug According to the following code:
https://github.com/oasis-engine/engine/blob/main/packages/core/src/Renderer.ts#L83 /**
- The bounding volume of the renderer. */ get bounds(): BoundingBox { const changeFlag = this._transformChangeFlag; if (changeFlag.flag) { this._updateBounds(this._bounds); changeFlag.flag = false; } return this._bounds; }
The bounds of renderer only update when transformChangeFlag changed. When I use MeshRenderer to render a mesh and change the bounds of MeshRenderer.mesh, renderer bounds won't update. Min and max will alway be Vector3(0, 0, 0).
To Reproduce Steps to reproduce the behavior:
- Use MeshRenderer render a mesh.
- update bounds of mesh: const { bounds } = mesh; bounds.min.setValue(-1, -1, -1); bounds.max.setValue(1, 1, 1);
- the bounds of MeshRenderer is not update!
Expected behavior When update bounds of mesh, MeshRenderer's bounds will also get update.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacBook Pro (16-inch, 2019)
- Browser chrome