Scene auto-update disabled

https://threejs.org/docs/#api/en/scenes/Scene.autoUpdate

Once this is disabled, how does one update the matrices of all the objects in that scene?

Is it a case of :

.updateMatrix () :

Updates the local transform.

.updateMatrixWorld ( force : Boolean ) :

Updates the global transform of the object and its descendants.

.updateWorldMatrix ( updateParents : Boolean, updateChildren : Boolean ) :

updateParents - recursively updates global transform of ancestors.
updateChildren - recursively updates global transform of descendants.

Updates the global transform of the object.

But at which points should i call the update? How do i know when an object needs an update?

In general, a world matrix only requires an update when the transformation of its 3D object or one of its ancestors has been changed.

The update can be lazy. Meaning you perform the update only when you actually need the matrix. This will become necessary when you want to render a frame. However, sometimes you need access to the matrix before that happens e.g. when doing collision detection. In this case, you want to (manually) compute the matrices earlier.

I suggest you do not touch the autoUpdate unless you fully understand the world matrix computation logic. This will at least ensure your rendering is correct.

1 Like

Thanks for the response.

This is the right track, you only need to update when you have a change or something happening PQS wise.
I am calling this whenever i do any PQS transformations and it works.

Having autoUpdate on slows down the CPU performance. This helps.
object2.updateMatrixWorld();