JLHolmes Posted January 16, 2018 Share Posted January 16, 2018 Hey guys... while refactoring some code, I ran off down the path of changing my old picking method (Raycasting, etc) to use actions... specifically OnPickTrigger with ExecuteCodeAction. But... I was a bit confused when I could not find the picked point on the mesh in the event data. Am I missing something? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 16, 2018 Share Posted January 16, 2018 Hiya JLH! Good to see you again. I think this is normal. ActionEvents don't have a 'picked point'. I don't know WHY they don't, but they don't. hmm. You could put a pick right in the middle of the executeCodeAction handler... but did you gain anything? It still uses a Ray, I think. https://www.babylonjs-playground.com/#XG8RH3#11 Line 17... I put a scene.pick inside my onClickyPoo() executeCodeAction handler. It works... but... hmm. It didn't remove any raycasting AT ALL. SO, I was of no help whatsoever, eh? Yay Wingnut! heh. Sorry. Possibly, a pickingRay is NEEDED... in order to get a picked point. Maybe there is no other way. Stay tuned, others may comment soon. Quote Link to comment Share on other sites More sharing options...
JLHolmes Posted January 17, 2018 Author Share Posted January 17, 2018 Thanks, Wing... I went ahead and a fell back (ahead? back?) to my old method. I'm assuming the lack of the picked point is an optimization thing. The other advantage to scene.pick() is that you can tell when the user doesn't click on something. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.