else setDefaultGroup(); return; } else if ("f".equals(parts[0])){ addFaces(parts); return; } else if ("mtllib".equals(parts[0])){ loadMaterials(parts); return; } else if ("newmtl".equals(parts[0])){ addMaterial(parts); return; } else if ("usemtl".equals(parts[0])){ if (materialNames.get(parts[1])!=null) curGroup=(MaterialGrouping) materialNames.get(parts[1]);
    private void processLine(String s) throws IOException {        if (s==null) return ;        if (s.length()==0) return;        String[] parts=s.split(" ");        parts=removeEmpty(parts);        if ("#".equals(parts[0])) return;        if ("v".equals(parts[0])){            addVertextoList(parts);            return;        }else if ("vt".equals(parts[0])){            addTextoList(parts);            return;        } else if ("vn".equals(parts[0])){            addNormalToList(parts);            return;        } else if ("g".equals(parts[0])){            //see what the material name is if there isn't a name, assume its the default group            if (parts.length >= 2 && materialNames.get(parts[1]) != null                   && materialNames.get(parts[1]) != null)                curGroup = (MaterialGrouping) materialNames.get(parts[1]);             else                setDefaultGroup();            return;         } else if ("f".equals(parts[0])){            addFaces(parts);            return;        } else if ("mtllib".equals(parts[0])){            loadMaterials(parts);            return;        } else if ("newmtl".equals(parts[0])){            addMaterial(parts);            return;        } else if ("usemtl".equals(parts[0])){            if (materialNames.get(parts[1])!=null)                curGroup=(MaterialGrouping) materialNames.get(parts[1]);            else                setDefaultGroup();            return;        } else if ("Ka".equals(parts[0])){            curGroup.m.setAmbient(new ColorRGBA(Float.parseFloat(parts[1]),Float.parseFloat(parts[2]),Float.parseFloat(parts[3]),1));            return;        } else if ("Kd".equals(parts[0])){            curGroup.m.setDiffuse(new ColorRGBA(Float.parseFloat(parts[1]),Float.parseFloat(parts[2]),Float.parseFloat(parts[3]),1));            return;        } else if ("Ks".equals(parts[0])){            curGroup.m.setSpecular(new ColorRGBA(Float.parseFloat(parts[1]),Float.parseFloat(parts[2]),Float.parseFloat(parts[3]),1));            return;        } else if ("Ns".equals(parts[0])){            curGroup.m.setShininess(Float.parseFloat(parts[1]));            return;        } else if ("d".equals(parts[0])){            float alpha = Float.parseFloat(parts[1]);            curGroup.m.getAmbient().a *= alpha;            curGroup.m.getDiffuse().a *= alpha;            curGroup.m.getSpecular().a *= alpha;            if (alpha < 1.0f)               curGroup.createAlphaState();            return;        } else if ("map_d".equals(parts[0])) {               curGroup.createAlphaState();               return;        } else if ("map_Kd".equals(parts[0]) || "map_Ka".equals(parts[0])){            Texture t=new Texture();            t.setWrap(Texture.WM_WRAP_S_WRAP_T);            t.setImageLocation("file:/"+s.trim().substring(6));            curGroup.ts.setTexture(t);            curGroup.ts.setEnabled(true);            return;        }    }