Jump to content

Collision check with Oimo?


Dinkelborg
 Share

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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, 

Link to comment
Share on other sites

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?

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