Skip to content

Suggestion: separate updateMatrixWorld() from recursive descendant updates #33137

@PoseidonEnergy

Description

@PoseidonEnergy

Description

Object3D.updateMatrixWorld() currently does more than its name suggests: it may update the local matrix, it updates the current object's world matrix, and it also recursively updates descendants.

That makes it harder to reason about, harder to override, and inconsistent with updateMatrix(), which only updates the matrix named by the method. It also means there is no simple “update only this object’s world matrix now” call.

Before I spend more time iterating on an implementation, I’d like to know the general sentiment here: would maintainers consider a breaking change in this area?

Specifically, would you entertain changing updateMatrixWorld() so it only updates the current object's world matrix, while the current recursive “ensure matrices for this subtree” behavior moves to a separate method or API (name/signature TBD)?

I’m not attached to a particular name or exact API shape. The main goal is just to separate:

  • updating one object's world matrix
  • recursively ensuring matrices for a subtree

I’m also not asking to remove subtree updates, only to make that behavior explicit.

Solution

I have a prototype PR here: #32962

Alternatives

  • Keep the current behavior and add a new single-object world-matrix method instead.
  • Expand updateMatrixWorld() / updateWorldMatrix() so all behaviors are controlled by arguments.
  • Leave the API as-is if this kind of breaking change is considered off-limits.

Additional context

Related: #16350, #21387

The main question of this issue is not whether that exact PR should be merged, but whether this direction is something the project would be open to at all. If yes, I’d be happy to adapt the API shape to project preferences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions