Jump to content

Bug: OnIntersectionEnter action is triggered only once


alexoy
 Share

Recommended Posts

Hello!

Probably I've found a bug with ActionManager and it's intersection triggers.

In my case there is a bigger container, smaller mesh inside it and a sphere which moves through them. PG demo: https://playground.babylonjs.com/#6CY2EU#1

If you check the console - you will notice that inner mesh's OnIntersectionEnter is triggered only once, while bigger container's OnIntersectionExit triggers every time.

 

Expected result: both Enter and Exit triggers are fired every time.

 

NOTE: if you make both triggers the same (OnIntersectionExitTrigger or OnIntersectionEnterTrigger) - everything is fine, so something is wrong with opposite/different triggers.

Link to comment
Share on other sites

Weird weird weird.  :)  Interesting find, A!

https://playground.babylonjs.com/#6CY2EU#4

There, consistent box2 onEnter trigs, looks good.

Now activate lines 51-57 (highlight then control /)... activate an onExit for box 1.

Run.  After that, the box2 onEnter.... works only once.  hmm.

hmmmmmmm.  :/   So, registering onExit for box1... kills onEnter for box2.  Weird.

CORE DIVE!  Weee... https://github.com/BabylonJS/Babylon.js/blob/master/src/Actions/babylon.actionManager.ts

I've already verified that sphere.actionManager.actions array contains two actionObjects, consistently.  [pg#5

I thought maybe the addition-of the box1 exitAct (type 13)... somehow pushed box2 enterAct (type 12)... out-of the array.  :) 

But no, it seems fine.  :)  More diving!

Link to comment
Share on other sites

Hi alexoy/others.  No news... but... I inserted BJS ActionManager code... into playground... for easier testing.

https://playground.babylonjs.com/indexstable#6CY2EU#7

See line 677 (true/false make-it-fail switch)  :)

Symptom:  Register an onExit for outer box1, and onEnter for inner box2... works only one time.

(Wingnut, chewing on a stick match, spins the barrel on his chrome bug-shootin' revolver and sternly peeks-out from under his hat brim.  The bugs don't know that it's just a cap gun.)  :D

Currently accepting applications for posse members!

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