aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2016-07-07 20:57:59 +0200
committerJulien Gouesse <[email protected]>2016-07-07 20:57:59 +0200
commit174f281ccb388f26a9229b24b14f5feb9c158963 (patch)
treeb260908abf2812053f45caa80e28c5747240437c /ardor3d-extras
parent598de90095319402854929ca3133709c0673ce95 (diff)
Removes any method chaining from ObjImporter
Diffstat (limited to 'ardor3d-extras')
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java
index e31e2ee..368d1b7 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java
@@ -49,24 +49,20 @@ public class ObjImporter {
return _loadTextures;
}
- public ObjImporter setLoadTextures(final boolean loadTextures) {
+ public void setLoadTextures(final boolean loadTextures) {
_loadTextures = loadTextures;
- return this;
}
- public ObjImporter setTextureLocator(final ResourceLocator locator) {
+ public void setTextureLocator(final ResourceLocator locator) {
_textureLocator = locator;
- return this;
}
- public ObjImporter setModelLocator(final ResourceLocator locator) {
+ public void setModelLocator(final ResourceLocator locator) {
_modelLocator = locator;
- return this;
}
- public ObjImporter setMaterialLocator(final ResourceLocator locator) {
+ public void setMaterialLocator(final ResourceLocator locator) {
_materialLocator = locator;
- return this;
}
public void setFlipTextureVertically(final boolean flipTextureVertically) {
@@ -157,11 +153,9 @@ public class ObjImporter {
* @return an ObjGeometryStore data object containing the scene and other useful elements.
*/
public ObjGeometryStore load(final ResourceSource resource, final GeometryTool geometryTool) {
- try {
+ try (final BufferedReader reader = new BufferedReader(new InputStreamReader(resource.openStream()))) {
final ObjGeometryStore store = new ObjGeometryStore(geometryTool);
long currentSmoothGroup = -1;
-
- final BufferedReader reader = new BufferedReader(new InputStreamReader(resource.openStream()));
String line;
int lineNo = 0;
while ((line = reader.readLine()) != null) {
@@ -393,8 +387,8 @@ public class ObjImporter {
store.commitObjects();
store.cleanup();
return store;
- } catch (final Exception e) {
- throw new Error("Unable to load obj resource from URL: " + resource, e);
+ } catch (final Throwable t) {
+ throw new Error("Unable to load obj resource from URL: " + resource, t);
}
}