Hagop Posted February 8, 2017 Share Posted February 8, 2017 Hi all After I parent a mesh with impostor to a camera, and assign position to it relative to Camera, X & Z axis locations work correctly, but not Y-axis location. The mesh jumps up and actually the jumping depends on the value of the Y component the Cannon engine is initialized. Checkout http://playground.babylonjs.com/#1VNAYW#84 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 8, 2017 Share Posted February 8, 2017 Hello I'm afraid that parenting a physics mesh to a camera is not supported. Pinging our physics lead engineeer ( @RaananW) Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 10, 2017 Share Posted February 10, 2017 Hi, so - as DK said, this is not really supported. But do you care to explain what you are trying to achieve? maybe we will find a better solution! Quote Link to comment Share on other sites More sharing options...
fenomas Posted February 11, 2017 Share Posted February 11, 2017 I strongly suspect you'll have better luck parenting the camera to a mesh, rather than the other way around.. http://playground.babylonjs.com/#1VNAYW#86 dbawel 1 Quote Link to comment Share on other sites More sharing options...
dbawel Posted February 12, 2017 Share Posted February 12, 2017 @fenomas is correct in his approach, and the best method I know. DB Quote Link to comment Share on other sites More sharing options...
Hagop Posted February 12, 2017 Author Share Posted February 12, 2017 On 11.02.2017 at 0:52 AM, RaananW said: Hi, so - as DK said, this is not really supported. But do you care to explain what you are trying to achieve? maybe we will find a better solution! @RaananW this is what I am trying to acheive.Click a product and drag down the mouse down to add into shopping cart. http://52.183.26.98/3d/index.html I am trying to move/rotate the products smoothly with shopping cart. That's why I have added parenting after dropping. As a temp solution, I have removed physics after dropping, but in this case products fall INTO one another Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 21, 2017 Share Posted February 21, 2017 I understand. To get that you will have to play with the forces that are applied on the shopping cart. The problem with position update, is that the velocity and acceleration stays 0, so the physics engine thinks - ah, the object didn't move, no reason to check for collisions. When pushing "forward", you will need to calculate forward and apply this force (or better yet - set the cart's velocity) in the right direction. I think more and more people require something like this. The only way to go is really moving to the "physics" world, and leaving the simple position and rotation world. This requires a different way of thinking. I would have said that I will try creating a demo for this, but I won't find the time soon. If you want to start a nice playground that will be the base on which we both can work, I will be more than happy to look inside and comment. 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.