An anchor is guaranteed to remain at the same place, and therefore can be passed between threads since once created, it is read-only.
250251252253254255256257258259260261
SpringBox box = (SpringBox) this.box; double k = box.k; double vz = box.getViewZone(); Anchor lo = cell.getSpace().getLoAnchor(); Anchor hi = cell.getSpace().getHiAnchor(); double x1 = lo.x; double x2 = hi.x; double X1 = pos.x - (k * vz); double X2 = pos.x + (k * vz);
290291292293294295296297298299300301302303304
this.is3D = is3D; this.random = randomNumberGenerator; if (is3D) { space = new OctreeCellSpace(new Anchor(-1, -1, -1), new Anchor(1, 1, 1)); } else { space = new QuadtreeCellSpace(new Anchor(-1, -1, -0.01f), new Anchor(1, 1, 0.01f)); } this.nodes = new ParticleBox(nodesPerCell, space, new GraphCellData());