{"id":13438695,"url":"https://github.com/milcktoast/particulate-js","last_synced_at":"2025-12-12T04:17:06.891Z","repository":{"id":18342997,"uuid":"21522679","full_name":"milcktoast/particulate-js","owner":"milcktoast","description":"Particle physics micro library.","archived":false,"fork":false,"pushed_at":"2019-10-17T19:25:26.000Z","size":618,"stargazers_count":337,"open_issues_count":0,"forks_count":30,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-07-25T00:18:48.203Z","etag":null,"topics":["javascript","microlib","particle-physics","physics"],"latest_commit_sha":null,"homepage":"https://particulatejs.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milcktoast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-05T15:30:43.000Z","updated_at":"2024-07-25T00:18:48.204Z","dependencies_parsed_at":"2022-08-25T12:10:54.435Z","dependency_job_id":null,"html_url":"https://github.com/milcktoast/particulate-js","commit_stats":null,"previous_names":["milcktoast/particulate-js","jpweeks/particulate-js"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milcktoast%2Fparticulate-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milcktoast%2Fparticulate-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milcktoast%2Fparticulate-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milcktoast%2Fparticulate-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milcktoast","download_url":"https://codeload.github.com/milcktoast/particulate-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631811,"owners_count":20970064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","microlib","particle-physics","physics"],"created_at":"2024-07-31T03:01:07.642Z","updated_at":"2025-12-12T04:17:01.868Z","avatar_url":"https://github.com/milcktoast.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Particulate.js\n\n[![Stability][stability-image]][stability-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n[![Code Climate][climate-image]][climate-url]\n[![Inline Docs][docs-image]][docs-url]\n![File Size][size-image]\n\nParticulate.js is a JavaScript particle physics micro library designed to be simple, extensible, fast, and stable;\nit is capable of running a simulation with tens of thousands of particles and tens of thousands of constraints in real time.\nThe core system is derived from that described in [Advanced Character Physics by Thomas Jakobsen][adv-phys-url].\n\n[Website](http://particulatejs.org) –\n[Examples](http://particulatejs.org/examples/) –\n[Docs](http://particulatejs.org/docs/) –\n[Tests](http://particulatejs.org/test/)\n\n## Usage\n\nThe library provides an interface for defining a particle system with many inter-particle constraints\nand globally acting forces. Internal management of particle positions and state is designed to be easily integrated\nwith a WebGL rendering pipeline, although no specific rendering scheme is required.\n\n### Install\n\nInstall with **npm** or **bower** or download the [built package][dist-url].\n\n```sh\nnpm install particulate --save\n```\n\n```sh\nbower install particulate --save\n```\n\nThen include the library as an ES6, AMD, or commonJS module, or browser global.\n\n```js\nimport { ParticleSystem, DistanceConstraint } from 'particulate'\n```\n\n```js\ndefine(['particulate'], function (Particulate) { /* ... */ });\n```\n\n```js\nvar Particulate = require('particulate');\n```\n\n```js\nvar Particulate = window.Particulate;\n```\n\n### Integrate Renderer\n\nThe following is a simplified version of the [chain example](http://particulatejs.org/examples/#chain/chain.html),\nrendered with [Three.js][three-url]:\n\n```js\n// ..................................................\n// Define particle chain system\n//\n\nvar particleCount = 5;\nvar relaxIterations = 2;\n\nvar system = Particulate.ParticleSystem.create(particleCount, relaxIterations);\nvar dist = Particulate.DistanceConstraint.create(10, [0, 1, 1, 2, 2, 3, 3, 4]);\nvar pin = Particulate.PointConstraint.create([0, 0, 0], 0);\nvar gravity = Particulate.DirectionalForce.create([0, -0.05, 0]);\n\nsystem.addConstraint(dist);\nsystem.addPinConstraint(pin);\nsystem.addForce(gravity);\n\n// ..................................................\n// Integrate with Three.js\n//\n\nvar scene = new THREE.Scene();\n\n// Use system positions buffer\nvar vertices = new THREE.BufferAttribute(system.positions, 3);\n\n// Use distance constraint indices\nvar indices = new THREE.BufferAttribute(new Uint16Array(dist.indices));\n\n// Particles\nvar dotsGeom = new THREE.BufferGeometry();\ndotsGeom.addAttribute('position', vertices);\n\nvar dots = new THREE.PointCloud(dotsGeom,\n  new THREE.PointCloudMaterial({ size : 2 }));\n\n// Connections\nvar linesGeom = new THREE.BufferGeometry();\nlinesGeom.addAttribute('position', vertices);\nlinesGeom.addAttribute('index', indices);\n\nvar lines = new THREE.Line(linesGeom,\n  new THREE.LineBasicMaterial());\n\nscene.add(dots);\nscene.add(lines);\n\nfunction animate() {\n  system.tick(1);\n  dotsGeom.attributes.position.needsUpdate = true; // Flag to update WebGL buffer\n  render();\n}\n```\n\n## Development\n\n[Grunt][grunt-url] is used for building and testing the library.\nYou should have one path for each dependency:\n\n```sh\nwhich node npm grunt\n```\n\nAfter resolving development dependencies, run:\n\n```sh\nnpm install\n```\n\n### Test\n\nRun a development server with `grunt server`.\nVisit `localhost:8000/examples/` to view examples or `localhost:8000/test/` to run tests.\nThe development version of the library will be automatically rebuilt when any file matching `/src/**/*` changes.\n\nTests can also be run from the command line with `grunt test`.\n\n### Build\n\nRunning `grunt build` will generate a fully commented development version of the library as well as\na minified production version in `/dist`.\n\n### Document\n\nSource code is documented in-line using [YUIDoc syntax](http://yui.github.io/yuidoc/syntax/index.html)\nand compiled by running `grunt yuidoc`.\n\n### Contribute\n\nThere is not a formal style guide, but please maintain the existing coding style.\nAny new or changed functionality should be documented and covered by unit tests.\n\n\n[adv-phys-url]: http://web.archive.org/web/20080410171619/http://www.teknikus.dk/tj/gdc2001.htm\n[dist-url]: http://particulatejs.org/dist/particulate.js\n[three-url]: http://threejs.org\n[grunt-url]: http://gruntjs.com/\n[yuidoc-url]: http://yui.github.io/yuidoc/syntax/index.html\n\n[stability-url]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[stability-image]: https://img.shields.io/badge/stability-stable-green.svg?style=flat-square\n[travis-url]: https://travis-ci.org/jpweeks/particulate-js\n[travis-image]: https://img.shields.io/travis/jpweeks/particulate-js/develop.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/jpweeks/particulate-js\n[coveralls-image]: https://img.shields.io/coveralls/jpweeks/particulate-js/develop.svg?style=flat-square\n[climate-url]: https://codeclimate.com/github/jpweeks/particulate-js/code\n[climate-image]: https://img.shields.io/codeclimate/maintainability/jpweeks/particulate-js?style=flat-square\n[docs-url]: https://inch-ci.org/github/jpweeks/particulate-js\n[docs-image]: https://inch-ci.org/github/jpweeks/particulate-js.svg?branch=master\u0026style=flat-square\n[size-image]: https://badge-size.herokuapp.com/jpweeks/particulate-js/master/dist/particulate.min.js.svg?compression=gzip\u0026style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilcktoast%2Fparticulate-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilcktoast%2Fparticulate-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilcktoast%2Fparticulate-js/lists"}