Stephan Posted October 23, 2014 Share Posted October 23, 2014 Hi guys, I just released the beta version of my first panda.js plugin. Download: https://github.com/stephan0v/Panda.js-physics-extention-plugin. Live demo: http://vermeire.home.xs4all.nl/panda/ Panda.js physics extention plugin. This plugin adds several features to the built in basic physics engine of Panda.js. Features:Collision between squares and circles is now far more realisic and follows the laws of physics.Gravity is no longer affected by the mass of the object.The effect of the gravity on individual bodies can be regulated now with the body.gravityFactor propertyYou can add squares that act like a wall with the body.fixed property.The bounciness of individual bodies can be regulated with the restitution propertyLimitations:Polygons/lines/triangles are not supportedBodies won't rotate on collision Phempt 1 Quote Link to comment Share on other sites More sharing options...
Phempt Posted October 23, 2014 Share Posted October 23, 2014 Cool!Nice job Stephan, are you working to solve the 2 limitations? (especially the bodies rotation) Quote Link to comment Share on other sites More sharing options...
Stephan Posted October 24, 2014 Author Share Posted October 24, 2014 I intend to leave it like this because it will probably be better to use a real physics engine if you want to do more realistic stuff. With rotation things get much more complicated). Having said so, I believe that this plugin provides enough options for about 90% of my current physics needs. Quote Link to comment Share on other sites More sharing options...
enpu Posted October 24, 2014 Share Posted October 24, 2014 This looks interesting, will give it a try, and see if it's something that would be nice to implement into Panda Quote Link to comment Share on other sites More sharing options...
Stephan Posted October 24, 2014 Author Share Posted October 24, 2014 I think we should at least have a serious look at both performance and stability before integrating it in the default engine. I will do some testings the next few weeks and keep you informed. Quote Link to comment Share on other sites More sharing options...
enpu Posted October 24, 2014 Share Posted October 24, 2014 Nice thanks! Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted October 25, 2014 Share Posted October 25, 2014 Will you add support for collision between rotated Rectangles? It'll be very useful if a square body rotated and collide with others, but the collision don't affect their rotation as you said.I know it sounds not REAL at all, but considering there's a large block falling down which is rotated randomly and hit the character to kill him, or bullets hit a rotated arm of boss... Quote Link to comment Share on other sites More sharing options...
Stephan Posted October 25, 2014 Author Share Posted October 25, 2014 Perhaps I will adress this in the future but you must realize that it will complicate the plugin considerably. The current plugin is just 10 kb (compare this with the P2/Box2D-engine that both have a file size around 400kb). The small size is possible because of the limitation of not taking into account rotations. For now you will have to pick Box2D/P2 for rotation. Quote Link to comment Share on other sites More sharing options...
enpu Posted October 25, 2014 Share Posted October 25, 2014 I agree with Stephan, for that you should use Box2D or p2.js Quote Link to comment Share on other sites More sharing options...
goide Posted June 24, 2015 Share Posted June 24, 2015 @Stephan Looking at the code of this plugin, I am presented with the following error.Uncaught TypeError: Cannot read property 'copy' of undefinedthis error on the line, 249, of plugin. The solution to this mistake was to remove that line of code. If it's not the ultimate solution, but I worked on what I'm working. It would be good that you check the code of this plugin it will work for the latest version of Panda engine Thanks. 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.