Do I have to call both Mesh.updateBound() and Geometry.updateModelBound() to update a custom mesh?

In the Custom Mesh documentation it says,

If you are modifying a mesh dynamically in a way which changes the model’s bounds, you need to update it by calling mesh.updateBound() and then Geometry.updateModelBound()

But, Geometry.updateModelBound() calls mesh.updateBound().

    public void updateModelBound() {
        mesh.updateBound();
        setBoundRefresh();
    }

So I only have to call mesh.updateBound() if I am not calling Geometry.updateModelBound(). Right?

Right.

4 Likes

This is what I often do:

public SomeMesh (float size) {
    init-all-the-buffers();
    setBuffer( ... );

    this.updateBound();
}

I never update from the geometry, and it works fine

Then your geometry’s bounding box is all screwed up and thus it won’t clip properly.

1 Like