@Override
	public void update( float delta )
	{
		SphereCollider spheres[] = new SphereCollider[6];
		spheres[0] = new SphereCollider( player.getTransform().getPos(), 150 );
		spheres[1] = new SphereCollider( player.getTransform().getPos(), 100 );
		spheres[2] = new SphereCollider( player.getTransform().getPos(), 75 );
		spheres[3] = new SphereCollider( player.getTransform().getPos(), 50 );
		spheres[4] = new SphereCollider( player.getTransform().getPos(), 20 );
		spheres[5] = new SphereCollider( player.getTransform().getPos(), 10 );

		List<QuadTree> toDivide = new ArrayList<QuadTree>();
//		List<QuadTree> toRemove = new ArrayList<QuadTree>();
		int limit = 0;
		for ( QuadTree quadTree : quadTrees )
		{
			List<QuadTree> renderedNode = quadTree.getLeaves();
			for ( QuadTree node : renderedNode )
			{
				for ( int i = 0; i < spheres.length; i++ )
				{
					if ( isInSphere( i + 1, spheres[i], node ) )
					{
						toDivide.add( node );
						limit++;
						break;
					}
//					else if ( node.parent != null )
//					{
//						Collections.addAll( toRemove, node.parent );
//					}
				}
				if ( limit == 5 )
					break;
			}
		}
		for ( QuadTree node : toDivide )
		{
			subDivideChunk( (Chunk) node.object, node );
		}
//		for ( QuadTree node : toRemove )
//		{
//			List<QuadTree> list = Arrays.asList( node.children );
//			for ( QuadTree q : list )
//			{
//				try
//				{
//					mesh.delTriangles( ((Chunk)q.object).getTriangles() );
//				}
//				catch ( Exception e )
//				{
//					e.printStackTrace();
//				}
//			}
//			mesh.addTriangles( ( (Chunk) node.object ).getTriangles() );
//		}
	}