Jump to content

Get the pickingInfo with a Double Click event


GERDE
 Share

Recommended Posts

Hello,

I would like with my 'dbclick' event function recover pickingInfo like the function onPointerDown.

How can do I ?

I would like recover the mesh informations.

http://www.babylonjs-playground.com/#7JOOL

I saw that there was another way to place an event on a mesh. More suitable for my case I think.

My problem with this method is that I can not access variables in my class...

this._machine.actionManager = new BABYLON.ActionManager(scene);

this._machine.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function () {                
                alert("machine cliqued");    

                alert("this._privateAttribut"); //undifined                        
            }));

 

:P

Link to comment
Share on other sites

Hi guys!

http://www.babylonjs-playground.com/#7JOOL#16

(But use Deltakosh's double-click checker, cuz his is MUCH cleaner)

I added some direction and emit power settings... onto your particleSystem. I also changed to a manualEmitCount particleSystem.  A manual-emit-count PS can be started anytime - with a manual emit count = 0.  Then, when you need to use it later, you just set an emitter mesh-or-vector, and then set a manual emit count (line 87-88).

I recently learned about manual emit counts on particle systems.  They seem quite handy.  "Emit here for 5000.  Now go do 1500 there!  Swap-out the PS update function. Now go over there and spray 2000, now back over here... 1000."  Fun!   Garden hose with handy pistol spray nozzle.  heh

Picked mesh are being outputted to console (and exploding).  I tried a little auto-fade-to-invisible, but failed on that part.  :)  I created this PG and post... this morning... but the forum went broken for a while.  It wouldn't let me TALK TALK TALK, and I got scared.  :o

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...