Dad72 Posted February 24, 2016 Share Posted February 24, 2016 Hello, I feel that there is a problem with the restitution and friction. when its values are 0, an object should not bounce or slide, but that produce excessive ways. For example if I add a house to the ground, then a character over the fact character fly in areas housing and the character with it go very high in the universe, then falls and found under the ground Upside down. Another thing, collisions with the physic does not allow a character to go into a home. I create a video capture to show the problem: (I have the .mp4 format if you can not read the .ogv. But with google chrome, ogv is live) http://www.babylon.actifgames.com/bug_physic.ogv And the code of the physic: ground: ground.setPhysicsState(BABYLON.PhysicsEngine.HeightmapImpostor, { mass: 0, friction: 0, restitution: 0 }); House: house.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, { mass: 1, friction: 0, restitution: 0 }); Character: character.setPhysicsState(BABYLON.PhysicsEngine.BoxImpostor, { mass: 0.3, friction: 0, restitution: 0 }); Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 24, 2016 Share Posted February 24, 2016 Hi, I'll look into that. What plugin are you using? Oimo? Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 24, 2016 Share Posted February 24, 2016 I can answer my own question. You are using cannon. Problem found, fix is coming soon. Need to be in front of a computer for that :-) Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 24, 2016 Author Share Posted February 24, 2016 Yes, I use cannonJS Thanks Raanan Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 24, 2016 Share Posted February 24, 2016 ok, PR was sent, tested locally. The restitution and friction of the impostor that is being collided against is important. So if, for example, a ball falls to the ground, it's the ground's friction and restitution who decides how the impostor would bounce. not the ball's. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 24, 2016 Author Share Posted February 24, 2016 Ok, so with friction: 0 and restitution: 0 a ball not bounced back, which seems logical. Thank you Raanan Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 25, 2016 Author Share Posted February 25, 2016 Hi Raanan, The houses rebounded still, but there are still some bugs that I find it hard to explain. I remade a video to see the bug after the creation of the character and towards the end of the video. Perhaps it be because I am trying to create the character of the interior houses ?? In this case, how to create an object inside a house? http://www.babylon.actifgames.com/bug_physic.ogv Thank you Raanan. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 27, 2016 Author Share Posted February 27, 2016 @RaananW The house seems more bounce and land no longer disappears. But I still have the problem of friction and restitution. If an object with friction 0 and restitution 0 collides with another object friction 0 and restitution 0 the two will each object on the opposite sliding eject or are very high in the sky and landed under the ground (which also has an impostor with friction 0 and restitution 0). See the above video. I had a playground that will reproduce the bug. You can see abnormal behavior of the two spheres on the ground. http://www.babylonjs-playground.com/#2DJG5T#0 I had a playground that will reproduce the bug. You can see abnormal behavior of the two spheres. What I want to do is just put the mass of the objects. no friction, no trips. if an object is build on another he slips next without rebound. By cons how to create inside of an object? add a kind of furniture inside a house with the physic system? it does not seem possible. maybe it's also a bug Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2016 Share Posted February 27, 2016 Hi, Thanks for the PG! I have tried finding reasons for that, but after running the PG again and again (and changing the size of sphere 1) it actually works as expected - http://www.babylonjs-playground.com/#2DJG5T#1 Changing to Oimo gives the same results. Is there something wrong with the current PG? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 27, 2016 Author Share Posted February 27, 2016 When you create an object inside another this create a problem. Both are subject to eject the stage. How a character can get into a house for example using physics? Did you watch the video to understand what I mean. Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 28, 2016 Share Posted February 28, 2016 You can't create an object inside an object. Once an impostor was set, other objects can't penetrate it. To put an object inside an impostor you will need to use the Mesh impostor with double-sided meshes. In order to allow the person to go inside you will need to either create impostors for each wall of the house (the walls, the ground, the stairs, everything), use the mesh impostor, or use babylon's collision ssystem, which will probably be the right choice in this case. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2016 Author Share Posted February 28, 2016 ok, thank you for the information. I will look with mesh impostor. 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.