olsibob Posted August 27, 2018 Share Posted August 27, 2018 I'm able to pick sprites with Scene.pickSprite, but is there a way to pick them with scene.pickWithRay? PickWithRay only seems to return meshes (I've set isPickable to true on the sprites and confirmed that they're pickable with Scene.pickSprite). The use-case is, I'm trying to pick sprites with a 3DoF VR Controller, so I don't have a 2d pointerX and pointerY to work with, only the controller's forward ray. I'm thinking that my options are: a. Use Vector3.Project to try to unproject the pickedPoint of pickWithRay (I'm using a skybox, so the ray will always hit something), then put that point into Scene.pickSprite. I tried this quickly, but I think the unprojected point might be off b. replace the sprites with billboarded mesh instances that can directly be hit with pickWithRay. I suspect this might be the easiest option? Or is there some easier way to pick a sprite with a ray? Quote Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 Hello! This is a missing API for sure! I'll add it for next commit (By the way , option B is totally fine as well) Quote Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 https://github.com/BabylonJS/Babylon.js/commit/685b8f0f4babca6fa1fef13f24991f5cafa107d8 Quote Link to comment Share on other sites More sharing options...
olsibob Posted August 27, 2018 Author Share Posted August 27, 2018 Wow that was fast! Do you know if it's possible to try this out using npm? I thought I'd be able to do repo#commit: "dependencies": { "babylonjs": "git+https://github.com/BabylonJS/Babylon.js.git#685b8f0f4babca6fa1fef13f24991f5cafa107d8" But the new method doesn't seem to be included Quote Link to comment Share on other sites More sharing options...
Guest Posted August 27, 2018 Share Posted August 27, 2018 I will update the npm this Friday (I cannot update it every time else I will consume all NPM bandwidth ;)) Quote Link to comment Share on other sites More sharing options...
olsibob Posted August 27, 2018 Author Share Posted August 27, 2018 Awesome, thanks! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 28, 2018 Share Posted August 28, 2018 If you are really keen, you can build it yourself from source to get latest. Just clone or download, run npm install, and a gulp task https://doc.babylonjs.com/how_to/how_to_start#gulp You can use npm link or copy to your node_modules once built. Only if you can't wait till Friday! I would imagine it's in the playground already, though... 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.