All Projects → jpweeks → Particulate Js

jpweeks / Particulate Js

Licence: mit
Particle physics micro library.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Particulate Js

godot-vs-rapier
compare gdnative rust based physics against Godot built-in physics
Stars: ✭ 67 (-78.93%)
Mutual labels:  physics
Itensor
A C++ library for efficient tensor network calculations
Stars: ✭ 269 (-15.41%)
Mutual labels:  physics
Glportal
🎮 Open Source teleportation based first person puzzle-platformer
Stars: ✭ 297 (-6.6%)
Mutual labels:  physics
Haskell-abinitio
contains a package in Haskell to calculate the electronic structure properties of molecules using the Hartree-Fock method
Stars: ✭ 14 (-95.6%)
Mutual labels:  physics
Optimesh
Mesh optimization, mesh smoothing.
Stars: ✭ 261 (-17.92%)
Mutual labels:  physics
Jitterphysics
A cross-platform, realtime physics engine for all .NET apps.
Stars: ✭ 277 (-12.89%)
Mutual labels:  physics
qnm
Python package for computing Kerr quasinormal mode frequencies, separation constants, and spherical-spheroidal mixing coefficients
Stars: ✭ 21 (-93.4%)
Mutual labels:  physics
Physx Rs
🎳 Rust binding and wrapper over NVIDIA PhysX 🦀
Stars: ✭ 310 (-2.52%)
Mutual labels:  physics
Css Spring
Generate physics based css-keyframe animations for the css-in-js solution of your choice or plain css.
Stars: ✭ 268 (-15.72%)
Mutual labels:  physics
Quantum Game
Quantum Game (old version) - a puzzle game with real quantum mechanics in a browser
Stars: ✭ 294 (-7.55%)
Mutual labels:  physics
fundamental
Software to look for interrelationships between constants and find formulas for number sequences
Stars: ✭ 14 (-95.6%)
Mutual labels:  physics
Tork
Arcade vehicle physics for Unity
Stars: ✭ 256 (-19.5%)
Mutual labels:  physics
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+1044.65%)
Mutual labels:  physics
pbcpy
Python package providing some useful tools when dealing with molecules and materials under periodic boundary conditions and uniform grids. This is a mirror of https://gitlab.com/ales.genova/pbcpy
Stars: ✭ 18 (-94.34%)
Mutual labels:  physics
Bounce
Bounce is a 3D physics engine for games.
Stars: ✭ 300 (-5.66%)
Mutual labels:  physics
Cloth-Simulation-With-python---Verlet-Integration
No description or website provided.
Stars: ✭ 17 (-94.65%)
Mutual labels:  physics
Thermo
Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
Stars: ✭ 279 (-12.26%)
Mutual labels:  physics
Stuntrally
The main repository containing Stunt Rally sources and game data. A 3D racing game based on VDrift and OGRE with track editor.
Stars: ✭ 314 (-1.26%)
Mutual labels:  physics
React Babylonjs
React for Babylon 3D engine
Stars: ✭ 299 (-5.97%)
Mutual labels:  physics
Unity Destruction
💥 An open-source script to destroy objects realistically in Unity3D.
Stars: ✭ 291 (-8.49%)
Mutual labels:  physics

Particulate.js

Stability Build Status Test Coverage Code Climate Inline Docs File Size

Particulate.js is a JavaScript particle physics micro library designed to be simple, extensible, fast, and stable; it is capable of running a simulation with tens of thousands of particles and tens of thousands of constraints in real time. The core system is derived from that described in Advanced Character Physics by Thomas Jakobsen.

WebsiteExamplesDocsTests

Usage

The library provides an interface for defining a particle system with many inter-particle constraints and globally acting forces. Internal management of particle positions and state is designed to be easily integrated with a WebGL rendering pipeline, although no specific rendering scheme is required.

Install

Install with npm or bower or download the built package.

npm install particulate --save
bower install particulate --save

Then include the library as an ES6, AMD, or commonJS module, or browser global.

import { ParticleSystem, DistanceConstraint } from 'particulate'
define(['particulate'], function (Particulate) { /* ... */ });
var Particulate = require('particulate');
var Particulate = window.Particulate;

Integrate Renderer

The following is a simplified version of the chain example, rendered with Three.js:

// ..................................................
// Define particle chain system
//

var particleCount = 5;
var relaxIterations = 2;

var system = Particulate.ParticleSystem.create(particleCount, relaxIterations);
var dist = Particulate.DistanceConstraint.create(10, [0, 1, 1, 2, 2, 3, 3, 4]);
var pin = Particulate.PointConstraint.create([0, 0, 0], 0);
var gravity = Particulate.DirectionalForce.create([0, -0.05, 0]);

system.addConstraint(dist);
system.addPinConstraint(pin);
system.addForce(gravity);

// ..................................................
// Integrate with Three.js
//

var scene = new THREE.Scene();

// Use system positions buffer
var vertices = new THREE.BufferAttribute(system.positions, 3);

// Use distance constraint indices
var indices = new THREE.BufferAttribute(new Uint16Array(dist.indices));

// Particles
var dotsGeom = new THREE.BufferGeometry();
dotsGeom.addAttribute('position', vertices);

var dots = new THREE.PointCloud(dotsGeom,
  new THREE.PointCloudMaterial({ size : 2 }));

// Connections
var linesGeom = new THREE.BufferGeometry();
linesGeom.addAttribute('position', vertices);
linesGeom.addAttribute('index', indices);

var lines = new THREE.Line(linesGeom,
  new THREE.LineBasicMaterial());

scene.add(dots);
scene.add(lines);

function animate() {
  system.tick(1);
  dotsGeom.attributes.position.needsUpdate = true; // Flag to update WebGL buffer
  render();
}

Development

Grunt is used for building and testing the library. You should have one path for each dependency:

which node npm grunt

After resolving development dependencies, run:

npm install

Test

Run a development server with grunt server. Visit localhost:8000/examples/ to view examples or localhost:8000/test/ to run tests. The development version of the library will be automatically rebuilt when any file matching /src/**/* changes.

Tests can also be run from the command line with grunt test.

Build

Running grunt build will generate a fully commented development version of the library as well as a minified production version in /dist.

Document

Source code is documented in-line using YUIDoc syntax and compiled by running grunt yuidoc.

Contribute

There is not a formal style guide, but please maintain the existing coding style. Any new or changed functionality should be documented and covered by unit tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].