public Spatial loadModel(String name){ return loadModel(new ModelKey(name)); }
@Override public int hashCode() { int hash = 5; hash = 31 * hash + (super.hashCode()); hash = 31 * hash + (this.materialList != null ? this.materialList.hashCode() : 0); hash = 31 * hash + (this.materialName != null ? this.materialName.hashCode() : 0); return hash; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final OgreMeshKey other = (OgreMeshKey) obj; if (!super.equals(other)) { return false; } if (this.materialList != other.materialList && (this.materialList == null || !this.materialList.equals(other.materialList))) { return false; } if ((this.materialName == null) ? (other.materialName != null) : !this.materialName.equals(other.materialName)) { return false; } return true; }
objName = key.getName(); String folderName = key.getFolder(); String ext = key.getExtension(); objName = objName.substring(0, objName.length() - ext.length() - 1); if (folderName != null && folderName.length() > 0){
protected void loadMtlLib(String name) throws IOException{ if (!name.toLowerCase().endsWith(".mtl")) throw new IOException("Expected .mtl file! Got: " + name); // NOTE: Cut off any relative/absolute paths name = new File(name).getName(); try { matList = (MaterialList) assetManager.loadAsset(key.getFolder() + name); } catch (AssetNotFoundException ex){ throw new AssetNotFoundException("Cannot find material " + name + " for model " + key.getName()); } if (matList != null){ // create face lists for every material for (String matName : matList.keySet()){ matFaces.put(matName, new ArrayList<Face>()); } }else{ logger.log(Level.WARNING, "Can't find MTL file. " + "Using default material for OBJ."); } }
public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
protected void loadMtlLib(String name) throws IOException{ if (!name.toLowerCase().endsWith(".mtl")) throw new IOException("Expected .mtl file! Got: " + name); // NOTE: Cut off any relative/absolute paths name = new File(name).getName(); AssetKey mtlKey = new AssetKey(key.getFolder() + name); try { matList = (MaterialList) assetManager.loadAsset(mtlKey); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{name, key}); } if (matList != null){ // create face lists for every material for (String matName : matList.keySet()){ matFaces.put(matName, new ArrayList<Face>()); } } }
objName = key.getName(); String folderName = key.getFolder(); String ext = key.getExtension(); objName = objName.substring(0, objName.length() - ext.length() - 1); if (folderName != null && folderName.length() > 0){
blenderKey = (BlenderKey) modelKey; } else { blenderKey = new BlenderKey(modelKey.getName());
protected void loadMtlLib(String name) throws IOException{ if (!name.toLowerCase().endsWith(".mtl")) throw new IOException("Expected .mtl file! Got: " + name); // NOTE: Cut off any relative/absolute paths name = new File(name).getName(); AssetKey mtlKey = new AssetKey(key.getFolder() + name); try { matList = (MaterialList) assetManager.loadAsset(mtlKey); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{name, key}); } if (matList != null){ // create face lists for every material for (String matName : matList.keySet()){ matFaces.put(matName, new ArrayList<Face>()); } } }
objName = key.getName(); String folderName = key.getFolder(); String ext = key.getExtension(); objName = objName.substring(0, objName.length() - ext.length() - 1); if (folderName != null && folderName.length() > 0){
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (animationMatchMethod == null ? 0 : animationMatchMethod.hashCode()); result = prime * result + (assetRootPath == null ? 0 : assetRootPath.hashCode()); result = prime * result + (defaultMaterial == null ? 0 : defaultMaterial.hashCode()); result = prime * result + (faceCullMode == null ? 0 : faceCullMode.hashCode()); result = prime * result + featuresToLoad; result = prime * result + (fixUpAxis ? 1231 : 1237); result = prime * result + fps; result = prime * result + generatedTexturePPU; result = prime * result + layersToLoad; result = prime * result + (loadGeneratedTextures ? 1231 : 1237); result = prime * result + (loadObjectProperties ? 1231 : 1237); result = prime * result + (loadUnlinkedAssets ? 1231 : 1237); result = prime * result + maxTextureSize; result = prime * result + (mipmapGenerationMethod == null ? 0 : mipmapGenerationMethod.hashCode()); result = prime * result + (optimiseTextures ? 1231 : 1237); result = prime * result + Float.floatToIntBits(skyGeneratedTextureRadius); result = prime * result + (skyGeneratedTextureShape == null ? 0 : skyGeneratedTextureShape.hashCode()); result = prime * result + skyGeneratedTextureSize; result = prime * result + (usedWorld == null ? 0 : usedWorld.hashCode()); result = prime * result + (int) pointsSize; result = prime * result + (int) linesWidth; return result; }
public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final OgreMeshKey other = (OgreMeshKey) obj; if (!super.equals(other)) { return false; } if (this.materialList != other.materialList && (this.materialList == null || !this.materialList.equals(other.materialList))) { return false; } if ((this.materialName == null) ? (other.materialName != null) : !this.materialName.equals(other.materialName)) { return false; } return true; }
ModelKey key = new ModelKey(fileName); Spatial loadedNode = new Node(); try {
@Override public int hashCode() { int hash = 5; hash = 31 * hash + (super.hashCode()); hash = 31 * hash + (this.materialList != null ? this.materialList.hashCode() : 0); hash = 31 * hash + (this.materialName != null ? this.materialName.hashCode() : 0); return hash; }
public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final OgreMeshKey other = (OgreMeshKey) obj; if (!super.equals(other)) { return false; } if (this.materialList != other.materialList && (this.materialList == null || !this.materialList.equals(other.materialList))) { return false; } if ((this.materialName == null) ? (other.materialName != null) : !this.materialName.equals(other.materialName)) { return false; } return true; }
@Override public void simpleInitApp() { AssetLinkNode loaderNode=new AssetLinkNode(); loaderNode.addLinkedChild(new ModelKey("Models/MonkeyHead/MonkeyHead.mesh.xml"));