File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,20 @@ function getWireframeVersion( geometry ) {
1818
1919}
2020
21+ /**
22+ * Returns the wireframe ID for the given geometry.
23+ *
24+ * @private
25+ * @function
26+ * @param {BufferGeometry } geometry - The geometry.
27+ * @return {number } The ID.
28+ */
29+ function getWireframeId ( geometry ) {
30+
31+ return ( geometry . index !== null ) ? geometry . index . id : geometry . attributes . position . id ;
32+
33+ }
34+
2135/**
2236 * Returns a wireframe index attribute for the given geometry.
2337 *
@@ -65,6 +79,7 @@ function getWireframeIndex( geometry ) {
6579
6680 const attribute = new ( arrayNeedsUint32 ( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute ) ( indices , 1 ) ;
6781 attribute . version = getWireframeVersion ( geometry ) ;
82+ attribute . __id = getWireframeId ( geometry ) ;
6883
6984 return attribute ;
7085
@@ -347,7 +362,7 @@ class Geometries extends DataMap {
347362
348363 wireframes . set ( geometry , wireframeAttribute ) ;
349364
350- } else if ( wireframeAttribute . version !== getWireframeVersion ( geometry ) ) {
365+ } else if ( wireframeAttribute . version !== getWireframeVersion ( geometry ) || wireframeAttribute . __id !== getWireframeId ( geometry ) ) {
351366
352367 this . attributes . delete ( wireframeAttribute ) ;
353368
You can’t perform that action at this time.
0 commit comments