Skip to content

Error encountered when cloning a BatchedMesh: Uncaught TypeError: this._matricesTexture.image.slice is not a function #28803

@lanvada

Description

@lanvada

Description

While attempting to clone a BatchedMesh, I encountered the following error: Uncaught TypeError: this._matricesTexture.image.slice is not a function.

I noticed that the BatchedMesh source code contains the following lines:

...
// Line 930
this._matricesTexture.image.data = this._matricesTexture.image.slice();
...
// Line 935
this._colorsTexture.image.data = this._colorsTexture.image.slice();
...

During debugging, I observed that the data property of image is a TypedArray, but image itself does not have a slice() method. I am wondering if image.slice() should be modified to image.data.slice()?

Reproduction steps

Clone a BatchedMesh

Code

none

Live example

none

Screenshots

No response

Version

r166

Device

Desktop

Browser

Chrome

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions