|
@@ -32762,7 +32762,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Modifies the mesh geometry according to the passed transformation matrix.
|
|
|
* This method returns nothing but it really modifies the mesh even if it's originally not set as updatable.
|
|
|
- * The mesh normals are modified accordingly the same transformation.
|
|
|
+ * The mesh normals are modified using the same transformation.
|
|
|
* tuto : http://doc.babylonjs.com/resources/baking_transformations
|
|
|
* Note that, under the hood, this method sets a new VertexBuffer each call.
|
|
|
* Returns the Mesh.
|
|
@@ -32782,15 +32782,14 @@ var BABYLON;
|
|
|
}
|
|
|
this.setVerticesData(BABYLON.VertexBuffer.PositionKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable());
|
|
|
// Normals
|
|
|
- if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
|
|
|
- return this;
|
|
|
- }
|
|
|
- data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
- temp = [];
|
|
|
- for (index = 0; index < data.length; index += 3) {
|
|
|
- BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).normalize().toArray(temp, index);
|
|
|
+ if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
|
|
|
+ data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
+ temp = [];
|
|
|
+ for (index = 0; index < data.length; index += 3) {
|
|
|
+ BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).normalize().toArray(temp, index);
|
|
|
+ }
|
|
|
+ this.setVerticesData(BABYLON.VertexBuffer.NormalKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable());
|
|
|
}
|
|
|
- this.setVerticesData(BABYLON.VertexBuffer.NormalKind, temp, this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable());
|
|
|
// flip faces?
|
|
|
if (transform.m[0] * transform.m[5] * transform.m[10] < 0) {
|
|
|
this.flipFaces();
|