dcdcdc
This commit is contained in:
parent
1679d62300
commit
8ba3c34262
@ -1,92 +1,8 @@
|
|||||||
package org.atriasoft.loader3d;
|
package org.atriasoft.loader3d;
|
||||||
|
|
||||||
public class Face {
|
public class Face {
|
||||||
public byte nbElement;
|
|
||||||
public final int[] vertex = new int[3];
|
|
||||||
public final int[] uv = new int[3];
|
|
||||||
public final int[] normal = new int[3];
|
|
||||||
public final int[] color = new int[3];
|
|
||||||
public Face() {
|
|
||||||
this.nbElement = 1;
|
|
||||||
this.vertex[0] = -1;
|
|
||||||
this.vertex[1] = -1;
|
|
||||||
this.vertex[2] = -1;
|
|
||||||
this.uv[0] = -1;
|
|
||||||
this.uv[1] = -1;
|
|
||||||
this.uv[2] = -1;
|
|
||||||
this.normal[0] = -1;
|
|
||||||
this.normal[1] = -1;
|
|
||||||
this.normal[2] = -1;
|
|
||||||
this.color[0] = -1;
|
|
||||||
this.color[1] = -1;
|
|
||||||
this.color[2] = -1;
|
|
||||||
}
|
|
||||||
public Face(int _v1, int _t1,
|
|
||||||
int _v2, int _t2,
|
|
||||||
int _v3, int _t3) {
|
|
||||||
this.nbElement = 3;
|
|
||||||
this.vertex[0] = _v1;
|
|
||||||
this.vertex[1] = _v2;
|
|
||||||
this.vertex[2] = _v3;
|
|
||||||
this.uv[0] = _t1;
|
|
||||||
this.uv[1] = _t2;
|
|
||||||
this.uv[2] = _t3;
|
|
||||||
this.normal[0] = -1;
|
|
||||||
this.normal[1] = -1;
|
|
||||||
this.normal[2] = -1;
|
|
||||||
this.color[0] = -1;
|
|
||||||
this.color[1] = -1;
|
|
||||||
this.color[2] = -1;
|
|
||||||
}
|
|
||||||
public Face(int _v1, int _t1, int _n1,
|
|
||||||
int _v2, int _t2, int _n2,
|
|
||||||
int _v3, int _t3, int _n3) {
|
|
||||||
this.nbElement = 3;
|
|
||||||
this.vertex[0] = _v1;
|
|
||||||
this.vertex[1] = _v2;
|
|
||||||
this.vertex[2] = _v3;
|
|
||||||
this.uv[0] = _t1;
|
|
||||||
this.uv[1] = _t2;
|
|
||||||
this.uv[2] = _t3;
|
|
||||||
this.normal[0] = _n1;
|
|
||||||
this.normal[1] = _n2;
|
|
||||||
this.normal[2] = _n3;
|
|
||||||
this.color[0] = -1;
|
|
||||||
this.color[1] = -1;
|
|
||||||
this.color[2] = -1;
|
|
||||||
}
|
|
||||||
public void setVertex(int _v1) {
|
|
||||||
this.nbElement = 1;
|
|
||||||
this.vertex[0] = _v1;
|
|
||||||
}
|
|
||||||
public void setVertex(int _v1, int _v2) {
|
|
||||||
this.nbElement = 2;
|
|
||||||
this.vertex[0] = _v1;
|
|
||||||
this.vertex[1] = _v2;
|
|
||||||
}
|
|
||||||
public void setVertex(int _v1, int _v2, int _v3) {
|
|
||||||
this.nbElement = 3;
|
|
||||||
this.vertex[0] = _v1;
|
|
||||||
this.vertex[1] = _v2;
|
|
||||||
this.vertex[2] = _v3;
|
|
||||||
}
|
|
||||||
public void setTexture(int _t1, int _t2, int _t3) {
|
|
||||||
this.uv[0] = _t1;
|
|
||||||
this.uv[1] = _t2;
|
|
||||||
this.uv[2] = _t3;
|
|
||||||
}
|
|
||||||
public void setNormal(int _n1, int _n2, int _n3) {
|
|
||||||
this.normal[0] = _n1;
|
|
||||||
this.normal[1] = _n2;
|
|
||||||
this.normal[2] = _n3;
|
|
||||||
}
|
|
||||||
public void setColor(int _c1, int _c2, int _c3) {
|
|
||||||
this.color[0] = _c1;
|
|
||||||
this.color[1] = _c2;
|
|
||||||
this.color[2] = _c3;
|
|
||||||
}
|
|
||||||
public static Face valueOf(String data, int offsetVertex, int offsetUV, int offsetNormal) {
|
public static Face valueOf(String data, int offsetVertex, int offsetUV, int offsetNormal) {
|
||||||
while(data.length() >= 1 && data.charAt(0) == ' ') {
|
while (data.length() >= 1 && data.charAt(0) == ' ') {
|
||||||
data = data.substring(1);
|
data = data.substring(1);
|
||||||
}
|
}
|
||||||
String[] elem = data.split(" |,|/");
|
String[] elem = data.split(" |,|/");
|
||||||
@ -114,4 +30,100 @@ public class Face {
|
|||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte nbElement;
|
||||||
|
public final int[] vertex = new int[3];
|
||||||
|
public final int[] uv = new int[3];
|
||||||
|
public final int[] normal = new int[3];
|
||||||
|
public final int[] color = new int[3];
|
||||||
|
|
||||||
|
public Face() {
|
||||||
|
this.nbElement = 1;
|
||||||
|
this.vertex[0] = -1;
|
||||||
|
this.vertex[1] = -1;
|
||||||
|
this.vertex[2] = -1;
|
||||||
|
this.uv[0] = -1;
|
||||||
|
this.uv[1] = -1;
|
||||||
|
this.uv[2] = -1;
|
||||||
|
this.normal[0] = -1;
|
||||||
|
this.normal[1] = -1;
|
||||||
|
this.normal[2] = -1;
|
||||||
|
this.color[0] = -1;
|
||||||
|
this.color[1] = -1;
|
||||||
|
this.color[2] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Face(int _v1, int _t1, int _v2, int _t2, int _v3, int _t3) {
|
||||||
|
this.nbElement = 3;
|
||||||
|
this.vertex[0] = _v1;
|
||||||
|
this.vertex[1] = _v2;
|
||||||
|
this.vertex[2] = _v3;
|
||||||
|
this.uv[0] = _t1;
|
||||||
|
this.uv[1] = _t2;
|
||||||
|
this.uv[2] = _t3;
|
||||||
|
this.normal[0] = -1;
|
||||||
|
this.normal[1] = -1;
|
||||||
|
this.normal[2] = -1;
|
||||||
|
this.color[0] = -1;
|
||||||
|
this.color[1] = -1;
|
||||||
|
this.color[2] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Face(int _v1, int _t1, int _n1, int _v2, int _t2, int _n2, int _v3, int _t3, int _n3) {
|
||||||
|
this.nbElement = 3;
|
||||||
|
this.vertex[0] = _v1;
|
||||||
|
this.vertex[1] = _v2;
|
||||||
|
this.vertex[2] = _v3;
|
||||||
|
this.uv[0] = _t1;
|
||||||
|
this.uv[1] = _t2;
|
||||||
|
this.uv[2] = _t3;
|
||||||
|
this.normal[0] = _n1;
|
||||||
|
this.normal[1] = _n2;
|
||||||
|
this.normal[2] = _n3;
|
||||||
|
this.color[0] = -1;
|
||||||
|
this.color[1] = -1;
|
||||||
|
this.color[2] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(int _c1, int _c2, int _c3) {
|
||||||
|
this.color[0] = _c1;
|
||||||
|
this.color[1] = _c2;
|
||||||
|
this.color[2] = _c3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNormal(int _n) {
|
||||||
|
this.normal[0] = _n;
|
||||||
|
this.normal[1] = _n;
|
||||||
|
this.normal[2] = _n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNormal(int _n1, int _n2, int _n3) {
|
||||||
|
this.normal[0] = _n1;
|
||||||
|
this.normal[1] = _n2;
|
||||||
|
this.normal[2] = _n3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTexture(int _t1, int _t2, int _t3) {
|
||||||
|
this.uv[0] = _t1;
|
||||||
|
this.uv[1] = _t2;
|
||||||
|
this.uv[2] = _t3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVertex(int _v1) {
|
||||||
|
this.nbElement = 1;
|
||||||
|
this.vertex[0] = _v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVertex(int _v1, int _v2) {
|
||||||
|
this.nbElement = 2;
|
||||||
|
this.vertex[0] = _v1;
|
||||||
|
this.vertex[1] = _v2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVertex(int _v1, int _v2, int _v3) {
|
||||||
|
this.nbElement = 3;
|
||||||
|
this.vertex[0] = _v1;
|
||||||
|
this.vertex[1] = _v2;
|
||||||
|
this.vertex[2] = _v3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,8 @@ import java.io.BufferedReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.atriasoft.etk.Uri;
|
import org.atriasoft.etk.Uri;
|
||||||
import org.atriasoft.etk.math.Vector2f;
|
import org.atriasoft.etk.math.Vector2f;
|
||||||
@ -20,47 +22,56 @@ import org.atriasoft.loader3d.model.PhysicShape;
|
|||||||
|
|
||||||
public class ResourceMeshEmf extends ResourceMesh {
|
public class ResourceMeshEmf extends ResourceMesh {
|
||||||
|
|
||||||
|
enum emfModuleMode {
|
||||||
|
EMFModuleSkip(-1), //!< skip the current module ==> filtered...
|
||||||
|
EMFModuleNone(0), //!< Nothing in parsing
|
||||||
|
EMFModuleMesh(1), //!<
|
||||||
|
EMFModuleMeshVertex(2), //!<
|
||||||
|
EMFModuleMeshUVMapping(3), //!<
|
||||||
|
EMFModuleMeshNormalVertex(4), //!<
|
||||||
|
EMFModuleMeshNormalFace(5), //!<
|
||||||
|
EMFModuleMeshFace(6), //!<
|
||||||
|
EMFModuleMeshFaceMaterial(7), //!<
|
||||||
|
EMFModuleMeshPhysics(8), //!<
|
||||||
|
EMFModuleMeshPhysicsNamed(9), //!<
|
||||||
|
EMFModuleMesh_END(100), //!<
|
||||||
|
EMFModuleMaterial(101), //!<
|
||||||
|
EMFModuleMaterial_END(200), //!<
|
||||||
|
EMFModulePalette(201), //!<
|
||||||
|
EMFModulePalette_END(300), //!<
|
||||||
|
EMFModulePhysics(301), //!<
|
||||||
|
EMFModulePhysicsNamed(302), //!<
|
||||||
|
EMFModulePhysics_END(400); //!<
|
||||||
|
|
||||||
|
|
||||||
enum emfModuleMode {
|
|
||||||
EMFModuleNone(0),
|
|
||||||
EMFModuleMesh(1),
|
|
||||||
EMFModuleMeshVertex(2),
|
|
||||||
EMFModuleMeshUVMapping(3),
|
|
||||||
EMFModuleMeshNormalVertex(4),
|
|
||||||
EMFModuleMeshNormalFace(5),
|
|
||||||
EMFModuleMeshFace(6),
|
|
||||||
EMFModuleMeshFaceMaterial(7),
|
|
||||||
EMFModuleMeshPhysics(8),
|
|
||||||
EMFModuleMeshPhysicsNamed(9),
|
|
||||||
EMFModuleMesh_END(100),
|
|
||||||
EMFModuleMaterial(101),
|
|
||||||
EMFModuleMaterial_END(200),
|
|
||||||
EMFModulePalette(201),
|
|
||||||
EMFModulePalette_END(300),
|
|
||||||
EMFModulePhysics(301),
|
|
||||||
EMFModulePhysicsNamed(302),
|
|
||||||
EMFModulePhysics_END(400);
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
emfModuleMode(int value) {
|
emfModuleMode(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getValue() {
|
int getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
// TODO : rework with string line extractor
|
||||||
|
/**
|
||||||
// TODO : rework with string line extractor
|
* Create a mesh from Ewol Mesh File.
|
||||||
public ResourceMeshEmf(Uri _fileName) {
|
* @param fileName generic URI if parameter filter is set the mesh is partially loaded applying the filter
|
||||||
super(_fileName);
|
* @throws Exception pb in parsing the file maybe no vertices inside...
|
||||||
mode = RenderMode.TRIANGLE;
|
*/
|
||||||
|
public ResourceMeshEmf(Uri fileName) throws Exception {
|
||||||
|
super(fileName);
|
||||||
|
Pattern filterPattern = null;
|
||||||
|
if (fileName.hasProperty("filter")) {
|
||||||
|
filterPattern = Pattern.compile(fileName.getProperty("filter"));
|
||||||
|
}
|
||||||
|
this.mode = RenderMode.TRIANGLE;
|
||||||
this.checkNormal = true;
|
this.checkNormal = true;
|
||||||
this.normalMode = NormalMode.NONE;
|
this.normalMode = NormalMode.NONE;
|
||||||
InputStream fileIOStream = Uri.getStream(_fileName);
|
InputStream fileIOStream = Uri.getStream(fileName);
|
||||||
if (fileIOStream == null ) {
|
if (fileIOStream == null) {
|
||||||
Log.error("CAn not get the file named='" + _fileName + "'");
|
Log.error("CAn not get the file named='" + fileName + "'");
|
||||||
return; // TODO false;
|
return; // TODO false;
|
||||||
}
|
}
|
||||||
BufferedReader fileIO = new BufferedReader(new InputStreamReader(fileIOStream));
|
BufferedReader fileIO = new BufferedReader(new InputStreamReader(fileIOStream));
|
||||||
@ -69,7 +80,7 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
//int size = fileIO.size();
|
//int size = fileIO.size();
|
||||||
|
|
||||||
String inputDataLine;
|
String inputDataLine;
|
||||||
Dynamic<Integer> levelIO = new Dynamic<Integer>(0);
|
Dynamic<Integer> levelIO = new Dynamic<>(0);
|
||||||
// load the first line :
|
// load the first line :
|
||||||
inputDataLine = readLine(fileIO, levelIO);
|
inputDataLine = readLine(fileIO, levelIO);
|
||||||
if (inputDataLine.startsWith("EMF(STRING)") == true) {
|
if (inputDataLine.startsWith("EMF(STRING)") == true) {
|
||||||
@ -82,7 +93,7 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
return; // TODO false;
|
return; // TODO false;
|
||||||
}
|
}
|
||||||
emfModuleMode currentMode = emfModuleMode.EMFModuleNone;
|
emfModuleMode currentMode = emfModuleMode.EMFModuleNone;
|
||||||
Log.verbose("Start parsing Mesh file : " + _fileName);
|
Log.verbose("Start parsing Mesh file : " + fileName);
|
||||||
// mesh global param :
|
// mesh global param :
|
||||||
String currentMeshName = "";
|
String currentMeshName = "";
|
||||||
FaceIndexing currentFaceIndexing = null;
|
FaceIndexing currentFaceIndexing = null;
|
||||||
@ -105,19 +116,28 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
}
|
}
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
// new section ...
|
// new section ...
|
||||||
if(inputDataLine.startsWith("Mesh:") == true) {
|
if (inputDataLine.startsWith("Mesh:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMesh;
|
currentMode = emfModuleMode.EMFModuleMesh;
|
||||||
currentMeshName = inputDataLine.substring(5);
|
currentMeshName = inputDataLine.substring(5);
|
||||||
|
if (filterPattern != null) {
|
||||||
|
Matcher m = filterPattern.matcher(currentMeshName);
|
||||||
|
if (!m.matches()) {
|
||||||
|
currentMode = emfModuleMode.EMFModuleSkip;
|
||||||
|
Log.verbose("Parse Mesh(SKIP): " + currentMeshName);
|
||||||
|
} else {
|
||||||
Log.verbose("Parse Mesh: " + currentMeshName);
|
Log.verbose("Parse Mesh: " + currentMeshName);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.verbose("Parse Mesh: " + currentMeshName);
|
||||||
|
}
|
||||||
offsetVertexId = this.listVertex.size();
|
offsetVertexId = this.listVertex.size();
|
||||||
offsetUV = this.listUV.size();
|
offsetUV = this.listUV.size();
|
||||||
offsetFaceNormal = this.listFacesNormal.size();
|
offsetFaceNormal = this.listFacesNormal.size();
|
||||||
offsetVertexNormal = this.listVertexNormal.size();
|
offsetVertexNormal = this.listVertexNormal.size();
|
||||||
//Log.error("new offset: " + offsetVertexId + " " + offsetUV + " " + offsetFaceNormal + " " + offsetVertexNormal);
|
//Log.error("new offset: " + offsetVertexId + " " + offsetUV + " " + offsetFaceNormal + " " + offsetVertexNormal);
|
||||||
} else if(inputDataLine.startsWith("Materials:")) {
|
} else if (inputDataLine.startsWith("Materials:")) {
|
||||||
// add previous material:
|
// add previous material:
|
||||||
if( materialName != ""
|
if (materialName != "" && material != null) {
|
||||||
&& material != null) {
|
|
||||||
if (currentMode == emfModuleMode.EMFModulePalette) {
|
if (currentMode == emfModuleMode.EMFModulePalette) {
|
||||||
this.palettes.put(materialName, material);
|
this.palettes.put(materialName, material);
|
||||||
// TODO Remove this later ...
|
// TODO Remove this later ...
|
||||||
@ -132,10 +152,9 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
material = new Material();
|
material = new Material();
|
||||||
materialName = inputDataLine.substring(10);
|
materialName = inputDataLine.substring(10);
|
||||||
Log.verbose("Parse Material: " + materialName);
|
Log.verbose("Parse Material: " + materialName);
|
||||||
} else if(inputDataLine.startsWith("Palettes:")) {
|
} else if (inputDataLine.startsWith("Palettes:")) {
|
||||||
// add previous material:
|
// add previous material:
|
||||||
if( materialName != ""
|
if (materialName != "" && material != null) {
|
||||||
&& material != null) {
|
|
||||||
if (currentMode == emfModuleMode.EMFModulePalette) {
|
if (currentMode == emfModuleMode.EMFModulePalette) {
|
||||||
this.palettes.put(materialName, material);
|
this.palettes.put(materialName, material);
|
||||||
// TODO Remove this later ...
|
// TODO Remove this later ...
|
||||||
@ -150,33 +169,37 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
material = new Material();
|
material = new Material();
|
||||||
materialName = inputDataLine.substring(9);
|
materialName = inputDataLine.substring(9);
|
||||||
Log.verbose("Parse Palette: " + materialName);
|
Log.verbose("Parse Palette: " + materialName);
|
||||||
} else if(inputDataLine.startsWith("Physics:") == true) {
|
} else if (inputDataLine.startsWith("Physics:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModulePhysics;
|
currentMode = emfModuleMode.EMFModulePhysics;
|
||||||
Log.verbose("Parse global Physics: ");
|
Log.verbose("Parse global Physics: ");
|
||||||
} else {
|
} else {
|
||||||
currentMode = emfModuleMode.EMFModuleNone;
|
currentMode = emfModuleMode.EMFModuleNone;
|
||||||
}
|
}
|
||||||
} else {
|
continue;
|
||||||
if ( currentMode.getValue() >= emfModuleMode.EMFModuleMesh.getValue()
|
}
|
||||||
&& currentMode.getValue() <= emfModuleMode.EMFModuleMesh_END.getValue()) {
|
if (currentMode == emfModuleMode.EMFModuleSkip) {
|
||||||
|
// skip the content...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (currentMode.getValue() >= emfModuleMode.EMFModuleMesh.getValue() && currentMode.getValue() <= emfModuleMode.EMFModuleMesh_END.getValue()) {
|
||||||
if (level == 1) {
|
if (level == 1) {
|
||||||
if(inputDataLine.startsWith("Vertex:") == true) {
|
if (inputDataLine.startsWith("Vertex:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshVertex;
|
currentMode = emfModuleMode.EMFModuleMeshVertex;
|
||||||
Log.verbose(" Vertex ...");
|
Log.verbose(" Vertex ...");
|
||||||
} else if(inputDataLine.startsWith("UV-mapping:") == true) {
|
} else if (inputDataLine.startsWith("UV-mapping:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshUVMapping;
|
currentMode = emfModuleMode.EMFModuleMeshUVMapping;
|
||||||
haveUVMapping = true;
|
haveUVMapping = true;
|
||||||
Log.verbose(" UV-mapping ...");
|
Log.verbose(" UV-mapping ...");
|
||||||
} else if(inputDataLine.startsWith("Normal(vertex):") == true) {
|
} else if (inputDataLine.startsWith("Normal(vertex):") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshNormalVertex;
|
currentMode = emfModuleMode.EMFModuleMeshNormalVertex;
|
||||||
Log.verbose(" Normal(vertex) ...");
|
Log.verbose(" Normal(vertex) ...");
|
||||||
} else if(inputDataLine.startsWith("Normal(face):") == true) {
|
} else if (inputDataLine.startsWith("Normal(face):") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshNormalFace;
|
currentMode = emfModuleMode.EMFModuleMeshNormalFace;
|
||||||
Log.verbose(" Normal(face) ...");
|
Log.verbose(" Normal(face) ...");
|
||||||
} else if(inputDataLine.startsWith("Face:") == true) {
|
} else if (inputDataLine.startsWith("Face:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshFace;
|
currentMode = emfModuleMode.EMFModuleMeshFace;
|
||||||
Log.verbose(" Face ...");
|
Log.verbose(" Face ...");
|
||||||
} else if(inputDataLine.startsWith("Physics:") == true) {
|
} else if (inputDataLine.startsWith("Physics:") == true) {
|
||||||
currentMode = emfModuleMode.EMFModuleMeshPhysics;
|
currentMode = emfModuleMode.EMFModuleMeshPhysics;
|
||||||
Log.verbose(" Physics ...");
|
Log.verbose(" Physics ...");
|
||||||
} else {
|
} else {
|
||||||
@ -292,88 +315,86 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if ( ( currentMode.getValue() >= emfModuleMode.EMFModuleMaterial.getValue()
|
}
|
||||||
&& currentMode.getValue() <= emfModuleMode.EMFModuleMaterial_END.getValue())
|
if ((currentMode.getValue() >= emfModuleMode.EMFModuleMaterial.getValue() && currentMode.getValue() <= emfModuleMode.EMFModuleMaterial_END.getValue())
|
||||||
|| ( currentMode.getValue() >= emfModuleMode.EMFModulePalette.getValue()
|
|| (currentMode.getValue() >= emfModuleMode.EMFModulePalette.getValue() && currentMode.getValue() <= emfModuleMode.EMFModulePalette_END.getValue())) {
|
||||||
&& currentMode.getValue() <= emfModuleMode.EMFModulePalette_END.getValue())) {
|
|
||||||
if (material == null) {
|
if (material == null) {
|
||||||
Log.error("material allocation error");
|
Log.error("material allocation error");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(inputDataLine.startsWith("Ns ") == true) {
|
if (inputDataLine.startsWith("Ns ") == true) {
|
||||||
float tmpVal=Float.valueOf(inputDataLine.substring(3));
|
float tmpVal = Float.valueOf(inputDataLine.substring(3));
|
||||||
material.setShininess(tmpVal);
|
material.setShininess(tmpVal);
|
||||||
Log.verbose(" Shininess " + tmpVal);
|
Log.verbose(" Shininess " + tmpVal);
|
||||||
} else if(inputDataLine.startsWith("Ka ") == true) {
|
} else if (inputDataLine.startsWith("Ka ") == true) {
|
||||||
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
||||||
tmp = tmp.withW(1);
|
tmp = tmp.withW(1);
|
||||||
material.setAmbientFactor(tmp);
|
material.setAmbientFactor(tmp);
|
||||||
Log.verbose(" AmbientFactor " + tmp);
|
Log.verbose(" AmbientFactor " + tmp);
|
||||||
} else if(inputDataLine.startsWith("Kd ") == true) {
|
} else if (inputDataLine.startsWith("Kd ") == true) {
|
||||||
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
||||||
tmp = tmp.withW(1);
|
tmp = tmp.withW(1);
|
||||||
material.setDiffuseFactor(tmp);
|
material.setDiffuseFactor(tmp);
|
||||||
Log.error(" DiffuseFactor " + tmp);
|
Log.error(" DiffuseFactor " + tmp);
|
||||||
} else if(inputDataLine.startsWith("Ks ") == true) {
|
} else if (inputDataLine.startsWith("Ks ") == true) {
|
||||||
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
Vector4f tmp = Vector4f.valueOf(inputDataLine.substring(3));
|
||||||
tmp = tmp.withW(1);
|
tmp = tmp.withW(1);
|
||||||
material.setSpecularFactor(tmp);
|
material.setSpecularFactor(tmp);
|
||||||
Log.verbose(" SpecularFactor " + tmp);
|
Log.verbose(" SpecularFactor " + tmp);
|
||||||
} else if(inputDataLine.startsWith("Ni ") == true) {
|
} else if (inputDataLine.startsWith("Ni ") == true) {
|
||||||
float tmpVal=Float.valueOf(inputDataLine.substring(3));
|
float tmpVal = Float.valueOf(inputDataLine.substring(3));
|
||||||
// TODO : ...
|
// TODO : ...
|
||||||
Log.verbose(" Ni " + tmpVal);
|
Log.verbose(" Ni " + tmpVal);
|
||||||
} else if(inputDataLine.startsWith("d ") == true) {
|
} else if (inputDataLine.startsWith("d ") == true) {
|
||||||
float tmpVal=Float.valueOf(inputDataLine.substring(2));
|
float tmpVal = Float.valueOf(inputDataLine.substring(2));
|
||||||
// TODO : ...
|
// TODO : ...
|
||||||
Log.verbose(" d " + tmpVal);
|
Log.verbose(" d " + tmpVal);
|
||||||
} else if(inputDataLine.startsWith("illum ") == true) {
|
} else if (inputDataLine.startsWith("illum ") == true) {
|
||||||
float tmpVal=Float.valueOf(inputDataLine.substring(6));
|
float tmpVal = Float.valueOf(inputDataLine.substring(6));
|
||||||
// TODO : ...
|
// TODO : ...
|
||||||
Log.verbose(" illum " + tmpVal);
|
Log.verbose(" illum " + tmpVal);
|
||||||
} else if(inputDataLine.startsWith("map_Kd ") == true) {
|
} else if (inputDataLine.startsWith("map_Kd ") == true) {
|
||||||
Uri tmpTexture = _fileName.getParent();
|
Uri tmpTexture = fileName.getParent();
|
||||||
tmpTexture = tmpTexture.pathAdd(inputDataLine.substring(7));
|
tmpTexture = tmpTexture.pathAdd(inputDataLine.substring(7));
|
||||||
material.setTexture0(tmpTexture);
|
material.setTexture0(tmpTexture);
|
||||||
Log.verbose(" Texture " + tmpTexture);
|
Log.verbose(" Texture " + tmpTexture);
|
||||||
} else if(inputDataLine.startsWith("renderMode ") == true) {
|
} else if (inputDataLine.startsWith("renderMode ") == true) {
|
||||||
//RenderMode mode;
|
//RenderMode mode;
|
||||||
//frothis.string(mode, &inputDataLine[11]);
|
//frothis.string(mode, &inputDataLine[11]);
|
||||||
//material.setRenderMode(mode);
|
//material.setRenderMode(mode);
|
||||||
Log.verbose(" Texture " + mode);
|
Log.verbose(" Texture " + this.mode);
|
||||||
} else {
|
} else {
|
||||||
Log.error("unknow material property ... : '" + inputDataLine + "'");
|
Log.error("unknow material property ... : '" + inputDataLine + "'");
|
||||||
}
|
}
|
||||||
} else if ( currentMode.getValue() >= emfModuleMode.EMFModulePhysics.getValue()
|
continue;
|
||||||
&& currentMode.getValue() <= emfModuleMode.EMFModulePhysics_END.getValue()) {
|
}
|
||||||
|
if (currentMode.getValue() >= emfModuleMode.EMFModulePhysics.getValue() && currentMode.getValue() <= emfModuleMode.EMFModulePhysics_END.getValue()) {
|
||||||
if (level == 1) {
|
if (level == 1) {
|
||||||
Log.error("Load shape : " + inputDataLine);
|
Log.error("Load shape : " + inputDataLine);
|
||||||
// physics = ege::physics::Shape::create(inputDataLine);
|
// physics = ege::physics::Shape::create(inputDataLine);
|
||||||
// if (physics == null) {
|
// if (physics == null) {
|
||||||
// Log.error("Allocation error when creating physical shape ...");
|
// Log.error("Allocation error when creating physical shape ...");
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// addPhysicElement(physics);
|
// addPhysicElement(physics);
|
||||||
// Log.verbose(" " + this.physics.size() + " " + inputDataLine);
|
// Log.verbose(" " + this.physics.size() + " " + inputDataLine);
|
||||||
// currentMode = emfModuleMode.EMFModulePhysicsNamed;
|
// currentMode = emfModuleMode.EMFModulePhysicsNamed;
|
||||||
} else if (currentMode == emfModuleMode.EMFModulePhysicsNamed) {
|
} else if (currentMode == emfModuleMode.EMFModulePhysicsNamed) {
|
||||||
// if (physics == null) {
|
// if (physics == null) {
|
||||||
// Log.error("Can not parse :'" + inputDataLine + "' in physical shape ...");
|
// Log.error("Can not parse :'" + inputDataLine + "' in physical shape ...");
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// if (physics.parse(&inputDataLine[0]) == false) {
|
// if (physics.parse(&inputDataLine[0]) == false) {
|
||||||
// Log.error("ERROR when parsing :'" + inputDataLine + "' in physical shape ...");
|
// Log.error("ERROR when parsing :'" + inputDataLine + "' in physical shape ...");
|
||||||
// }
|
// }
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// unknow ...
|
|
||||||
Log.warning("Unknow type of line == > jump end of line ... " + inputDataLine);
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
// unknown ...
|
||||||
|
Log.warning("Unknown type of line == > jump end of line ... " + inputDataLine);
|
||||||
}
|
}
|
||||||
// add last material ...
|
// add last material ...
|
||||||
if( materialName != ""
|
if (materialName != "" && material != null) {
|
||||||
&& material != null) {
|
|
||||||
if (currentMode == emfModuleMode.EMFModulePalette) {
|
if (currentMode == emfModuleMode.EMFModulePalette) {
|
||||||
this.palettes.put(materialName, material);
|
this.palettes.put(materialName, material);
|
||||||
// TODO Remove this later ...
|
// TODO Remove this later ...
|
||||||
@ -405,72 +426,74 @@ public ResourceMeshEmf(Uri _fileName) {
|
|||||||
Log.verbose(" nb material: " + this.materials.size());
|
Log.verbose(" nb material: " + this.materials.size());
|
||||||
Log.verbose(" nb palettes: " + this.palettes.size());
|
Log.verbose(" nb palettes: " + this.palettes.size());
|
||||||
//Log.verbose(" nb physic: " + this.physics.size());
|
//Log.verbose(" nb physic: " + this.physics.size());
|
||||||
|
if (this.listVertex.size() == 0) {
|
||||||
|
throw new Exception("unable to load the mesh file: " + fileName + " ==> no vertex available.");
|
||||||
|
}
|
||||||
generateVBO();
|
generateVBO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//private String loadNextData(int _maxData,
|
||||||
|
// BufferedReader _file) {
|
||||||
|
// return loadNextData(_maxData, _file, false, false, true);
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//private String loadNextData(int _maxData,
|
||||||
|
// BufferedReader _file,
|
||||||
|
// boolean _removeTabs,
|
||||||
|
// boolean _stopColomn,
|
||||||
|
// boolean _stopPipe) {
|
||||||
|
// StringBuffer buf = new StringBuffer();
|
||||||
|
// int outSize = 0;
|
||||||
|
// /*
|
||||||
|
// if (this.zipReadingOffset >= this.zipContent.size()) {
|
||||||
|
// element[0] = '\0';
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// */
|
||||||
|
// int current = '\0';
|
||||||
|
// try {
|
||||||
|
// current = _file.read();
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// while (current != '\0') {
|
||||||
|
// if( _removeTabs == false
|
||||||
|
// || buf.length() == 0) {
|
||||||
|
// buf.append((char)current);
|
||||||
|
// }
|
||||||
|
// if( current == '\n'
|
||||||
|
// || current == '\r'
|
||||||
|
// || ( current == '|'
|
||||||
|
// && _stopPipe == true)
|
||||||
|
// || ( current == ':'
|
||||||
|
// && _stopColomn == true) )
|
||||||
|
// {
|
||||||
|
// //Log.debug(" plop : '" + _elementLine + "'" );
|
||||||
|
// return buf.toString();
|
||||||
|
// } else if( buf.length() == 0
|
||||||
|
// && current != '\t') {
|
||||||
|
// buf.append((char)current);
|
||||||
|
// }
|
||||||
|
// // check maxData size ...
|
||||||
|
// if (outSize >= _maxData-1) {
|
||||||
|
// return buf.toString();
|
||||||
|
// }
|
||||||
|
// try {
|
||||||
|
// current = _file.read();
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (outSize != 0) {
|
||||||
|
// // send last line
|
||||||
|
// return buf.toString();
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
//}
|
||||||
|
|
||||||
//private String loadNextData(int _maxData,
|
private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
||||||
// BufferedReader _file) {
|
|
||||||
// return loadNextData(_maxData, _file, false, false, true);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//private String loadNextData(int _maxData,
|
|
||||||
// BufferedReader _file,
|
|
||||||
// boolean _removeTabs,
|
|
||||||
// boolean _stopColomn,
|
|
||||||
// boolean _stopPipe) {
|
|
||||||
// StringBuffer buf = new StringBuffer();
|
|
||||||
// int outSize = 0;
|
|
||||||
// /*
|
|
||||||
// if (this.zipReadingOffset >= this.zipContent.size()) {
|
|
||||||
// element[0] = '\0';
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// */
|
|
||||||
// int current = '\0';
|
|
||||||
// try {
|
|
||||||
// current = _file.read();
|
|
||||||
// } catch (IOException e) {
|
|
||||||
// // TODO Auto-generated catch block
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
// while (current != '\0') {
|
|
||||||
// if( _removeTabs == false
|
|
||||||
// || buf.length() == 0) {
|
|
||||||
// buf.append((char)current);
|
|
||||||
// }
|
|
||||||
// if( current == '\n'
|
|
||||||
// || current == '\r'
|
|
||||||
// || ( current == '|'
|
|
||||||
// && _stopPipe == true)
|
|
||||||
// || ( current == ':'
|
|
||||||
// && _stopColomn == true) )
|
|
||||||
// {
|
|
||||||
// //Log.debug(" plop : '" + _elementLine + "'" );
|
|
||||||
// return buf.toString();
|
|
||||||
// } else if( buf.length() == 0
|
|
||||||
// && current != '\t') {
|
|
||||||
// buf.append((char)current);
|
|
||||||
// }
|
|
||||||
// // check maxData size ...
|
|
||||||
// if (outSize >= _maxData-1) {
|
|
||||||
// return buf.toString();
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// current = _file.read();
|
|
||||||
// } catch (IOException e) {
|
|
||||||
// // TODO Auto-generated catch block
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (outSize != 0) {
|
|
||||||
// // send last line
|
|
||||||
// return buf.toString();
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
//}
|
|
||||||
|
|
||||||
private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|
||||||
level.value = 0;
|
level.value = 0;
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
boolean startLine = true;
|
boolean startLine = true;
|
||||||
@ -483,7 +506,7 @@ private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
while(current != '\0' && current != -1) {
|
while (current != '\0' && current != -1) {
|
||||||
if (current == '\r') {
|
if (current == '\r') {
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
} else if (current == '\t' && startLine) {
|
} else if (current == '\t' && startLine) {
|
||||||
@ -497,7 +520,7 @@ private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|||||||
if (current == '#') {
|
if (current == '#') {
|
||||||
// detect comment ==> remove to the end of file ==> no data availlable
|
// detect comment ==> remove to the end of file ==> no data availlable
|
||||||
if (differentThanSpace == false) {
|
if (differentThanSpace == false) {
|
||||||
while(current != '\0' && current != '\n') {
|
while (current != '\0' && current != '\n') {
|
||||||
try {
|
try {
|
||||||
current = _file.read();
|
current = _file.read();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -513,7 +536,7 @@ private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// end of data removed
|
// end of data removed
|
||||||
while(current != '\0' && current != '\n') {
|
while (current != '\0' && current != '\n') {
|
||||||
try {
|
try {
|
||||||
current = _file.read();
|
current = _file.read();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -531,11 +554,11 @@ private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|||||||
buf.append(' ');
|
buf.append(' ');
|
||||||
hasSpace = false;
|
hasSpace = false;
|
||||||
}
|
}
|
||||||
buf.append((char)current);
|
buf.append((char) current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
current=_file.read();
|
current = _file.read();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -546,6 +569,6 @@ private String readLine(BufferedReader _file, Dynamic<Integer> level) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
package org.atriasoft.loader3d.resources;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.atriasoft.etk.math.Vector3f;
|
||||||
|
import org.atriasoft.loader3d.Face;
|
||||||
|
import org.atriasoft.loader3d.FaceIndexing;
|
||||||
|
import org.atriasoft.loader3d.NormalMode;
|
||||||
|
import org.atriasoft.loader3d.model.Material;
|
||||||
|
|
||||||
|
public class ResourceMeshHeightMap extends ResourceMesh {
|
||||||
|
/*
|
||||||
|
* 0 1 2 3
|
||||||
|
* 0 *-------*-------*-------*
|
||||||
|
* \ OO / \ 02 / \ 04 / \
|
||||||
|
* \ / \ / \ / \
|
||||||
|
* \ / 01 \ / 03 \ / 05 \
|
||||||
|
* *-------*-------*-------*
|
||||||
|
* / \ / \ / \ /
|
||||||
|
* / \ / \ / \ /
|
||||||
|
* / \ / \ / \ /
|
||||||
|
* *-------*-------*-------*
|
||||||
|
*/
|
||||||
|
public ResourceMeshHeightMap() {
|
||||||
|
this.normalMode = NormalMode.FACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void addPalette(String key, Material mat) {
|
||||||
|
this.palettes.put(key, mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Material> getPalette() {
|
||||||
|
return this.palettes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void udateData(float[][] heightMap, String[][] colorMap, int width, int length) throws Exception {
|
||||||
|
float ratio = 0.2f;
|
||||||
|
for (int yyy = 0; yyy < length - 1; yyy++) {
|
||||||
|
for (int xxx = 0; xxx < width - 1; xxx++) {
|
||||||
|
Vector3f vertex1 = new Vector3f(ratio * xxx, ratio * yyy, ratio * heightMap[yyy][xxx]);
|
||||||
|
this.listVertex.add(vertex1);
|
||||||
|
Vector3f vertex2 = new Vector3f(ratio * (xxx + 1), ratio * yyy, ratio * heightMap[yyy][xxx + 1]);
|
||||||
|
this.listVertex.add(vertex2);
|
||||||
|
Vector3f vertex3 = new Vector3f(ratio * xxx, ratio * (yyy + 1), ratio * heightMap[yyy + 1][xxx]);
|
||||||
|
this.listVertex.add(vertex3);
|
||||||
|
FaceIndexing currentFaceIndexing = null;
|
||||||
|
String meshFaceMaterialID = colorMap[yyy][xxx * 2];
|
||||||
|
if (this.listPaletteFaces.containsKey(meshFaceMaterialID) == false) {
|
||||||
|
currentFaceIndexing = new FaceIndexing();
|
||||||
|
this.listPaletteFaces.put(meshFaceMaterialID, currentFaceIndexing);
|
||||||
|
} else {
|
||||||
|
currentFaceIndexing = this.listPaletteFaces.get(meshFaceMaterialID);
|
||||||
|
}
|
||||||
|
Face face = new Face();
|
||||||
|
int pos = this.listVertex.size() - 3;
|
||||||
|
face.setVertex(pos, pos + 1, pos + 2);
|
||||||
|
|
||||||
|
currentFaceIndexing.face().add(face);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
generateVBO();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -5,10 +5,10 @@ import org.atriasoft.gale.resource.Resource;
|
|||||||
import org.atriasoft.gale.resource.ResourceVirtualArrayObject;
|
import org.atriasoft.gale.resource.ResourceVirtualArrayObject;
|
||||||
import org.atriasoft.loader3d.internal.Log;
|
import org.atriasoft.loader3d.internal.Log;
|
||||||
|
|
||||||
public class ResourceStaticMeshObjBynamic extends ResourceStaticMeshObj {
|
public class ResourceStaticMeshObjDynamic extends ResourceStaticMeshObj {
|
||||||
|
|
||||||
public static ResourceStaticMeshObjBynamic create(final Uri uriObj) {
|
public static ResourceStaticMeshObjDynamic create(final Uri uriObj) {
|
||||||
ResourceStaticMeshObjBynamic resource;
|
ResourceStaticMeshObjDynamic resource;
|
||||||
Resource resource2;
|
Resource resource2;
|
||||||
final String name = uriObj.getValue();
|
final String name = uriObj.getValue();
|
||||||
if (name.isEmpty() || name.equals("---")) {
|
if (name.isEmpty() || name.equals("---")) {
|
||||||
@ -17,19 +17,19 @@ public class ResourceStaticMeshObjBynamic extends ResourceStaticMeshObj {
|
|||||||
}
|
}
|
||||||
resource2 = Resource.getManager().localKeep(name);
|
resource2 = Resource.getManager().localKeep(name);
|
||||||
if (resource2 != null) {
|
if (resource2 != null) {
|
||||||
if (resource2 instanceof ResourceStaticMeshObjBynamic tmpp) {
|
if (resource2 instanceof ResourceStaticMeshObjDynamic tmpp) {
|
||||||
resource2.keep();
|
resource2.keep();
|
||||||
return tmpp;
|
return tmpp;
|
||||||
}
|
}
|
||||||
Log.critical("Request resource file : '" + name + "' With the wrong type (dynamic cast error)");
|
Log.critical("Request resource file : '" + name + "' With the wrong type (dynamic cast error)");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
resource = new ResourceStaticMeshObjBynamic(uriObj);
|
resource = new ResourceStaticMeshObjDynamic(uriObj);
|
||||||
Resource.getManager().localAdd(resource);
|
Resource.getManager().localAdd(resource);
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ResourceStaticMeshObjBynamic(final Uri uriFile) {
|
protected ResourceStaticMeshObjDynamic(final Uri uriFile) {
|
||||||
super(uriFile);
|
super(uriFile);
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
|||||||
import org.atriasoft.etk.Uri;
|
import org.atriasoft.etk.Uri;
|
||||||
import org.atriasoft.gale.Gale;
|
import org.atriasoft.gale.Gale;
|
||||||
import org.atriasoft.gale.context.GaleContextTest;
|
import org.atriasoft.gale.context.GaleContextTest;
|
||||||
import org.atriasoft.loader3d.resources.ResourceMeshEmf;
|
import org.atriasoft.loader3d.resources.ResourceMeshHeightMap;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
@ -27,10 +27,10 @@ public class TestBasicLog {
|
|||||||
GaleContextTest tmpContext = new GaleContextTest();
|
GaleContextTest tmpContext = new GaleContextTest();
|
||||||
Uri.setGroup("EMF", "emf");
|
Uri.setGroup("EMF", "emf");
|
||||||
Uri.setApplication(TestBasicLog.class, "");
|
Uri.setApplication(TestBasicLog.class, "");
|
||||||
Uri.addLibrary("test", ResourceMeshEmf.class, "/resources");
|
Uri.addLibrary("test", ResourceMeshHeightMap.class, "/resources");
|
||||||
|
|
||||||
//ResourceMeshEmf tmp = new ResourceMeshEmf(new Uri("EMF", "tree1.emf", "test"));
|
//ResourceMeshEmf tmp = new ResourceMeshEmf(new Uri("EMF", "tree1.emf", "test"));
|
||||||
ResourceMeshEmf tmp = new ResourceMeshEmf(new Uri("FILE", "/home/heero/dev/workspace-game/atriasoft/loader3d/out/eclipse/classes/resources/emf/tree1.emf"));
|
ResourceMeshHeightMap tmp = new ResourceMeshHeightMap(new Uri("FILE", "/home/heero/dev/workspace-game/atriasoft/loader3d/out/eclipse/classes/resources/emf/tree1.emf"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user