Dinkelborg Posted November 10, 2014 Share Posted November 10, 2014 Hi,I m trying to figure out how to establish a collision check with Oimo, basically what I want to do is:I have a sphere and when it collides with anything, I want to add an impulse to make it bounce up again.(The result should be like this: http://analogmadness.com/Demo/ThreeJS ) Is there any method or event that one could listen to?It would be really nice if there were any tutorials for Oimo, it seems after all more capeable than cannon.js SebRomeo 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 10, 2014 Share Posted November 10, 2014 Hello, You can use actionmanager for objects I guess... With the trigger OnCollisionEnter for example.There is no collision event in Oimo. If you want to keep the velocity of the ball, you can set its restitution to 1 (the ground should have a restitution set to 1 too). Quote Link to comment Share on other sites More sharing options...
Dinkelborg Posted November 10, 2014 Author Share Posted November 10, 2014 Hi,thanks for the reply,where is OnCollisionEnter defined, and are there more Triggers that the documentation does not name? (<--) I generally don't know where I can find information about these things, like restitution for example.Is there any documentation about this? Quote Link to comment Share on other sites More sharing options...
davrous Posted November 10, 2014 Share Posted November 10, 2014 Hi, You should have a look to the sample I've built for our free MVA training: http://www.microsoftvirtualacademy.com/training-courses/introduction-to-webgl-3d-with-html5-and-babylon-js . Jump to chapter 7 / Physics Simulation. Is it what you'd like to achieve? Bye, David Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 10, 2014 Share Posted November 10, 2014 Dinkelborg, You can find some useful information here : - http://pixelcodr.com/tutos/plane/plane.html A tutorial about how to use action manager (and OnCollisionEnter but without any physics)- https://github.com/BabylonJS/Babylon.js/wiki/How-to-use-Actions The babylon wiki, almost everything is well described here (thanks to DK and Wingnut amongts others) For Oimo, nothing really exists (Babylon-side and oimo-side), you may want to look directly in the source code.However, I can give you some hints By registering a new impostor with Oimo, you can play with 3 parameters : - mass (set to 0 if you want the objet not moving with gravity)- restitution (the amount of bounciness of the object)- friction (speaks for himself : the needed force to move another object on this object). Don't set restitution (or friction) to 0, they won't be taken into account (Oimo issue here) Example : ground.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {mass:0, restitution:0.001});b.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, {mass:10, restitution:0.5});Hope this help. Cheers, Quote Link to comment Share on other sites More sharing options...
Dinkelborg Posted November 10, 2014 Author Share Posted November 10, 2014 Yeah thanks this helps,I did read the wiki and the documentation about the action manager and all, but the wiki also says: Currently, 10 different triggers are supported:and non of the mentioned ones is called OnCollisionEnter, so that's why I am confused, is there also OnCollisionExit and OnCollisionStay as for example in Unity's API? Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 10, 2014 Share Posted November 10, 2014 Erf, my bad... Actually there are called OnIntersection* But it's the same 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.