Skip to content

Updating a line component using a cached THREE.Vector3 fails #3681

@InfiniteLee

Description

@InfiniteLee

A line component will not update if using a cached THREE.Vector3 to call setAttribute. I believe this is because deepEqual is used in component to determine if an attribute was actually updated or not. As such, this probably affects other components that similarly allow (or at least don't explicitly disallow) the use of THREE vectors.

Aside from updating the deepEqual method, another option may be to allow forcing an update via another attribute like needsUpdate.

        init() {
          this.end = new THREE.Vector3();
        },
        
        tick() {
          this.end.set(Math.random(),  Math.random(),  Math.random());
          this.el.setAttribute("line", {end: this.end}); //will not update after the first tick
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions