Skip to content
New issue

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

Bounding box update problem #401

Closed
johanzhu opened this issue Jul 19, 2021 · 0 comments · Fixed by #1132
Closed

Bounding box update problem #401

johanzhu opened this issue Jul 19, 2021 · 0 comments · Fixed by #1132
Assignees
Labels
bug Something isn't working
Milestone

Comments

@johanzhu
Copy link
Contributor

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:

  1. Use MeshRenderer render a mesh.
  2. update bounds of mesh:
    const { bounds } = mesh;
    bounds.min.setValue(-1, -1, -1);
    bounds.max.setValue(1, 1, 1);
  3. 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
@gz65555 gz65555 added the bug Something isn't working label Aug 17, 2022
@gz65555 gz65555 added this to the 0.9 milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants