Do_it Posted October 9, 2014 Share Posted October 9, 2014 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/#1SS3VPSame file on my server: http://www.cognitive-leaks.at/do-it/kugel.htmlLack 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) Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 9, 2014 Share Posted October 9, 2014 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#1I 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, Quote Link to comment Share on other sites More sharing options...
Do_it Posted October 9, 2014 Author Share Posted October 9, 2014 1) I'm not only old and crazy, now i am sure to be blind, too.2) Easy solution for hours spent investigating forums and tutorials ... 3) I'll try... Thank you very much, Temechon! Quote Link to comment Share on other sites More sharing options...
Do_it Posted October 9, 2014 Author Share Posted October 9, 2014 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? Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 9, 2014 Share Posted October 9, 2014 Indeed, I think there is a bug... You are using rotationQuaternion to rotate your mesh, and the Oimo plugin is using mesh.rotation.In your case, mesh.rotation does not exist, so it fails. I will take a look at it. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted October 10, 2014 Share Posted October 10, 2014 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 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 10, 2014 Share Posted October 10, 2014 @ Samuel : I think that there's a typo here: .getRegisterMesches(); 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.