RaananW Posted February 23, 2016 Share Posted February 23, 2016 So! I don't know how many of you have noticed the commit from yesterday, but Babylon's physics engine has a new architecture. There is now a physics impostor class that will be your one-stop-shop for all physics needs. Applying impulse, force, changing velocity, everything is there. There is also a way to register callbacks to be called before and after the physics step and when the mesh collides against other meshes. Those API might change a bit until 2.4 is officially out, but get used to the new architecture! What's new? A lot! A short list (before I finish writing the full documentation and tutorials): Dedicated PhysicsImpostor for each mesh, dedicated PhysicsJoint for each joint/constraint New Joint-System - Is is now possible to add many kinds of links (depends on the underlying physics plugin) - A Distance Joint, A Hinge, a Ball-And-Socket and more. Documentation is being written But just to get people interested - @Wingnut, you might find this a lot of fun - http://www.babylonjs-playground.com/#1ND6TH Physics plugin is mainly transparent - changing from cannon to oimo (and soon to the new energy engine) should simply work. Try it in the last playground example. Having said that - there is a way to execute native cannon/oimo code in a very simple way New callback mechanism for before and after the physics step AND when an impostor collides against a specific impostor. Two-Way transformation update - No need to execute updatePhysicsBody[Position]() - physics rotation and position is automatically updated. A way to recreate the body, in case parameters like the scale has changed. Physics Plugins rebuilt with performance adjustments. Set Velocity Apply Force And many many other little things For those who want to see what was done under the hood, the PR is here - https://github.com/BabylonJS/Babylon.js/pull/983 Fell free to ask questions, and please wait patiently for the documentation that will arrive soon. (Or "sooner or later"). There are a lot of things on my TODO list to add to this engine (Spring objects, Physics-Particle-System, further joints and constraints and more), but this is step 1. And it is finally done Enjoy physics! Wingnut, Vousk-prod., jerome and 6 others 9 Quote Link to comment Share on other sites More sharing options...
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.