Jump to content

Problems with Oimo


Do_it
 Share

Recommended Posts

Hi folks!

 

Nice community here. Friendly, communicative and helpful devs and members. Not usual in most forums.

 

I am a newbie in coding, please have some patience with me.

 

 

Few questions:

 

1) Oimo doesn't work in your playground?    http://www.babylonjs.com/playground/#1SS3VP

Same file on my server: http://www.cognitive-leaks.at/do-it/kugel.html

Lack of dependencies?

 

 

2) In my example the sphere vanishes for a moment while bouncing and i can see only the half of the sphere after the animation.

Can anybody give me a hint, what i did wrong?

 

3) Is it possible to rotate my ground, while physics is enabled?

There's no reaction of the sphere.

 

Example: http://www.cognitive-leaks.at/webgl/kugel.html (rotate with W,A,S,D)

Link to comment
Share on other sites

Hey,

 

Welcome :)

 

1) Oimo works correctly in the playground, but your objects are so huge you cannot see it :) Try this : http://www.babylonjs.com/playground/#1SS3VP#1

I just reduced the size of the ground.

 

2) It's due to the size of your ground. 

 

3) In your beforeRenderFunction try to call extraGround.updatePhysicsBodyPosition().

 

Cheers, 

Link to comment
Share on other sites

Sry, to bother you again, but if i use 

extraGround.updatePhysicsBodyPosition();

inside the beforeRenderFunction, it throws a "Uncaught TypeError: undefined is not a function" related to line 16441 of babylon.1.14-beta-debug.js 

body.setOrientation(mesh.rotation.x, mesh.rotation.y, mesh.rotation.z);

Maybe a failure of scope?

Or again anything i don't understand?

Link to comment
Share on other sites

Hi Temechon ,

 

I experimented the same issue. Oimo can use quaternion to set rotation. My method is a bit tricky, because I didn't want to modify Oimo in 

OIMO.Body = function(Obj){...}

But there is  a setQuaternion()  method in Oimo.

 

So just after register your physic object in Babylon with yourMesh.setPhysicsState(..) you have to do  somethink like that :  

var registerMeshes :any [] = this.scene.getPhysicsEngine().getRegisterMesches();              for (var i = 0; i < registerMeshes.length; ++i) {                       registerMeshes[i].body.setQuaternion(yourQuaternion);                   }

For info  I had to implement  getRegisterMesches()  in interface IPhysicsEnginePlugin and in the both physics plugin to get the private member registeredMeshes.

 

off topic : Thank you guys (@deltakosh @davrous) for the typeScript port.

 

Sam

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