Hey s27… I tried some experiments today…
Line 8: Camera .minZ still set quite low.
Lines 67-71: Changed event to be RIGHT-mousebutton down. So, a right-click on canvas… performs the line 62 ray cast.
Lines 33-58: A Wingy-modified “replacement” for RayHelper.show(). Line 40-44 simply creates the RayHelper._renderPoints… in reverse order (it’s a 2-element array - line start/stop points.)
Line 48: Removes the webpack garbage from original line 47. My god…
_Meshes_mesh__WEBPACK_IMPORTED_MODULE_1__["Mesh"] ?? Why not
getWebpack("Mesh") ? Core-folk, do we NEED to have this webpack debris in the BJS max dist file? Alternatives available? Open to discussion? (Maybe Wingy doesn’t understand “the system”). ANYWAY…
…I am failing in this reversal endeavor. Scene mesh is gone… when canvas is right-clicked. Obviously, I’m doing something wrong.
Objective reminder: When line 62 does
let ray = camera.getForwardRay(200); the RayHelper linesMesh can’t be seen. My theory for why: The origin of the linesMesh is SO near-to the camera, that the camera.minZ seems to make it disappear. My objective is to reverse the points array that is sent to the linesMesh for RayHelper._renderFunction()… a function which is currently bound-to RayHelper._render(). This reversal action should place the origin/pivotPoint of the linesMesh line… at the distant-end of the line, well beyond camera.minZ concerns.
TS src: Babylon.js/rayHelper.ts at master · BabylonJS/Babylon.js · GitHub
So, I/we could use some help with our reversed linesMesh points array… or some other method of fixing the rendering of camera-forward rayHelper lines. Keep in mind… that the line STILL could be difficult to see, because it is aimed directly at the camera, and perfectly matches camera.direction. Screen coords of right-click location… is not used.
Fun symptoms: Right-click more times AFTER the mesh disappears… and pan camera around a bit. Various linesMesh junk is seen… but I’m not learning much from seen symptom. Help/ideas welcome from anyone, thx.