calling method with multiple objects of same class, each object assigned with different values
in
Programming Questions
•
2 years ago
hi all,
m working on an appl. tat interact with particles.
there are 4 classes:
1. class Work // main class calls Particles, Tracker
2. class Particles // generates particles
3. class Tracker // stores motion coordinates
4. class Force // calculates force
Tracker passes coordinates in arraylist to Work
Work assigns coordinates to Force obj { to calculate force}.
Particles calls method of Force to calculate force{ for calculating force, Force takes data assigned to its obj & data from Particles}
I created obj array of Force, so tat each Force obj is assigned with each coordinate in Work(from Tracker),
so tat every coordinates can be calculated with every Particles.
but whenever an obj moves, appl. hangs for a while, & slows down the effect
& when obj. is stable appl. works fine
is there any other way, tat every coordinates in Force are calculated with every particles.
OR
in one Force obj itself whole data is sent to be calculated
{in Force, data is as PVector}
plz guide.
thx.
1