|
@@ -614,47 +614,80 @@
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.PositionKind)) {
|
|
|
serializationObject.positions = this.getVerticesData(VertexBuffer.PositionKind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable) {
|
|
|
+ serializationObject.positions._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.NormalKind)) {
|
|
|
serializationObject.normals = this.getVerticesData(VertexBuffer.NormalKind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable) {
|
|
|
+ serializationObject.normals._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UVKind)) {
|
|
|
serializationObject.uvs = this.getVerticesData(VertexBuffer.UVKind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UVKind).isUpdatable) {
|
|
|
+ serializationObject.uvs._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UV2Kind)) {
|
|
|
serializationObject.uv2s = this.getVerticesData(VertexBuffer.UV2Kind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UV2Kind).isUpdatable) {
|
|
|
+ serializationObject.uv2s._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UV3Kind)) {
|
|
|
serializationObject.uv3s = this.getVerticesData(VertexBuffer.UV3Kind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UV3Kind).isUpdatable) {
|
|
|
+ serializationObject.uv3s._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UV4Kind)) {
|
|
|
serializationObject.uv4s = this.getVerticesData(VertexBuffer.UV4Kind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UV4Kind).isUpdatable) {
|
|
|
+ serializationObject.uv4s._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UV5Kind)) {
|
|
|
serializationObject.uv5s = this.getVerticesData(VertexBuffer.UV5Kind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UV5Kind).isUpdatable) {
|
|
|
+ serializationObject.uv5s._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.UV6Kind)) {
|
|
|
serializationObject.uv6s = this.getVerticesData(VertexBuffer.UV6Kind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.UV6Kind).isUpdatable) {
|
|
|
+ serializationObject.uv6s._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.ColorKind)) {
|
|
|
serializationObject.colors = this.getVerticesData(VertexBuffer.ColorKind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.ColorKind).isUpdatable) {
|
|
|
+ serializationObject.colors._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind)) {
|
|
|
serializationObject.matricesIndices = this.getVerticesData(VertexBuffer.MatricesIndicesKind);
|
|
|
serializationObject.matricesIndices._isExpanded = true;
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.MatricesIndicesKind).isUpdatable) {
|
|
|
+ serializationObject.matricesIndices._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)) {
|
|
|
serializationObject.matricesWeights = this.getVerticesData(VertexBuffer.MatricesWeightsKind);
|
|
|
+ if (this.getVertexBuffer(VertexBuffer.MatricesWeightsKind).isUpdatable) {
|
|
|
+ serializationObject.matricesWeights._updatable = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
serializationObject.indices = this.getIndices();
|
|
@@ -772,35 +805,36 @@
|
|
|
}
|
|
|
}
|
|
|
} else if (parsedGeometry.positions && parsedGeometry.normals && parsedGeometry.indices) {
|
|
|
- mesh.setVerticesData(VertexBuffer.PositionKind, parsedGeometry.positions, false);
|
|
|
- mesh.setVerticesData(VertexBuffer.NormalKind, parsedGeometry.normals, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.PositionKind, parsedGeometry.positions, parsedGeometry.positions._updatable);
|
|
|
+
|
|
|
+ mesh.setVerticesData(VertexBuffer.NormalKind, parsedGeometry.normals, parsedGeometry.normals._updatable);
|
|
|
|
|
|
if (parsedGeometry.uvs) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UVKind, parsedGeometry.uvs, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UVKind, parsedGeometry.uvs, parsedGeometry.uvs._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.uvs2) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UV2Kind, parsedGeometry.uvs2, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UV2Kind, parsedGeometry.uvs2, parsedGeometry.uvs2._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.uvs3) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UV3Kind, parsedGeometry.uvs3, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UV3Kind, parsedGeometry.uvs3, parsedGeometry.uvs3._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.uvs4) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UV4Kind, parsedGeometry.uvs4, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UV4Kind, parsedGeometry.uvs4, parsedGeometry.uvs4._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.uvs5) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UV5Kind, parsedGeometry.uvs5, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UV5Kind, parsedGeometry.uvs5, parsedGeometry.uvs5._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.uvs6) {
|
|
|
- mesh.setVerticesData(VertexBuffer.UV6Kind, parsedGeometry.uvs6, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.UV6Kind, parsedGeometry.uvs6, parsedGeometry.uvs6._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.colors) {
|
|
|
- mesh.setVerticesData(VertexBuffer.ColorKind, Color4.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.ColorKind, Color4.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), parsedGeometry.colors._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.matricesIndices) {
|
|
@@ -816,10 +850,10 @@
|
|
|
floatIndices.push(matricesIndex >> 24);
|
|
|
}
|
|
|
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, floatIndices, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, floatIndices, parsedGeometry.matricesIndices._updatable);
|
|
|
} else {
|
|
|
delete parsedGeometry.matricesIndices._isExpanded;
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, parsedGeometry.matricesIndices, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesIndicesKind, parsedGeometry.matricesIndices, parsedGeometry.matricesIndices._updatable);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -836,19 +870,19 @@
|
|
|
floatIndices.push(matricesIndex >> 24);
|
|
|
}
|
|
|
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesIndicesExtraKind, floatIndices, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesIndicesExtraKind, floatIndices, parsedGeometry.matricesIndicesExtra._updatable);
|
|
|
} else {
|
|
|
delete parsedGeometry.matricesIndices._isExpanded;
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, parsedGeometry.matricesIndicesExtra._updatable);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.matricesWeights) {
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesWeightsKind, parsedGeometry.matricesWeights, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesWeightsKind, parsedGeometry.matricesWeights, parsedGeometry.matricesWeights._updatable);
|
|
|
}
|
|
|
|
|
|
if (parsedGeometry.matricesWeightsExtra) {
|
|
|
- mesh.setVerticesData(VertexBuffer.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, false);
|
|
|
+ mesh.setVerticesData(VertexBuffer.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, parsedGeometry.matricesWeights._updatable);
|
|
|
}
|
|
|
|
|
|
mesh.setIndices(parsedGeometry.indices);
|