Verlet-JS is a physical engine written in JavaScript., Supports particle systems, distance constraints, angle constraints, etc,With verlet-JS, You can implement some very cool and physical effects in applications, such as collision, rolling, sliding, or bounce.
Verlet-js has the following features:
- Simulation: A root object that contains a composite object. It is used to drive all physical properties and animation effects of an object in a scenario.
- Composites (composite entity): used for high-level objects in a scenario (such as balls, connectors, fabrics, etc)
- Particle System: a point in space that is used to respond to various operations (gravity, drag, and drop)
- Constraint: concatenates particles to allow them to communicate with each other, including fixation (fixation of a particle to a position in space), distance constraint (BIND 2 particles through a certain straight line distance), angle constraint (BIND 3 particles through a certain angle)
You can view related examples through the following link:
- Shape
- Fragment tree
- Fabric
- Spider Web
Google launched
Google gravity project, you will find that all the page elements are falling, you can also drag the window at will, the elements in the window will also make the corresponding action, the effect is quite amazing, this uses
Box2d physical engine (similar to verlet-js ). Now with verlet-JS, you can make similar results.
Verlet-js source code is hosted on GitHub and uses the MIT license.
Project address:
Https://github.com/subprotocol/verlet-js
Appendix: another similar drag-and-drop Fabric Physical effect:
Http://codepen.io/stuffit/pen/KrAwx (large drag or right-click can have the effect of Fabric Tearing) or
Http://lonely-pixel.com/