Search the Community
Showing results for tags 'movement; collision;'.
-
Hello everyone! I've recently started playing with BabylonJS and I have to say it's really a wonderful library to work with. The learning curve is really smooth but I'm having issues with the physics engine (mostly due to my ignorance, although I've googled a bit trying to find a solution). So the problem I am having is following : In the following playground http://www.babylonjs-playground.com/#2DQWXU#0 we can see a ball in the top left corner and a cube in the bottom right corner. The user can interact with the ball and by selecting it you can move it around the grid (without physics enabled ). The movement is a simple increasing/decreasing of the values for ball position until a certain clicked position is reached (the vector expressed by variables xreach, yreach, zreach). Now a strange thing happens when physics is enabled (just set the variable enablePhysics to true). The user cannot move the ball, it wont respond to the action and the ball and the cube start dancing and jittering a bit. I am curios what is happening? Should the movement of the ball happen by calling some physics function when physics engine is enabled? If so can you tell me which one? Can someone also review my render code (should i be calling render function for the cube also)? Is there something that I can improve overall? Thank you for reading my question(s).