GERDE Posted April 7, 2016 Share Posted April 7, 2016 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 })); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2016 Share Posted April 7, 2016 Here is a solution: http://www.babylonjs-playground.com/#7JOOL#18 box1.isPickable = true; scene.constantlyUpdateMeshUnderPointer = true; window.addEventListener("dblclick", function (e) { if (scene.meshUnderPointer === box1) { explosion(scene, box1); } }); Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 8, 2016 Share Posted April 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 8, 2016 Share Posted April 8, 2016 http://www.babylonjs-playground.com/#7JOOL#13 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.