Bläddra i källkod

Computer world matrix for newly attached mesh (#8560)

Raanan Weber 5 år sedan
förälder
incheckning
9e6b4cf6a3
2 ändrade filer med 4 tillägg och 0 borttagningar
  1. 1 0
      dist/preview release/what's new.md
  2. 3 0
      src/Debug/rayHelper.ts

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

@@ -34,6 +34,7 @@
 - Added an alternate option to the mesh edge renderer to generate edges faster / more accurately for unusual geometries (like the ones generated by CSG) ([Popov72](https://github.com/Popov72))
 - Added an option when creating the engine to switch matrix computation to 64 bits ([Popov72](https://github.com/Popov72))
 - Added support for the alpha component to the SSR post-process ([Popov72](https://github.com/Popov72))
+- Force compute world matrix of the newly-attached mesh of a ray helper ([RaananW](https://github.com/RaananW))
 
 ### Engine
 

+ 3 - 0
src/Debug/rayHelper.ts

@@ -173,6 +173,9 @@ export class RayHelper {
             this._attachedToMesh.getScene().registerBeforeRender(this._updateToMeshFunction);
         }
 
+        // force world matrix computation before the first ray helper computation
+        this._attachedToMesh.computeWorldMatrix(true);
+
         this._updateToMesh();
     }