@@ -57,19 +57,19 @@ class TessellateModifier {
5757 const hasNormals = attributes . normal !== undefined
5858 const hasColors = attributes . color !== undefined
5959 const hasUVs = attributes . uv !== undefined
60- const hasUV2s = attributes . uv2 !== undefined
60+ const hasUV1s = attributes . uv1 !== undefined
6161
6262 let positions = attributes . position . array
6363 let normals = hasNormals ? attributes . normal . array : null
6464 let colors = hasColors ? attributes . color . array : null
6565 let uvs = hasUVs ? attributes . uv . array : null
66- let uv2s = hasUV2s ? attributes . uv2 . array : null
66+ let uv1s = hasUV1s ? attributes . uv1 . array : null
6767
6868 let positions2 = ( positions as unknown ) as number [ ]
6969 let normals2 = ( normals as unknown ) as number [ ]
7070 let colors2 = ( colors as unknown ) as number [ ]
7171 let uvs2 = ( uvs as unknown ) as number [ ]
72- let uv2s2 = ( uv2s as unknown ) as number [ ]
72+ let uv1s2 = ( uv1s as unknown ) as number [ ]
7373
7474 let iteration = 0
7575 let tessellating = true
@@ -113,14 +113,14 @@ class TessellateModifier {
113113 uvs2 . push ( u3 . x , u3 . y )
114114 }
115115
116- if ( hasUV2s ) {
116+ if ( hasUV1s ) {
117117 const u21 = u2s [ a ]
118118 const u22 = u2s [ b ]
119119 const u23 = u2s [ c ]
120120
121- uv2s2 . push ( u21 . x , u21 . y )
122- uv2s2 . push ( u22 . x , u22 . y )
123- uv2s2 . push ( u23 . x , u23 . y )
121+ uv1s2 . push ( u21 . x , u21 . y )
122+ uv1s2 . push ( u22 . x , u22 . y )
123+ uv1s2 . push ( u23 . x , u23 . y )
124124 }
125125 }
126126
@@ -146,9 +146,9 @@ class TessellateModifier {
146146 uvs2 = [ ]
147147 }
148148
149- if ( hasUV2s ) {
150- uv2s = uv2s2 as any
151- uv2s2 = [ ]
149+ if ( hasUV1s ) {
150+ uv1s = uv1s2 as any
151+ uv1s2 = [ ]
152152 }
153153
154154 for ( let i = 0 , i2 = 0 , il = positions . length ; i < il ; i += 9 , i2 += 6 ) {
@@ -174,10 +174,10 @@ class TessellateModifier {
174174 uc . fromArray ( uvs , i2 + 4 )
175175 }
176176
177- if ( hasUV2s && uv2s ) {
178- u2a . fromArray ( uv2s , i2 + 0 )
179- u2b . fromArray ( uv2s , i2 + 2 )
180- u2c . fromArray ( uv2s , i2 + 4 )
177+ if ( hasUV1s && uv1s ) {
178+ u2a . fromArray ( uv1s , i2 + 0 )
179+ u2b . fromArray ( uv1s , i2 + 2 )
180+ u2c . fromArray ( uv1s , i2 + 4 )
181181 }
182182
183183 const dab = va . distanceToSquared ( vb )
@@ -192,7 +192,7 @@ class TessellateModifier {
192192 if ( hasNormals ) nm . lerpVectors ( na , nb , 0.5 )
193193 if ( hasColors ) cm . lerpColors ( ca , cb , 0.5 )
194194 if ( hasUVs ) um . lerpVectors ( ua , ub , 0.5 )
195- if ( hasUV2s ) u2m . lerpVectors ( u2a , u2b , 0.5 )
195+ if ( hasUV1s ) u2m . lerpVectors ( u2a , u2b , 0.5 )
196196
197197 addTriangle ( 0 , 3 , 2 )
198198 addTriangle ( 3 , 1 , 2 )
@@ -201,7 +201,7 @@ class TessellateModifier {
201201 if ( hasNormals ) nm . lerpVectors ( nb , nc , 0.5 )
202202 if ( hasColors ) cm . lerpColors ( cb , cc , 0.5 )
203203 if ( hasUVs ) um . lerpVectors ( ub , uc , 0.5 )
204- if ( hasUV2s ) u2m . lerpVectors ( u2b , u2c , 0.5 )
204+ if ( hasUV1s ) u2m . lerpVectors ( u2b , u2c , 0.5 )
205205
206206 addTriangle ( 0 , 1 , 3 )
207207 addTriangle ( 3 , 2 , 0 )
@@ -210,7 +210,7 @@ class TessellateModifier {
210210 if ( hasNormals ) nm . lerpVectors ( na , nc , 0.5 )
211211 if ( hasColors ) cm . lerpColors ( ca , cc , 0.5 )
212212 if ( hasUVs ) um . lerpVectors ( ua , uc , 0.5 )
213- if ( hasUV2s ) u2m . lerpVectors ( u2a , u2c , 0.5 )
213+ if ( hasUV1s ) u2m . lerpVectors ( u2a , u2c , 0.5 )
214214
215215 addTriangle ( 0 , 1 , 3 )
216216 addTriangle ( 3 , 1 , 2 )
@@ -237,8 +237,8 @@ class TessellateModifier {
237237 geometry2 . setAttribute ( 'uv' , new Float32BufferAttribute ( uvs2 as any , 2 ) )
238238 }
239239
240- if ( hasUV2s ) {
241- geometry2 . setAttribute ( 'uv2 ' , new Float32BufferAttribute ( uv2s2 as any , 2 ) )
240+ if ( hasUV1s ) {
241+ geometry2 . setAttribute ( 'uv1 ' , new Float32BufferAttribute ( uv1s2 as any , 2 ) )
242242 }
243243
244244 return geometry2
0 commit comments