class Particle { public static final double MAX_INFLUENCE_RANGE = 10; private double INFLUENCE_RADIUS = MAX_INFLUENCE_RANGE/2.0; private double MIN_DISTANCE_SQ = sq(1.5); private double ESCAPE_FORCE = 3.5;//.2;//1.1; private double DRAG = 0.985;//95;//0.982;//0.99; public boolean UNMOVABLE = false; public boolean REMOVABLE_FOR_FRAMERATE = true; // DRAWING SETTINGS: private float DRAW_RADIUS = 10; // after changing this, use makeCircle() private boolean DRAW_UNFILLED_CIRCLE = false; // ----------------- public int COL_R = 0; public int COL_G = 32; public int COL_B = 255; public int MIN_OPACITY = 50; public int MAX_OPACITY = 255; public int OPACITY = MIN_OPACITY; public boolean VISIBLE = true; public Vec pos,newPos; public Vec mov,newMov; private float[] cX, cY; Particle(double x, double y) { pos = new Vec(); mov = new Vec(); newPos = new Vec(); newMov = new Vec(); double r = Math.sqrt(MIN_DISTANCE_SQ)*random(1.1,3.0); double dir = random(TWO_PI); pos.X = x + r*Math.cos(dir); pos.Y = y + r*Math.sin(dir); makeCircle(); } Particle(Vec v) { this(v.X,v.Y); } Particle(double x, double y, double radius) { this(x,y); INFLUENCE_RADIUS = Math.min(MAX_INFLUENCE_RANGE/2.0,radius); makeCircle(); } Particle(Vec v, double radius) { this(v.X,v.Y); INFLUENCE_RADIUS = Math.min(MAX_INFLUENCE_RANGE/2.0,radius); makeCircle(); } Particle(double x, double y, double xm, double ym) { this(x,y); mov.set(xm,ym); } Particle(double x, double y, double xm, double ym, double radius) { this(x,y); mov.set(xm,ym); INFLUENCE_RADIUS = Math.min(MAX_INFLUENCE_RANGE/2.0,radius); makeCircle(); } public void initMov() { newMov.set(mov); } public void makeNewPosAndMov(SpaceGrid spaceGrid, Obstacles obstacles) { Vector neighbours = spaceGrid.getNeighbours(this); for (int i=0;i>16&0xFF; int g1 = c1>>8&0xFF; int b1 = c1&0xFF; int rr = (r1*255 + F*(r0-r1))>>8; int gg = (g1*255 + F*(g0-g1))>>8; int bb = (b1*255 + F*(b0-b1))>>8; return 0xFF000000|rr<<16|gg<<8|bb; } //private void drawCircle(color c, int opacity) { private void drawCircle(int r, int g, int b, int opacity) { for (int i=0;i