class Particle3D{ Vec3D pos; Vec3D vel; Vec3D initPos; Vec3D initVel; color c; int age; Particle3D(Vec3D pos, Vec3D vel){ this.pos = new Vec3D(pos); this.vel = new Vec3D(vel); this.initPos = new Vec3D(pos); this.initVel = new Vec3D(vel); age=(int)random(820); } Particle3D(Particle3D p){ this.pos = new Vec3D(p.pos); this.vel = new Vec3D(p.vel); this.initPos = new Vec3D(p.pos); this.initVel = new Vec3D(p.vel); this.age = p.age; } void update(Vec3D force){ vel=vel.add(force); pos=pos.add(vel); } void reset(){ pos = new Vec3D(initPos); vel = new Vec3D(initVel); age=(int)random(820);; } }