You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BufferGeometry.getAttribute returns BufferAttribute | InterleavedBufferAttribute when using with the default generic types. But there is code in threejs that only accepts BufferAttribute and not interleaved.
normal would be a BufferAttribute|InterleavedBufferAttribute obtained from BufferGeometry.attributes (same as getAttribute), but Triangle.getInterpolatedAttribute accepts only BufferAttribute.
Note that there are no if checks in threejs around the normal variable or in Triangle.getInterpolatedAttribute, so they assume/know that this must be a strict BufferAttribute in the mesh. Can we make the same work in Typescript without casting / type assertion?
The text was updated successfully, but these errors were encountered:
BufferGeometry.getAttribute
returnsBufferAttribute | InterleavedBufferAttribute
when using with the default generic types. But there is code in threejs that only acceptsBufferAttribute
and not interleaved.For example this code in the threejs codebase itself would not compile if used as is in Typescript:
https://github.com/mrdoob/three.js/blob/9004ed1d3dacbede52c5657a1556789be10c0a77/src/objects/Mesh.js#L383
normal
would be aBufferAttribute|InterleavedBufferAttribute
obtained fromBufferGeometry.attributes
(same asgetAttribute
), butTriangle.getInterpolatedAttribute
accepts onlyBufferAttribute
.Note that there are no
if
checks in threejs around thenormal
variable or inTriangle.getInterpolatedAttribute
, so they assume/know that this must be a strictBufferAttribute
in the mesh. Can we make the same work in Typescript without casting / type assertion?The text was updated successfully, but these errors were encountered: