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

GLTFLoader: Compute world matrices before calling onLoad(). #27877

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 6, 2024

Related issue: #14499 (comment)

Description

GLTFLoader now computes the world matrices for gltf.scene and its descendant nodes before calling onLoad(). That should hopefully fix issues like #14499 (comment) where devs report wrong bounding volumes when computing them in the onLoad() callback.

Some background: This change would not be required if bounding volumes (and other logic) could request up-to-date world matrices in their routines (e.g. with a special getter). With the current world matrix computations in three.js, there is no performant way to ensure that, see #21411.

Of course the issue can also be avoided if devs remember to update their world matrices correctly but this task or responsibility is easy to overlook.

@Mugen87 Mugen87 added this to the r163 milestone Mar 6, 2024
@Mugen87 Mugen87 requested a review from donmccurdy March 6, 2024 10:30
Co-authored-by: Don McCurdy <dm@donmccurdy.com>
@Mugen87 Mugen87 merged commit 812ab91 into mrdoob:dev Mar 6, 2024
11 checks passed
@takahirox
Copy link
Collaborator

I think this change is good because that world matrices are ready when load is completed sounds more natural to me.

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.

None yet

3 participants