8000 GitHub - bhelx/p5particles: Particle Physics for Processing
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bhelx/p5particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particle Physics System for Processing


Warning: This has not been touched since 2011


Features:

  • internally uses PVector so no more wasteful vector conversion
  • RK4 and Euler integrators
  • Spring, Magnetic, ConstantGravitational, and Attractive forces
  • plug in your own integrators and Forces
  • uses a base Particle class for easy extenisbility
  • examples provided

Binaries && Installation

Download the latest binaries here:

p5particles.zip

Unzip and place the p5particles directory in your Processing libraries folder.

For more info see Daniel Shiffman's page on the subject of installing libraries.


Examples

I have a number a few examples so far. Here are the links to the live applets. I have had some issues viewing them in Chrome, they seem to work best in Firefox from what I have tested.

The library comes with the examples so you can always open them locally.


Usage && Documentation

The documentation, as it stands, constists of the examples and these javadocs which are quite sparse:

http://processing.datasingularity.com/p5particles/doc/

You will want to become very familiar with the Particle class.

For instance, here is how we can create a particle that is rendered as a colored box of specified size:

Particle_extension.java


Performance && Tips

If you are going to be adding and removing many particles or forces throughout the lifetime of the sketch, use ParticleSystem::setMaxForces() and ParticleSystem::setMaxParticles(). This isn't actually a maximum, it just allocates that much memory ahead of time so adding a force or particle does not result in a copy of the array. All you need to do is take a guess at the maximum. This could be really useful for starting up an application. It internally calls ArrayList::ensureCapacity so look there for more info.

The calculations themselves aren't too expensive. setting the ParticleSystem::setManagingLifecycle(true) can cause a slight performance drop, but for the most part, you are limited by rendering. Stay away from iterating over Particles or Forces when you don't have to, keep local copies of Particles or Forces that you want to manipulate often.

About

Particle Physics for Processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0