atallah salah Posted November 13, 2018 Share Posted November 13, 2018 Hello every one, I'm working on a project and I'm using physics and collision and everything was fine until I start using parent child for object and meshes i create an example here show some issue : https://www.babylonjs-playground.com/#JUKXQD#70 you can see in the example : box position still increasing in y Axis and the same happen for the highest skull Thank you for help Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 13, 2018 Share Posted November 13, 2018 Are you looking for it to look like this? https://www.babylonjs-playground.com/#JUKXQD#71 If you use addChild instead of parent =, world position should not change atallah salah 1 Quote Link to comment Share on other sites More sharing options...
atallah salah Posted November 13, 2018 Author Share Posted November 13, 2018 @trevordev Thank you for this answer it's was really helpful it's solve other topic for me in the example you have send it's still the same problem if you can focus on the third skull and box they still incensing position on y Axis , it's take i while to check it if you check it after 1 minute when the parents functions done sure you will see the difference Thank you Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 13, 2018 Share Posted November 13, 2018 Sorry, I misunderstood. Parenting with physics has documented issues when the parent also has an impostor see https://doc.babylonjs.com/how_to/using_advanced_physics_features#ignoreparent. This seems to a limitation with the current physics engines. atallah salah 1 Quote Link to comment Share on other sites More sharing options...
atallah salah Posted November 13, 2018 Author Share Posted November 13, 2018 @trevordev Thank you for answer I tried to use ignoreparent in impostor but still the same problem . Do you think there is a solution for this problem ? Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 13, 2018 Share Posted November 13, 2018 Could you share more about your use case? Why do you require parenting? Is this what you are trying to do? https://playground.babylonjs.com/#PRHF00#6 atallah salah 1 Quote Link to comment Share on other sites More sharing options...
atallah salah Posted November 13, 2018 Author Share Posted November 13, 2018 @trevordev My cases is about drawing object and this object have to detect all other objects collision in the scene I have to use imported meshes cuz it's not possible to draw it in BabylonJS Parenting used for some controls like animation and change parent position or rotation and children have to do the same In my case I must use parenting , I try to use method like RegisterBeforeRender to set position but it's was very heavy cuz the number of objects and movements at the same time The all idea depending on parenting and collision I was thinking about if I could stop use parenting at the point I use collision and use it again when done with collision if that possible what do you think ? I try to use Oimo.js in Babylon but still same Thank you for your answer trevordev 1 Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 14, 2018 Share Posted November 14, 2018 @atallah salah Yea, for your use case, if parenting is only used to setup the scene only disabling parenting when needing to run physics sounds like a good solution. atallah salah 1 Quote Link to comment Share on other sites More sharing options...
atallah salah Posted November 14, 2018 Author Share Posted November 14, 2018 @trevordev I try this way, it's work fine with some issue and that was great, but still can't use both on the same time do you think BabylonJS going to update or fix this ? trevordev 1 Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 14, 2018 Share Posted November 14, 2018 Yea, I'm currently investigating a couple physics issues, trying to make some more examples and trying to add ammoJS physics engine support to Babylon. I also came across another playground which has parenting which works for a car which you could take a look at https://www.babylonjs-playground.com/#UGMIH#15 atallah salah 1 Quote Link to comment Share on other sites More sharing options...
atallah salah Posted November 14, 2018 Author Share Posted November 14, 2018 @trevordev This is a great example not use parenting at all In my case user will able to add object to another object to be transforming together like what parenting do at the same time have chain(sphere connected together using Joint ) and this chain have to use physics all the time scene running I have at least 40 object user have to put it on each other and maximum 100 object when using physics collision and parting with BabylonJS object (Box,Sphere,..) everything work fine but not for the imported mesh do I can link object with each other like parenting with with using physics link I will try the example Thank you trevordev 1 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.