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

fix: Avoid showing the bounding box when the scene is still loading assets #906

Merged
merged 10 commits into from
Feb 29, 2024

Conversation

cyaiox
Copy link
Contributor

@cyaiox cyaiox commented Feb 27, 2024

This PR adds validation to avoid showing meshes' bounding boxes when the scene is still loading out of the layout.

It also adds a new SceneMetrics RPC and store to consume the scene metrics | limits | entitiesOutOfBoundaries outside the inspector, like from the builder.

Copy link

cloudflare-workers-and-pages bot commented Feb 27, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5782731
Status: ✅  Deploy successful!
Preview URL: https://1a5e9104.js-sdk-toolchain.pages.dev
Branch Preview URL: https://fix-bounding-box-initial-loa.js-sdk-toolchain.pages.dev

View logs

Copy link
Contributor

github-actions bot commented Feb 27, 2024

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/fix/bounding-box-initial-loading/dcl-sdk-7.4.6-8086238647.commit-51d66b7.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/fix/bounding-box-initial-loading/dcl-sdk-commands-7.4.6-8086238647.commit-51d66b7.tgz"
    npx $SDK_COMMANDS init
  • The @dcl/inspector package can be tested by visiting this url

    • Or by installing it via NPM
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/fix/bounding-box-initial-loading/@dcl/inspector/dcl-inspector-7.4.6-8086238647.commit-51d66b7.tgz"
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/fix/bounding-box-initial-loading-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=fix/bounding-box-initial-loading

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 86.33094% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 67.13%. Comparing base (2c5f6a7) to head (5782731).

Files Patch % Lines
...es/@dcl/inspector/src/redux/scene-metrics/types.ts 0.00% 6 Missing and 1 partial ⚠️
...nspector/src/lib/babylon/decentraland/EcsEntity.ts 25.00% 6 Missing ⚠️
...es/@dcl/inspector/src/redux/scene-metrics/index.ts 92.59% 4 Missing ⚠️
packages/@dcl/inspector/src/redux/store.ts 80.00% 1 Missing ⚠️
packages/@dcl/inspector/src/tooling-entrypoint.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   66.81%   67.13%   +0.32%     
==========================================
  Files         524      529       +5     
  Lines       16542    16676     +134     
  Branches     2111     2132      +21     
==========================================
+ Hits        11052    11196     +144     
+ Misses       5155     5143      -12     
- Partials      335      337       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -244,22 +248,22 @@ async function validateEntityIsOutsideLayout(entity: EcsEntity) {

function updateMeshBoundingBoxVisibility(entity: EcsEntity, mesh: BABYLON.AbstractMesh) {
const scene = mesh.getScene()
if (scene.isLoading) return
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition added to avoid showing bounding boxes while the scene is still loading assets

@cyaiox cyaiox merged commit 2e58941 into main Feb 29, 2024
10 checks passed
@cyaiox cyaiox deleted the fix/bounding-box-initial-loading branch February 29, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants