@@ -1135,85 +1135,85 @@ export class Geometry implements IGetSetVerticesData {
1135
1135
if ( this . isVerticesDataPresent ( VertexBuffer . PositionKind ) ) {
1136
1136
serializationObject . positions = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . PositionKind ) ) ;
1137
1137
if ( this . isVertexBufferUpdatable ( VertexBuffer . PositionKind ) ) {
1138
- serializationObject . positions . _updatable = true ;
1138
+ serializationObject . positionsUpdatable = true ;
1139
1139
}
1140
1140
}
1141
1141
1142
1142
if ( this . isVerticesDataPresent ( VertexBuffer . NormalKind ) ) {
1143
1143
serializationObject . normals = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . NormalKind ) ) ;
1144
1144
if ( this . isVertexBufferUpdatable ( VertexBuffer . NormalKind ) ) {
1145
- serializationObject . normals . _updatable = true ;
1145
+ serializationObject . normalsUpdatable = true ;
1146
1146
}
1147
1147
}
1148
1148
1149
1149
if ( this . isVerticesDataPresent ( VertexBuffer . TangentKind ) ) {
1150
1150
serializationObject . tangents = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . TangentKind ) ) ;
1151
1151
if ( this . isVertexBufferUpdatable ( VertexBuffer . TangentKind ) ) {
1152
- serializationObject . tangents . _updatable = true ;
1152
+ serializationObject . tangentsUpdatable = true ;
1153
1153
}
1154
1154
}
1155
1155
1156
1156
if ( this . isVerticesDataPresent ( VertexBuffer . UVKind ) ) {
1157
1157
serializationObject . uvs = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UVKind ) ) ;
1158
1158
if ( this . isVertexBufferUpdatable ( VertexBuffer . UVKind ) ) {
1159
- serializationObject . uvs . _updatable = true ;
1159
+ serializationObject . uvsUpdatable = true ;
1160
1160
}
1161
1161
}
1162
1162
1163
1163
if ( this . isVerticesDataPresent ( VertexBuffer . UV2Kind ) ) {
1164
1164
serializationObject . uvs2 = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UV2Kind ) ) ;
1165
1165
if ( this . isVertexBufferUpdatable ( VertexBuffer . UV2Kind ) ) {
1166
- serializationObject . uvs2 . _updatable = true ;
1166
+ serializationObject . uvs2Updatable = true ;
1167
1167
}
1168
1168
}
1169
1169
1170
1170
if ( this . isVerticesDataPresent ( VertexBuffer . UV3Kind ) ) {
1171
1171
serializationObject . uvs3 = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UV3Kind ) ) ;
1172
1172
if ( this . isVertexBufferUpdatable ( VertexBuffer . UV3Kind ) ) {
1173
- serializationObject . uvs3 . _updatable = true ;
1173
+ serializationObject . uvs3Updatable = true ;
1174
1174
}
1175
1175
}
1176
1176
1177
1177
if ( this . isVerticesDataPresent ( VertexBuffer . UV4Kind ) ) {
1178
1178
serializationObject . uvs4 = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UV4Kind ) ) ;
1179
1179
if ( this . isVertexBufferUpdatable ( VertexBuffer . UV4Kind ) ) {
1180
- serializationObject . uvs4 . _updatable = true ;
1180
+ serializationObject . uvs4Updatable = true ;
1181
1181
}
1182
1182
}
1183
1183
1184
1184
if ( this . isVerticesDataPresent ( VertexBuffer . UV5Kind ) ) {
1185
1185
serializationObject . uvs5 = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UV5Kind ) ) ;
1186
1186
if ( this . isVertexBufferUpdatable ( VertexBuffer . UV5Kind ) ) {
1187
- serializationObject . uvs5 . _updatable = true ;
1187
+ serializationObject . uvs5Updatable = true ;
1188
1188
}
1189
1189
}
1190
1190
1191
1191
if ( this . isVerticesDataPresent ( VertexBuffer . UV6Kind ) ) {
1192
1192
serializationObject . uvs6 = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . UV6Kind ) ) ;
1193
1193
if ( this . isVertexBufferUpdatable ( VertexBuffer . UV6Kind ) ) {
1194
- serializationObject . uvs6 . _updatable = true ;
1194
+ serializationObject . uvs6Updatable = true ;
1195
1195
}
1196
1196
}
1197
1197
1198
1198
if ( this . isVerticesDataPresent ( VertexBuffer . ColorKind ) ) {
1199
1199
serializationObject . colors = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . ColorKind ) ) ;
1200
1200
if ( this . isVertexBufferUpdatable ( VertexBuffer . ColorKind ) ) {
1201
- serializationObject . colors . _updatable = true ;
1201
+ serializationObject . colorsUpdatable = true ;
1202
1202
}
1203
1203
}
1204
1204
1205
1205
if ( this . isVerticesDataPresent ( VertexBuffer . MatricesIndicesKind ) ) {
1206
1206
serializationObject . matricesIndices = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . MatricesIndicesKind ) ) ;
1207
- serializationObject . matricesIndices . _isExpanded = true ;
1207
+ serializationObject . matricesIndicesExpanded = true ;
1208
1208
if ( this . isVertexBufferUpdatable ( VertexBuffer . MatricesIndicesKind ) ) {
1209
- serializationObject . matricesIndices . _updatable = true ;
1209
+ serializationObject . matricesIndicesUpdatable = true ;
1210
1210
}
1211
1211
}
1212
1212
1213
1213
if ( this . isVerticesDataPresent ( VertexBuffer . MatricesWeightsKind ) ) {
1214
1214
serializationObject . matricesWeights = this . _toNumberArray ( this . getVerticesData ( VertexBuffer . MatricesWeightsKind ) ) ;
1215
1215
if ( this . isVertexBufferUpdatable ( VertexBuffer . MatricesWeightsKind ) ) {
1216
- serializationObject . matricesWeights . _updatable = true ;
1216
+ serializationObject . matricesWeightsUpdatable = true ;
1217
1217
}
1218
1218
}
1219
1219
@@ -1409,44 +1409,44 @@ export class Geometry implements IGetSetVerticesData {
1409
1409
}
1410
1410
}
1411
1411
} else if ( parsedGeometry . positions && parsedGeometry . normals && parsedGeometry . indices ) {
1412
- mesh . setVerticesData ( VertexBuffer . PositionKind , parsedGeometry . positions , parsedGeometry . positions . _updatable ) ;
1412
+ mesh . setVerticesData ( VertexBuffer . PositionKind , parsedGeometry . positions , parsedGeometry . positions . _updatable || parsedGeometry . positionsUpdatable ) ;
1413
1413
1414
- mesh . setVerticesData ( VertexBuffer . NormalKind , parsedGeometry . normals , parsedGeometry . normals . _updatable ) ;
1414
+ mesh . setVerticesData ( VertexBuffer . NormalKind , parsedGeometry . normals , parsedGeometry . normals . _updatable || parsedGeometry . normalsUpdatable ) ;
1415
1415
1416
1416
if ( parsedGeometry . tangents ) {
1417
- mesh . setVerticesData ( VertexBuffer . TangentKind , parsedGeometry . tangents , parsedGeometry . tangents . _updatable ) ;
1417
+ mesh . setVerticesData ( VertexBuffer . TangentKind , parsedGeometry . tangents , parsedGeometry . tangents . _updatable || parsedGeometry . tangentsUpdatable ) ;
1418
1418
}
1419
1419
1420
1420
if ( parsedGeometry . uvs ) {
1421
- mesh . setVerticesData ( VertexBuffer . UVKind , parsedGeometry . uvs , parsedGeometry . uvs . _updatable ) ;
1421
+ mesh . setVerticesData ( VertexBuffer . UVKind , parsedGeometry . uvs , parsedGeometry . uvs . _updatable || parsedGeometry . uvsUpdatable ) ;
1422
1422
}
1423
1423
1424
1424
if ( parsedGeometry . uvs2 ) {
1425
- mesh . setVerticesData ( VertexBuffer . UV2Kind , parsedGeometry . uvs2 , parsedGeometry . uvs2 . _updatable ) ;
1425
+ mesh . setVerticesData ( VertexBuffer . UV2Kind , parsedGeometry . uvs2 , parsedGeometry . uvs2 . _updatable || parsedGeometry . uvs2Updatable ) ;
1426
1426
}
1427
1427
1428
1428
if ( parsedGeometry . uvs3 ) {
1429
- mesh . setVerticesData ( VertexBuffer . UV3Kind , parsedGeometry . uvs3 , parsedGeometry . uvs3 . _updatable ) ;
1429
+ mesh . setVerticesData ( VertexBuffer . UV3Kind , parsedGeometry . uvs3 , parsedGeometry . uvs3 . _updatable || parsedGeometry . uvs3Updatable ) ;
1430
1430
}
1431
1431
1432
1432
if ( parsedGeometry . uvs4 ) {
1433
- mesh . setVerticesData ( VertexBuffer . UV4Kind , parsedGeometry . uvs4 , parsedGeometry . uvs4 . _updatable ) ;
1433
+ mesh . setVerticesData ( VertexBuffer . UV4Kind , parsedGeometry . uvs4 , parsedGeometry . uvs4 . _updatable || parsedGeometry . uvs4Updatable ) ;
1434
1434
}
1435
1435
1436
1436
if ( parsedGeometry . uvs5 ) {
1437
- mesh . setVerticesData ( VertexBuffer . UV5Kind , parsedGeometry . uvs5 , parsedGeometry . uvs5 . _updatable ) ;
1437
+ mesh . setVerticesData ( VertexBuffer . UV5Kind , parsedGeometry . uvs5 , parsedGeometry . uvs5 . _updatable || parsedGeometry . uvs5Updatable ) ;
1438
1438
}
1439
1439
1440
1440
if ( parsedGeometry . uvs6 ) {
1441
- mesh . setVerticesData ( VertexBuffer . UV6Kind , parsedGeometry . uvs6 , parsedGeometry . uvs6 . _updatable ) ;
1441
+ mesh . setVerticesData ( VertexBuffer . UV6Kind , parsedGeometry . uvs6 , parsedGeometry . uvs6 . _updatable || parsedGeometry . uvs6Updatable ) ;
1442
1442
}
1443
1443
1444
1444
if ( parsedGeometry . colors ) {
1445
1445
mesh . setVerticesData ( VertexBuffer . ColorKind , Color4 . CheckColors4 ( parsedGeometry . colors , parsedGeometry . positions . length / 3 ) , parsedGeometry . colors . _updatable ) ;
1446
1446
}
1447
1447
1448
1448
if ( parsedGeometry . matricesIndices ) {
1449
- if ( ! parsedGeometry . matricesIndices . _isExpanded ) {
1449
+ if ( ! parsedGeometry . matricesIndices . _isExpanded && ! parsedGeometry . matricesIndicesExpanded ) {
1450
1450
const floatIndices = [ ] ;
1451
1451
1452
1452
for ( let i = 0 ; i < parsedGeometry . matricesIndices . length ; i ++ ) {
@@ -1458,15 +1458,20 @@ export class Geometry implements IGetSetVerticesData {
1458
1458
floatIndices . push ( ( matricesIndex >> 24 ) & 0xff ) ; // & 0xFF to convert to v + 256 if v < 0
1459
1459
}
1460
1460
1461
- mesh . setVerticesData ( VertexBuffer . MatricesIndicesKind , floatIndices , parsedGeometry . matricesIndices . _updatable ) ;
1461
+ mesh . setVerticesData ( VertexBuffer . MatricesIndicesKind , floatIndices , parsedGeometry . matricesIndices . _updatable || parsedGeometry . matricesIndicesUpdatable ) ;
1462
1462
} else {
1463
1463
delete parsedGeometry . matricesIndices . _isExpanded ;
1464
- mesh . setVerticesData ( VertexBuffer . MatricesIndicesKind , parsedGeometry . matricesIndices , parsedGeometry . matricesIndices . _updatable ) ;
1464
+ delete parsedGeometry . matricesIndicesExpanded ;
1465
+ mesh . setVerticesData (
1466
+ VertexBuffer . MatricesIndicesKind ,
1467
+ parsedGeometry . matricesIndices ,
1468
+ parsedGeometry . matricesIndices . _updatable || parsedGeometry . matricesIndicesUpdatable
1469
+ ) ;
1465
1470
}
1466
1471
}
1467
1472
1468
1473
if ( parsedGeometry . matricesIndicesExtra ) {
1469
- if ( ! parsedGeometry . matricesIndicesExtra . _isExpanded ) {
1474
+ if ( ! ( parsedGeometry . matricesIndicesExtraExpanded || parsedGeometry . matricesIndicesExtra . _isExpanded ) ) {
1470
1475
const floatIndices = [ ] ;
1471
1476
1472
1477
for ( let i = 0 ; i < parsedGeometry . matricesIndicesExtra . length ; i ++ ) {
@@ -1478,10 +1483,19 @@ export class Geometry implements IGetSetVerticesData {
1478
1483
floatIndices . push ( ( matricesIndex >> 24 ) & 0xff ) ; // & 0xFF to convert to v + 256 if v < 0
1479
1484
}
1480
1485
1481
- mesh . setVerticesData ( VertexBuffer . MatricesIndicesExtraKind , floatIndices , parsedGeometry . matricesIndicesExtra . _updatable ) ;
1486
+ mesh . setVerticesData (
1487
+ VertexBuffer . MatricesIndicesExtraKind ,
1488
+ floatIndices ,
1489
+ parsedGeometry . matricesIndicesExtra . _updatable || parsedGeometry . matricesIndicesExtraUpdatable
1490
+ ) ;
1482
1491
} else {
1483
1492
delete parsedGeometry . matricesIndices . _isExpanded ;
1484
- mesh . setVerticesData ( VertexBuffer . MatricesIndicesExtraKind , parsedGeometry . matricesIndicesExtra , parsedGeometry . matricesIndicesExtra . _updatable ) ;
1493
+ delete parsedGeometry . matricesIndicesExtraExpanded ;
1494
+ mesh . setVerticesData (
1495
+ VertexBuffer . MatricesIndicesExtraKind ,
1496
+ parsedGeometry . matricesIndicesExtra ,
1497
+ parsedGeometry . matricesIndicesExtra . _updatable || parsedGeometry . matricesIndicesExtraUpdatable
1498
+ ) ;
1485
1499
}
1486
1500
}
1487
1501
0 commit comments