Dinkelborg Posted November 13, 2014 Share Posted November 13, 2014 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? Quote Link to comment Share on other sites More sharing options...
Dinkelborg Posted November 15, 2014 Author Share Posted November 15, 2014 So ... can I assume this is impossible now? Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 15, 2014 Share Posted November 15, 2014 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2014 Share Posted November 20, 2014 Hello! for performance reasons we check intersections between specific objects and not between all objects in the scene (which would be too expensive) 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.