Jump to content

OnPickTrigger with ExecuteCodeAction


JLHolmes
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...