فهرست منبع

Merge pull request #9003 from Popov72/fix-wrong-winding-vertexdata

VertexData: Fix wrong winding when applying a transform matrix
David Catuhe 4 سال پیش
والد
کامیت
db57ae0629
2فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Meshes/mesh.vertexData.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -321,6 +321,7 @@
 - Fix issue in glTF2 `_Exporter.createSkinsAsync()` that exported an incorrect joint indexing list ([drigax](https://github.com/drigax))
 - Fix gltf2 Morph Target export code style, add additional test case for non-animation group created morph targets ([drigax](https://github.com/drigax))
 - Fix "Uncaught ReferenceError: name is not defined" ([outermeasure](https://github.com/outermeasure))
+- Fix wrong winding when applying a transform matrix on VertexData ([Popov72](https://github.com/Popov72))
 
 ## Breaking changes
 - `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))

+ 1 - 1
src/Meshes/mesh.vertexData.ts

@@ -407,7 +407,7 @@ export class VertexData {
      * @returns the VertexData
      */
     public transform(matrix: Matrix): VertexData {
-        var flip = matrix.m[0] * matrix.m[5] * matrix.m[10] < 0;
+        var flip = matrix.determinant() < 0;
         var transformed = Vector3.Zero();
         var index: number;
         if (this.positions) {