/* Program goals:
2.22.2003 -in btown
-Emulate 2D particle-field interactions
-Upgradeable to 3D
Adjustments and effects:
-numParts: performance IP to square
-timeStep: time used to calc displacement of each frame,
time for each frame
-frameStep: Actual pause (ms) btewn frames
-forceFactor: larger means more inertia
-forcePower: exponent of distance
> working on tracker algorithm
-Slight offset in offsets is divergent from
-The acceleration of the collective particles
overcomes the adjustment algorithm - the
offsets arnen't adding fast enough to keep up
with the body.
-Reexamine follower algorithm
-make adjustment for some average velocity, like have
a coefficient that is DP to velocity.
> Optimized conditionals in update(g)
- Eventually particles are divergent
- energy of system increases due to invalid FORCE(dist) function
- use units, convert px to meters or Km and just use science instead
of minor adjustment tweaks.
> adjusting tracker to follow system center of mass
LATER: centerX = sum(m1*x1 m2*x2 ...)/sum(m1 m2 ...)
Adding text input for forcePower variable.
-Focus window by zooming out, instead of following one particle.
- the goal: keep all particles on the screen
- Calculate furthest distance between max and min x and y values
- Must also center w/ an offset..
- use offset of minx + (maxx-minx)/2
and miny + (maxy-miny)/2
- the logic?
-the minimum x or y value should be at or near the minimum point
of the screen.
- if minx = 0 and maxx = 500, then
offset = 0 + 500/2 = 250. // SHOULD BE 0.
- so maybe xoff = minx + (maxx-minx)/2 - MAXX/2;
xoff = -500 + (500)/2 - 250 = -500; NO. minx+xoff should = 0;
-screen should center on the point (maxx-minx)/2, (maxy-miny)/2.
given a point (x, y), how to center there?
-offset the point being drawn by the difference between that point and
the center point?
given a range of occupied space, how to zoom to fit screen?
- multiply all positions by a factor.. no, that is
dependent on the quadrant.
Taking out current follower code.
-increased part mass, sped up timestep GOAL: stabalize
- reduced forcePower to .5
- reduced forceFactor too. more stable, clumpy now