private void bounceOffObjects(SpaceObject uObj){
		double disToMove;
		double mass;
		double mass2;
		double massSum;
		double massPercent;
		double massPercent2;
		double velSum;
		//Obj:
		double normX;
		double normY;
		double normLength;
		double normUnitX;
		double normUnitY;
		double velX;
		double velY;
		double velTot;
		double velUnitX;
		double velUnitY;
		double NdotI;
		double refVelX;
		double refVelY;
		//Obj2:
		double normUnitX2;
		double normUnitY2;
		double velX2;
		double velY2;
		double velTot2;
		double velUnitX2;
		double velUnitY2;
		double NdotI2;
		double refVelX2;
		double refVelY2;
		SpaceObject uObj2;
		for(int i=0; i<vObjs.size(); i++){
			//Get all objects except the current object:
			if(vObjs.get(i) != uObj){
				//Detect collisions:
				if(collision(uObj, vObjs.get(i))){
				uObj2 = vObjs.get(i);
				//Reflect object off any objects it has collided with: R = 2 * N * (N dot I) - I
				//Normal obj:
				normX = uObj.getCenterX() - uObj2.getCenterX();
				normY = uObj.getCenterY() - uObj2.getCenterY();
				normLength = Math.sqrt(normX*normX + normY*normY);
				if(normLength == 0){
					continue;
				}
				normUnitX = normX / normLength;
				normUnitY = normY / normLength;
				//Incident obj:
				velX = uObj.getVelX();
				velY = uObj.getVelY();
				velTot = Math.sqrt(velX*velX + velY * velY);
				if(velTot == 0){
					continue;
				}
				velUnitX = velX / velTot;
				velUnitY = velY / velTot;
				NdotI = -Math.abs(velUnitX * normUnitX + velUnitY * normUnitY);
				refVelX = -(2*normUnitX*NdotI - velUnitX);
				refVelY = -(2*normUnitY*NdotI - velUnitY);
				//Normal obj2:
				normUnitX2 = -normUnitX;
				normUnitY2 = -normUnitY;
				//Incident obj2:
				velX2 = uObj2.getVelX();
				velY2 = uObj2.getVelY();
				velTot2 = Math.sqrt(velX2*velX2 + velY2 * velY2);
				if(velTot2 == 0){
					continue;
				}
				velUnitX2 = velX2 / velTot2;
				velUnitY2 = velY2 / velTot2;
				NdotI2 = -Math.abs(velUnitX2 * normUnitX2 + velUnitY2 * normUnitY2);
				refVelX2 = -(2*normUnitX2*NdotI2 - velUnitX2);
				refVelY2 = -(2*normUnitY2*NdotI2 - velUnitY2);
				//Move the objects so they are no longer intersecting:
				disToMove = ((uObj.getRad()+uObj2.getRad()) - distance(uObj, uObj2)) / 2; //overlap between the objects
				uObj.setCenterX(uObj.getCenterX() - normUnitX*disToMove);
				uObj.setCenterY(uObj.getCenterY() - normUnitY*disToMove);
				uObj2.setCenterX(uObj2.getCenterX() - normUnitX2*disToMove);
				uObj2.setCenterY(uObj2.getCenterY() - normUnitY2*disToMove);
				//Calculate new velocities:
				mass = uObj.getRad()*uObj.getRad()*uObj.getRad();
				mass2 = uObj2.getRad()*uObj2.getRad()*uObj2.getRad();
				massSum = mass + mass2;
				massPercent = mass / massSum;
				massPercent2 = 1 - massPercent;
				massPercent = 1;
				velSum = velTot + velTot2;
				uObj.setVelX(massPercent2 * velSum * refVelX);
				uObj.setVelY(massPercent2 * velSum * refVelY);
				uObj2.setVelX(massPercent * velSum * refVelX2);
				uObj2.setVelY(massPercent * velSum * refVelY2);
					while(collision(uObj, uObj2)){ //update positions until the objects are not overlapping:
						uObj.updatePos();
						uObj2.updatePos();
					}
				}
			}
		}
	}