-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Closed
Labels
Milestone
Description
Description
BatchedMesh have many silent errors on : setMatrixAt
, setColorAt
, setVisibleAt
, etc..
// if the geometry is out of range, not active, or visibility state
// does not change then return early
const drawInfo = this._drawInfo;
if (
instanceId >= drawInfo.length ||
drawInfo[ instanceId ].active === false ||
drawInfo[ instanceId ].visible === value
) {
return this;
}
So if I do setMatrixAt(outOfRangeIndex, matrix)
it will do nothing and return this, I feel we should inform the developer via a warn there is an error.
Also sometimes it return null
, this
, false
I dont know whats the current policy of threejs for this kind of error and how its manage across three, but good error message help for debugging and avoid issue/stackoverflow thread.
Solution
I suggest to add a little warning like : BatchedMesh instanceId[${instanceId}] wasnt update, this can be cause if the instance is not visible/active or wrong index
Also be consistant in the return
Alternatives
- Factorize for more precise error message.
- Remove the test and let it crash ( so the devs see there is an error and can fix the code )
Additional context
No response