iamchairs Posted September 6, 2016 Share Posted September 6, 2016 I am using Pixi.js and a Matter.js for my physics engine. Just doing some tests combining both. I am trying to make a soft bodied shark and started by making the body. To do this I have a set of rectangles joined by some constraints. This gets close to the affect i'm looking for, but the physics are jumpy and never finally rest. Hopefully this is general enough and not specific to the physics engine I'm using. I had similar problems with Phaser2 ninja physics before. Here is a gif of what it looks like- The greenish rectangles are the actual physics objects. You can see the the rects in the back just can't rest and vibrate the rest of the objects. I've tinkered with the friction as well as restitution. If you saw this- what would you try to get this objects to rest? yahiko 1 Quote Link to comment Share on other sites More sharing options...
BobF Posted September 6, 2016 Share Posted September 6, 2016 Yeah, it looks like a lack of internal friction is preventing the energy in the rectangles from dissipating. A rectangle should lose energy to friction every time it moves in a way that compresses or stretches the soft body material. Quote Link to comment Share on other sites More sharing options...
alex_h Posted September 7, 2016 Share Posted September 7, 2016 I've had similar issues with p2.js before, the only solution was to use the 'sleep' feature of p2 whereby bodies enter a sleep state if they fall below certain movement thresholds. Don't know if matter.js has a similar feature, but if so that could be the answer. 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.