// tjhBuckets.java import java.awt.*; import java.util.*; import tjhBucket; /** a simple regular space-partitioning class to speed up collision detection */ public class tjhBuckets { //-------------------------------------------------------------------------------- // data //-------------------------------------------------------------------------------- /** the 2D array of tjhBucket's */ protected tjhBucket buckets[][]; /** the width of each bucket */ protected float bucket_scale; /** the number of buckets in each direction */ protected int n_xBuckets,n_yBuckets; //-------------------------------------------------------------------------------- // public methods //-------------------------------------------------------------------------------- /** default constructor initializes bucket array */ public tjhBuckets(float scale,int n_x,int n_y) { buckets = new tjhBucket[n_x][n_y]; int x,y; for(x=0;x=0 && y>=0 && x0; } /** draw a representation of which buckets contain cells */ /*public void Draw(Graphics g) { g.setColor(Color.black); int x,y; for(x=0;x