Bounding box does not compute correctly

I was gonna prep a trailer for v6 but then noticed this, so I threw a trailer out the window…

repro: Babylon.js Playground

There are 3 ways to fix the correct bounding box.
a) comment out sphere.attachToBone(sk.bones[sk.getBoneIndexByName("Bone.001")], body);
b) or comment out anim.goToFrame(anim.toFrame);
c) or change the PG version to 4.2.1 :smiley:

I did a quick scour of the changelog and didn’t see any breaking announcement related to it. But a ton of work was done to animations… so wai ? or bug ?

Maybe @bghgary knows something about this ?

Sorry, I don’t see the difference between the current and 4.2.1 version? In both cases the sphere is being pushed to outside the cube right?

I think we are talking about the bounding box. In 4.2.1, the bounding box matches the box. In latest, it does not.



It seems to be intermittent though. Sometime latest will show the correct bounding box.

It looks like the bounding box center is different sometimes. When it works, it’s (0, 1, 0) but sometimes it will be computed as (0, 0, 0) which creates the offset.

If I put a setTimeout, it seems to always work:

Did we change the way animationEnd works between 4.2.1 and latest?

Will be fixed by Fix Skeleton Bounding Box Timing issue by sebavan · Pull Request #13561 · BabylonJS/Babylon.js · GitHub


Tested, fix works. Marking as solved, thanks!