Quellcode durchsuchen

returns line index when the pickedMesh is a LinesMesh

Julien Barrois vor 6 Jahren
Ursprung
Commit
618e9580e3
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      src/Collisions/babylon.pickingInfo.ts
  2. 1 1
      src/Mesh/babylon.subMesh.ts

+ 1 - 1
src/Collisions/babylon.pickingInfo.ts

@@ -38,7 +38,7 @@ module BABYLON {
         public bu = 0;
         /** (See getTextureCoordinates) The barycentric V coordinate that is used when calulating the texture coordinates of the collision.*/
         public bv = 0;
-        /** The id of the face on the mesh that was picked  */
+        /** The index of the face on the mesh that was picked, or the index of the Line it the picked Mesh is a LinesMesh */
         public faceId = -1;
         /** Id of the the submesh that was picked */
         public subMeshId = 0;

+ 1 - 1
src/Mesh/babylon.subMesh.ts

@@ -368,7 +368,7 @@ module BABYLON {
 
                 if (fastCheck || !intersectInfo || length < intersectInfo.distance) {
                     intersectInfo = new IntersectionInfo(null, null, length);
-
+                    intersectInfo.faceId = index / 2;
                     if (fastCheck) {
                         break;
                     }