private void setInvisibility(boolean invisible) {
        Geometry geo = (Geometry)spatial;
                
        MatParam param = geo.getMaterial().getParam("Diffuse");
        ColorRGBA c;

        if(param != null) {
            c = (ColorRGBA)param.getValue();
        } else {
            c = ColorRGBA.White;
        }

        if(geo.getMaterial().getMaterialDef().getMaterialParam("Diffuse") != null) {
            geo.getMaterial().setColor("Diffuse", new ColorRGBA(c.r, c.b, c.g, invisible ? 0.3f : 1f));
        } else if(geo.getMaterial().getMaterialDef().getMaterialParam("Color") != null) {
            geo.getMaterial().setColor("Color", new ColorRGBA(c.r, c.b, c.g, invisible ? 0.3f : 1f));
        }

        if(invisible) {
            geo.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
            geo.setQueueBucket(RenderQueue.Bucket.Transparent);
        } else {
            geo.getMaterial().getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Off);
            geo.setQueueBucket(RenderQueue.Bucket.Opaque);
        }
                
        isInvisible = invisible;
    }