What was the bug fixed in PR #12504?

@Deltakosh @RaananW I’ve asked in the PR, but asking here as well just in case - What was the bug fixed in that PR? I’m doing an upgrade and I’m having to do computeWorldMatrix(true) in a bunch of places to stay compatible. So I was thinking about reverting this change with a prototype override.

I also experienced this issue at the time while upgrading! I forgot to ask about it after I added a bunch of computeWorldMatrix(true), but I am still curious to know what happened ^^

1 Like

I’m interested by a PG that repro the needs to call compute WM manually
I may have missed something :slight_smile:

2 Likes

Yeah, would be great to see where computeWorldMatrix is needed. TBH - this was 3 years ago, so it’s hard to follow up correctly here, but this has been in for a long time without anyone mentioning this fix. Maybe you encountered another bug that was introduced after this was merged. So - if it is a new bug that surfaced after this one, we should squash it! :slight_smile:

I tried reproducing it and couldn’t :thinking: Maybe it has been fixed in the last 3 years. Do you have the issue in modern versions (7 or 8?) @fazil47 ?

@RaananW @Deltakosh here’s the repro https://codesandbox.io/p/devbox/boring-wilson-ggky97

Before the fix, on version 5.2.0 compared to something like 6.0, the world matrix is immediately recomputed after setting the absolute position. This is just one scenario, iirc calling setAbsolutePosition isn’t the only time this happens.

Not sure I understand the difference.
Here is your playground with 5.57.1 - Babylon.js Playground
Which has the same result as the latest version (Babylon.js Playground)

You have to go to a version before 5.5.6 to see the difference.

Looking at the code - this seems to be the expected, correct behavior. It has nothing to do with absolute position - it’s the same behavior if you change any other transformation parameter (like position). During rendering we make sure the world matrix is updated correctly - hence after render the matrix is updated. However, if you need it on the first frame you will have to force-compute it yourself. Which you are already doing. the only difference is that now you actually need to pass true instead of false. It used to work because of the bug mentioned in the PR you referenced, which force-computed the world matrix even if not needed and not forced.

Just to be sure, let’s wait for @Deltakosh’s answer. However - I am very sure this is not a bug :slight_smile:

2 Likes

I do confirm this is expected as we wait for the render phase to update as late as possible.

1 Like