Jump to content

Dynamic Collision Detection


Dinkelborg
 Share

Recommended Posts

Is there any way to just trigger the action for an Intersect Mesh event regardless of which mesh collided with my object?
 

    bouncy_ball.actionManager.registerAction(new BABYLON.ExecuteCodeAction(        { trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: cube_bottom },        function () { onCollision(bouncy_ball, cube_bottom);}));    bouncy_ball.actionManager.registerAction(new BABYLON.ExecuteCodeAction(        { trigger: BABYLON.ActionManager.OnIntersectionExitTrigger, parameter: cube_bottom },        function () { bouncy_ball.hasCollision = false; }));

I want to trigger the function "onCollision" every time my ball has a collision with anything at all. Inside "onCollision" I want to check if the object was below the ball, so I also need to know the object the ball collided with for the function call.
Is there a way to set the trigger-parameter to "any" and can I still find out which it was then?

Link to comment
Share on other sites

well we can look at the raw code and see...

 

well it looks like meshes are checked for intersection here:

 

Scene.prototype._checkIntersections

 

And within that there's the code that checks the mesh and such. So *someone* could go in there and add a new type of trigger that does this. :)

 

Possible, but not existent.

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