private void doCollision(int pin1, int pin2, Vector3f distance, boolean clatter) {
		Debug.println("PhysicsEngine.doCollision()");
		MovableObject[] pins = model.getPins();
		MovableObject p1 = pins[pin1];
		MovableObject p2 = pins[pin2];
		Vector3f p1v = p1.getVelocity();
		Vector3f p2v;
		float m1 = p1.getMass();
		float m2 = p2.getMass();
		if (!clatter) {
			sound.doIt(Sound.CLATTER);
		}
		if (moving[pin2]) {
			p2v = p2.getVelocity();
			p1v.sub(p2v);
		} else {
			p2v = new Vector3f();
		}
//		Debug.println("p1v: " + p1v + " p2v: " + p2v);
		float[] p1Array= new float[3];
		p1v.get(p1Array);
		float x1 = p1Array[0];
		float y1 = p1Array[1];
		float z1 = p1Array[2];
		float[] p2Array = new float[3];
		p2v.get(p2Array);
		float x2 = 0;
		float y2 = 0;
		float z2 = 0;
		float[] distArray = new float[3];
		distance.get(distArray);
		float xd = distArray[0];
		float yd = distArray[1];
		float zd = distArray[2];
		float theta = (float)Math.atan(zd / xd);
		float alpha = (float)Math.atan(yd / xd);
		float dx = p1v.length() * (float)Math.cos(theta);
		float dz = p1v.length() * (float)Math.sin(theta);
		x2 = dx * (m1 / m2);
		y2 = 0;
		z2 = dz * (m1 / m2);
		x1 = x1 - dx * (m2 / m1);
		y1 = 0;
		z1 = z1 - dz * (m2 / m1);
		p1Array[0] = x1;
		p1Array[1] = y1;
		p1Array[2] = z1;
		p2Array[0] = x2;
		p2Array[1] = y2;
		p2Array[2] = z2;
		Vector3f p1v2 = new Vector3f(p1Array);
		Vector3f p2v2 = new Vector3f(p2Array);
		p1v2.add(p2v);
		p2v2.add(p2v);
//		Debug.println("p1v2: " + p1v2 + " p2v2: " + p2v2);
		p1.setVelocity(p1v2);
		p2.setVelocity(p2v2);
		if (moving[pin2]) {
			p2.setThetaV(p2.getTheta() - theta);
			p1.setThetaV(p1.getTheta() - theta);
		} else {
			p2.setTheta(theta);
			p2.setAlphaV(0.05f);
		}
		moving[pin2] = true;
	}