hunts Posted April 2, 2017 Share Posted April 2, 2017 hy room, i've been trying to control the bounce of the ball in this pg after it falls of from the plane, it goes back to its original position but gravity is pulling it up here'sthe pg: http://www.babylonjs-playground.com/#BEFOO#145 click on the plane to make the ball fall Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 2, 2017 Share Posted April 2, 2017 Hi again, hunts. http://www.babylonjs-playground.com/#BEFOO#146 I removed 'chk' and I am resetting sphere height differently. No biggie. Lines 46-54... do the magic. We needed to remove sphere translation energy (position change) and sphere rotation energy (spin), because when it falls from pad... it is moving forward and rolling. When we move it to starting position, sphere still has all that energy, and it hits the pad at the same downward speed that it was traveling-at... when it hit .position.y < -50. (very fast). We needed to do a strange thing with ground.rotationQuaternion... to reset ground to flat. (I added the pad rotation reset, but you might not want that). Generally speaking, when a mesh becomes physics-activated, it uses mesh.rotationQuaternion for rotation... instead-of the vector3/Euler mesh.rotation property. Physics engines love Quaternions. Hope this helps. Seemed to work okay for me. Party on! hunts and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
hunts Posted April 3, 2017 Author Share Posted April 3, 2017 @Wingnut thanks for taking your time to explain this to me..means a lot cheers!! Wingnut 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.