    private void updateChildrens(Vector3f cam) {
        TerrainQuad q1 = cache.get(cam.add(quadIndex[5]));
        TerrainQuad q2 = cache.get(cam.add(quadIndex[6]));
        TerrainQuad q3 = cache.get(cam.add(quadIndex[9]));
        TerrainQuad q4 = cache.get(cam.add(quadIndex[10]));
        int dx = 0;
        int dy = 0;
        if (currentCell != null) {
            dx = (int) (cam.x - currentCell.x);
            dy = (int) (cam.z - currentCell.z);
        }
        int kxm = 0;
        int kxM = 4;
        int kym = 0;
        int kyM = 4;
        if (dx == -1) {
            kxM = 3;
        } else if (dx == 1) {
            kxm = 1;
        }
        if (dy == -1) {
            kyM = 3;
        } else if (dy == 1) {
            kym = 1;
        }
        for (int i = kym; i < kyM; i++) {
            for (int j = kxm; j < kxM; j++) {
                cache.get(cam.add(quadIndex[i * 4 + j]));
            }
        }
        if (q1 == null || q2 == null || q3 == null || q4 == null) {
            try {
                executor.submit(new UpdateQuadCache(cam, true)).get();
                q1 = cache.get(cam.add(quadIndex[5]));
                q2 = cache.get(cam.add(quadIndex[6]));
                q3 = cache.get(cam.add(quadIndex[9]));
                q4 = cache.get(cam.add(quadIndex[10]));
            } catch (InterruptedException ex) {
                Logger.getLogger(TerrainGrid.class.getName()).log(Level.SEVERE, null, ex);
                return;
            } catch (ExecutionException ex) {
                Logger.getLogger(TerrainGrid.class.getName()).log(Level.SEVERE, null, ex);
                return;
            }
        }
        executor.execute(new UpdateQuadCache(cam));
        RigidBodyControl control = getControl(RigidBodyControl.class);
        PhysicsSpace space = null;
        if (control != null) {
            space = control.getPhysicsSpace();
            space.remove(this);
            this.removeControl(control);
        }
        this.removeQuad(1);
        this.removeQuad(2);
        this.removeQuad(3);
        this.removeQuad(4);
        attachQuadAt(q1, 1);
        attachQuadAt(q2, 2);
        attachQuadAt(q3, 3);
        attachQuadAt(q4, 4);
        this.currentCell = cam;
        this.setLocalTranslation(cam.mult(this.getLocalScale().mult(this.quadSize)));
        this.updateModelBound();
        if (control != null) {
            int collisionGroupsCollideWith = control.getCollideWithGroups();
            int collisionGroups = control.getCollisionGroup();
            control = new RigidBodyControl(new HeightfieldCollisionShape(getHeightMap(), getLocalScale()), 0);
            control.setCollideWithGroups(collisionGroupsCollideWith);
            control.setCollisionGroup(collisionGroups);
            this.addControl(control);
            space.add(this);
        }
    }

    private void updateChildrens(Vector3f cam) {
        TerrainQuad q1 = cache.get(cam.add(quadIndex[5]));
        TerrainQuad q2 = cache.get(cam.add(quadIndex[6]));
        TerrainQuad q3 = cache.get(cam.add(quadIndex[9]));
        TerrainQuad q4 = cache.get(cam.add(quadIndex[10]));
        int dx = 0;
        int dy = 0;
        if (currentCell != null) {
            dx = (int) (cam.x - currentCell.x);
            dy = (int) (cam.z - currentCell.z);
        }
        int kxm = 0;
        int kxM = 4;
        int kym = 0;
        int kyM = 4;
        if (dx == -1) {
            kxM = 3;
        } else if (dx == 1) {
            kxm = 1;
        }
        if (dy == -1) {
            kyM = 3;
        } else if (dy == 1) {
            kym = 1;
        }
        for (int i = kym; i < kyM; i++) {
            for (int j = kxm; j < kxM; j++) {
                cache.get(cam.add(quadIndex[i * 4 + j]));
            }
        }
        if (q1 == null || q2 == null || q3 == null || q4 == null) {
            try {
                executor.submit(new UpdateQuadCache(cam, true)).get();
                q1 = cache.get(cam.add(quadIndex[5]));
                q2 = cache.get(cam.add(quadIndex[6]));
                q3 = cache.get(cam.add(quadIndex[9]));
                q4 = cache.get(cam.add(quadIndex[10]));
            } catch (InterruptedException ex) {
                Logger.getLogger(TerrainGrid.class.getName()).log(Level.SEVERE, null, ex);
                return;
            } catch (ExecutionException ex) {
                Logger.getLogger(TerrainGrid.class.getName()).log(Level.SEVERE, null, ex);
                return;
            }
        }
        executor.execute(new UpdateQuadCache(cam));
        RigidBodyControl control = getControl(RigidBodyControl.class);
        PhysicsSpace space = null;
        if (control != null) {
            space = control.getPhysicsSpace();
            space.remove(this);
            this.removeControl(control);
        }
        this.removeQuad(1);
        this.removeQuad(2);
        this.removeQuad(3);
        this.removeQuad(4);
        attachQuadAt(q1, 1);
        attachQuadAt(q2, 2);
        attachQuadAt(q3, 3);
        attachQuadAt(q4, 4);
        this.currentCell = cam;
        this.setLocalTranslation(cam.mult(this.getLocalScale().mult(this.quadSize-1)));
        this.updateModelBound();
        if (control != null) {
            int collisionGroupsCollideWith = control.getCollideWithGroups();
            int collisionGroups = control.getCollisionGroup();
            control = new RigidBodyControl(new HeightfieldCollisionShape(getHeightMap(), getLocalScale()), 0);
            control.setCollideWithGroups(collisionGroupsCollideWith);
            control.setCollisionGroup(collisionGroups);
            this.addControl(control);
            space.add(this);
        }
    }
