aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras/src/main/java/com
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2017-04-27 13:50:25 -0500
committerJoshua Slack <[email protected]>2017-04-27 13:50:25 -0500
commit33060d6cafbb84f19efa99e2ad3cea73cc1fd8ed (patch)
tree4816e40d06dfd47136b38454196882fdd004c875 /ardor3d-extras/src/main/java/com
parentec637d5a3fffe01ed4346c73fab91d8447a7192d (diff)
Made GeometryTool effectively into a static class
Diffstat (limited to 'ardor3d-extras/src/main/java/com')
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjGeometryStore.java15
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java28
2 files changed, 11 insertions, 32 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjGeometryStore.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjGeometryStore.java
index cac72f6..bd96824 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjGeometryStore.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjGeometryStore.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -58,15 +58,8 @@ public class ObjGeometryStore {
private final Map<String, ObjMaterial> materialLibrary = Maps.newHashMap();
private final Map<Spatial, String> _materialMap = Maps.newHashMap();
- private final GeometryTool _geometryTool;
-
public ObjGeometryStore() {
- this(new GeometryTool());
- }
-
- public ObjGeometryStore(final GeometryTool geometryTool) {
super();
- _geometryTool = geometryTool;
}
public Map<String, ObjMaterial> getMaterialLibrary() {
@@ -199,7 +192,7 @@ public class ObjGeometryStore {
}
points.getMeshData().setIndices(indexBuffer);
- _geometryTool.minimizeVerts(points, EnumSet.noneOf(MatchCondition.class));
+ GeometryTool.minimizeVerts(points, EnumSet.noneOf(MatchCondition.class));
applyCurrentMaterial(points);
mapToGroups(points);
@@ -247,7 +240,7 @@ public class ObjGeometryStore {
}
line.getMeshData().setIndexLengths(lengths);
}
- _geometryTool.minimizeVerts(line, EnumSet.of(MatchCondition.UVs));
+ GeometryTool.minimizeVerts(line, EnumSet.of(MatchCondition.UVs));
applyCurrentMaterial(line);
mapToGroups(line);
@@ -326,7 +319,7 @@ public class ObjGeometryStore {
groupData.setVertGroups(vertGroups);
groupData.setGroupConditions(VertGroupData.DEFAULT_GROUP,
EnumSet.of(MatchCondition.Normal, MatchCondition.UVs));
- _geometryTool.minimizeVerts(mesh, groupData);
+ GeometryTool.minimizeVerts(mesh, groupData);
applyCurrentMaterial(mesh);
mapToGroups(mesh);
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 f7b7c28..4328e19 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
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -21,7 +21,6 @@ import com.ardor3d.image.TextureStoreFormat;
import com.ardor3d.math.MathUtils;
import com.ardor3d.math.Vector3;
import com.ardor3d.util.TextureManager;
-import com.ardor3d.util.geom.GeometryTool;
import com.ardor3d.util.resource.ResourceLocator;
import com.ardor3d.util.resource.ResourceLocatorTool;
import com.ardor3d.util.resource.ResourceSource;
@@ -103,7 +102,7 @@ public class ObjImporter {
/**
* Reads a Wavefront OBJ file from the given resource
- *
+ *
* @param resource
* the name of the resource to find.
* @return an ObjGeometryStore data object containing the scene and other useful elements.
@@ -125,27 +124,14 @@ public class ObjImporter {
/**
* Reads a Wavefront OBJ file from the given resource
- *
+ *
* @param resource
* the name of the resource to find.
* @return an ObjGeometryStore data object containing the scene and other useful elements.
*/
public ObjGeometryStore load(final ResourceSource resource) {
- return load(resource, new GeometryTool());
- }
-
- /**
- * Reads a Wavefront OBJ file from the given resource
- *
- * @param resource
- * the name of the resource to find.
- * @param geometryTool
- * the geometry tool used to minimize the vertex count.
- * @return an ObjGeometryStore data object containing the scene and other useful elements.
- */
- public ObjGeometryStore load(final ResourceSource resource, final GeometryTool geometryTool) {
try {
- final ObjGeometryStore store = new ObjGeometryStore(geometryTool);
+ final ObjGeometryStore store = new ObjGeometryStore();
long currentSmoothGroup = -1;
final BufferedReader reader = new BufferedReader(new InputStreamReader(resource.openStream()));
@@ -218,7 +204,7 @@ public class ObjImporter {
else if ("cstype".equals(keyword)) {
// TODO: Add support for cstype
ObjImporter.logger
- .warning("ObjModelImporter: cstype not supported. (line " + lineNo + ") " + line);
+ .warning("ObjModelImporter: cstype not supported. (line " + lineNo + ") " + line);
}
// if degree
@@ -385,7 +371,7 @@ public class ObjImporter {
/**
* Load a .mtl resource
- *
+ *
* @param fileName
* the name of the mtl resource to load.
* @param modelSource
@@ -411,7 +397,7 @@ public class ObjImporter {
/**
* Load a .mtl resource
- *
+ *
* @param resource
* the mtl file to load, as a ResourceSource
* @param store