Issue about bounding box calculation of legacy model

https://playcanvas.com/project/1257730/overview/boundingtest

const meshInstances = this.app.root.findByName('Model').model.meshInstances;

    const bounding = new pc.BoundingBox();

    meshInstances.forEach((meshInstance, index) => {

        if (index === 0) {
            bounding.copy(meshInstance.aabb);
        } else {
            bounding.add(meshInstance.aabb);
        }
    });

    console.log("bounding", bounding);

    // --- add a cube to match the bounding box
    const cube = new pc.Entity();
    cube.addComponent('render', {
        type: 'box'
    });
    this.app.root.addChild(cube);

    cube.setPosition(bounding.center);
    cube.setLocalScale(bounding.halfExtents.mulScalar(2));

the above code doesn’t calculate bounding box correctly. Only position is correct but all other properties are 0, so it doesn’t show any bounding.

Hope to get help. Thanks

Hi @Vitaly_Yanovsky1 - I’m not sure I see the problem, when I run the project, I see the bounds perfectly fitting those 3 cubes?

Thanks for your try. I mean to calculate the bounding box of this legacy model.