Ver código fonte

skeleton override mnatrix used in mesh ray intersection (#8555)

Cedric Guillemet 5 anos atrás
pai
commit
be67dab177
2 arquivos alterados com 2 adições e 1 exclusões
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Meshes/abstractMesh.ts

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

@@ -201,6 +201,7 @@
 - Fix infinite loop in `GlowLayer.unReferenceMeshFromUsingItsOwnMaterial` ([Popov72](https://github.com/Popov72))
 - Fix picking issue in the Solid Particle System when MultiMaterial is enabled ([jerome](https://github.com/jbousquie))
 - Fix picking issue in the Solid Particle System when expandable ([jerome](https://github.com/jbousquie))
+- Fix use of skeleton override matrix in mesh ray intersection ([cedricguillemet](https://github.com/cedricguillemet))
 - `QuadraticErrorSimplification` was not exported ([RaananW](https://github.com/Raananw))
 - Fix NME Frames bug where collapsing and moving a frame removed the nodes inside ([belfortk](https://github.com/belfortk))
 - Fix moving / disappearing controls when freezing/unfreezing the ScrollViewer ([Popov72](https://github.com/Popov72))

+ 1 - 1
src/Meshes/abstractMesh.ts

@@ -1538,7 +1538,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
         if (intersectInfo) {
             // Get picked point
-            const world = this.getWorldMatrix();
+            const world = this.skeleton && this.skeleton.overrideMesh ? this.skeleton.overrideMesh.getWorldMatrix() : this.getWorldMatrix();
             const worldOrigin = TmpVectors.Vector3[0];
             const direction = TmpVectors.Vector3[1];
             Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);