|
@@ -293,7 +293,7 @@
|
|
return this._geometry.getTotalIndices();
|
|
return this._geometry.getTotalIndices();
|
|
}
|
|
}
|
|
|
|
|
|
- public getIndices(copyWhenShared?: boolean): number[]{
|
|
|
|
|
|
+ public getIndices(copyWhenShared?: boolean): number[] {
|
|
if (!this._geometry) {
|
|
if (!this._geometry) {
|
|
return [];
|
|
return [];
|
|
}
|
|
}
|
|
@@ -2276,7 +2276,7 @@
|
|
vertexData.indices.push(currentVertexDataIndex);
|
|
vertexData.indices.push(currentVertexDataIndex);
|
|
vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);
|
|
vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);
|
|
vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);
|
|
vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);
|
|
- (<number []>vertexData.uvs).push(0.5 + vertex.position.x / size.x);
|
|
|
|
|
|
+ (<number[]>vertexData.uvs).push(0.5 + vertex.position.x / size.x);
|
|
(<number[]>vertexData.uvs).push(0.5 + vertex.position.y / size.y);
|
|
(<number[]>vertexData.uvs).push(0.5 + vertex.position.y / size.y);
|
|
|
|
|
|
currentVertexDataIndex++;
|
|
currentVertexDataIndex++;
|
|
@@ -2297,12 +2297,12 @@
|
|
/**
|
|
/**
|
|
* @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
|
|
* @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
|
|
*/
|
|
*/
|
|
- public setPositionsForCPUSkinning() : Float32Array {
|
|
|
|
|
|
+ public setPositionsForCPUSkinning(): Float32Array {
|
|
var source: number[] | Float32Array;
|
|
var source: number[] | Float32Array;
|
|
if (!this._sourcePositions) {
|
|
if (!this._sourcePositions) {
|
|
source = this.getVerticesData(VertexBuffer.PositionKind);
|
|
source = this.getVerticesData(VertexBuffer.PositionKind);
|
|
|
|
|
|
- this._sourcePositions = new Float32Array(<any>source);
|
|
|
|
|
|
+ this._sourcePositions = new Float32Array(<any>source);
|
|
|
|
|
|
if (!this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable()) {
|
|
if (!this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable()) {
|
|
this.setVerticesData(VertexBuffer.PositionKind, source, true);
|
|
this.setVerticesData(VertexBuffer.PositionKind, source, true);
|
|
@@ -2314,12 +2314,12 @@
|
|
/**
|
|
/**
|
|
* @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
|
|
* @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
|
|
*/
|
|
*/
|
|
- public setNormalsForCPUSkinning() : Float32Array {
|
|
|
|
|
|
+ public setNormalsForCPUSkinning(): Float32Array {
|
|
var source: number[] | Float32Array;
|
|
var source: number[] | Float32Array;
|
|
if (!this._sourceNormals) {
|
|
if (!this._sourceNormals) {
|
|
source = this.getVerticesData(VertexBuffer.NormalKind);
|
|
source = this.getVerticesData(VertexBuffer.NormalKind);
|
|
|
|
|
|
- this._sourceNormals = new Float32Array(<any>source);
|
|
|
|
|
|
+ this._sourceNormals = new Float32Array(<any>source);
|
|
|
|
|
|
if (!this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable()) {
|
|
if (!this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable()) {
|
|
this.setVerticesData(VertexBuffer.NormalKind, source, true);
|
|
this.setVerticesData(VertexBuffer.NormalKind, source, true);
|
|
@@ -2345,7 +2345,7 @@
|
|
if (!this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)) {
|
|
if (!this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)) {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (!this._sourcePositions) {
|
|
if (!this._sourcePositions) {
|
|
this.setPositionsForCPUSkinning();
|
|
this.setPositionsForCPUSkinning();
|
|
}
|
|
}
|
|
@@ -2356,13 +2356,13 @@
|
|
|
|
|
|
// positionsData checks for not being Float32Array will only pass at most once
|
|
// positionsData checks for not being Float32Array will only pass at most once
|
|
var positionsData = this.getVerticesData(VertexBuffer.PositionKind);
|
|
var positionsData = this.getVerticesData(VertexBuffer.PositionKind);
|
|
- if (!(positionsData instanceof Float32Array)){
|
|
|
|
|
|
+ if (!(positionsData instanceof Float32Array)) {
|
|
positionsData = new Float32Array(positionsData);
|
|
positionsData = new Float32Array(positionsData);
|
|
}
|
|
}
|
|
|
|
|
|
// normalsData checks for not being Float32Array will only pass at most once
|
|
// normalsData checks for not being Float32Array will only pass at most once
|
|
var normalsData = this.getVerticesData(VertexBuffer.NormalKind);
|
|
var normalsData = this.getVerticesData(VertexBuffer.NormalKind);
|
|
- if (!(normalsData instanceof Float32Array)){
|
|
|
|
|
|
+ if (!(normalsData instanceof Float32Array)) {
|
|
normalsData = new Float32Array(normalsData);
|
|
normalsData = new Float32Array(normalsData);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2514,3 +2514,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|