[DEV] commit all with new insland
This commit is contained in:
parent
57c759c0f7
commit
343934129a
43
.gitignore
vendored
Normal file
43
.gitignore
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# ---> Java
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
*.class
|
||||||
|
*~
|
||||||
|
*.bck
|
||||||
|
build.number
|
||||||
|
/extern/
|
||||||
|
/out/
|
||||||
|
/.settings/
|
||||||
|
/junit/
|
||||||
|
/target/
|
||||||
|
/__pycache__/
|
||||||
|
|
||||||
|
|
||||||
|
*.pdfd
|
||||||
|
*.dbc
|
||||||
|
SchedulerConfig.txt
|
||||||
|
scenicView.properties
|
||||||
|
ScenariumConfig.txt
|
||||||
|
*.blend*
|
2
out/.gitignore
vendored
2
out/.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
|
|
||||||
|
/__pycache__/
|
||||||
/eclipse/
|
/eclipse/
|
||||||
|
@ -195,6 +195,20 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
this.listFaces.get(_layerName).face().add(tmpFace);
|
this.listFaces.get(_layerName).face().add(tmpFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @not_in_doc
|
||||||
|
* @brief draw a colored quad (usefull for debug and test)
|
||||||
|
* @param _layerName Material and face indexing layer name
|
||||||
|
* @param _pos1 First point position
|
||||||
|
* @param _pos2 Second point position
|
||||||
|
* @param _pos3 Third point position
|
||||||
|
* @param _pos4 faurth point position
|
||||||
|
* @param _color color of all elements
|
||||||
|
*/
|
||||||
|
public void addQuad(final String _layerName, final Vector3f _pos1, final Vector3f _pos2, final Vector3f _pos3, final Vector3f _pos4, final Color _color) {
|
||||||
|
addQuad(_layerName, _pos1, _pos2, _pos3, _pos4, _color, _color, _color, _color);
|
||||||
|
}
|
||||||
|
|
||||||
// public void draw(Matrix4f _positionMatrix) {
|
// public void draw(Matrix4f _positionMatrix) {
|
||||||
// draw(_positionMatrix, true, true);
|
// draw(_positionMatrix, true, true);
|
||||||
// }
|
// }
|
||||||
@ -326,20 +340,6 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
// Log.verbose("draw Mesh : " + this.name + " ( end )");
|
// Log.verbose("draw Mesh : " + this.name + " ( end )");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
|
||||||
* @not_in_doc
|
|
||||||
* @brief draw a colored quad (usefull for debug and test)
|
|
||||||
* @param _layerName Material and face indexing layer name
|
|
||||||
* @param _pos1 First point position
|
|
||||||
* @param _pos2 Second point position
|
|
||||||
* @param _pos3 Third point position
|
|
||||||
* @param _pos4 faurth point position
|
|
||||||
* @param _color color of all elements
|
|
||||||
*/
|
|
||||||
public void addQuad(final String _layerName, final Vector3f _pos1, final Vector3f _pos2, final Vector3f _pos3, final Vector3f _pos4, final Color _color) {
|
|
||||||
addQuad(_layerName, _pos1, _pos2, _pos3, _pos4, _color, _color, _color, _color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @not_in_doc
|
* @not_in_doc
|
||||||
* @brief draw a colored quad (usefull for debug and test)
|
* @brief draw a colored quad (usefull for debug and test)
|
||||||
@ -459,6 +459,10 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addTriangle(final String _layerName, final Vector3f _pos1, final Vector3f _pos2, final Vector3f _pos3, final Vector2f _uv1, final Vector2f _uv2, final Vector2f _uv3) {
|
||||||
|
addTriangle(_layerName, _pos1, _pos2, _pos3, _uv1, _uv2, _uv3, Color.WHITE, Color.WHITE, Color.WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
// public List<ege::physics::Shape> getPhysicalProperties() {
|
// public List<ege::physics::Shape> getPhysicalProperties() {
|
||||||
// for (auto it: this.physics) {
|
// for (auto it: this.physics) {
|
||||||
// if (it == null) {
|
// if (it == null) {
|
||||||
@ -495,10 +499,6 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
// return this.physics;
|
// return this.physics;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public void addTriangle(final String _layerName, final Vector3f _pos1, final Vector3f _pos2, final Vector3f _pos3, final Vector2f _uv1, final Vector2f _uv2, final Vector2f _uv3) {
|
|
||||||
addTriangle(_layerName, _pos1, _pos2, _pos3, _uv1, _uv2, _uv3, Color.WHITE, Color.WHITE, Color.WHITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @not_in_doc
|
* @not_in_doc
|
||||||
* @brief draw a textured colored triangle (usefull for debug and test)
|
* @brief draw a textured colored triangle (usefull for debug and test)
|
||||||
@ -630,6 +630,14 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void calculateNormaleFaces(final List<String> materialsNames) {
|
||||||
|
this.listFacesNormal.clear();
|
||||||
|
for (String name : materialsNames) {
|
||||||
|
Log.warning("generate normal for: '" + name + "'");
|
||||||
|
calculateNormaleFaceLocal(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// public void createViewBox( String _materialName,float _size=1.0){
|
// public void createViewBox( String _materialName,float _size=1.0){
|
||||||
// this.normalMode = NormalMode.NONE;
|
// this.normalMode = NormalMode.NONE;
|
||||||
// ege::viewBox::create(this.materials, this.listFaces, this.listVertex, this.listUV,
|
// ege::viewBox::create(this.materials, this.listFaces, this.listVertex, this.listUV,
|
||||||
@ -646,14 +654,6 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
//private boolean loadOBJ( Uri _fileName);
|
//private boolean loadOBJ( Uri _fileName);
|
||||||
//private boolean loadEMF( Uri _fileName);
|
//private boolean loadEMF( Uri _fileName);
|
||||||
|
|
||||||
protected void calculateNormaleFaces(final List<String> materialsNames) {
|
|
||||||
this.listFacesNormal.clear();
|
|
||||||
for (String name : materialsNames) {
|
|
||||||
Log.warning("generate normal for: '" + name + "'");
|
|
||||||
calculateNormaleFaceLocal(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void clean() {
|
void clean() {
|
||||||
//this.physics.clear();
|
//this.physics.clear();
|
||||||
this.materials.clear();
|
this.materials.clear();
|
||||||
@ -678,6 +678,23 @@ public class ResourceMesh extends ResourceStaticMesh {
|
|||||||
this.vao = ResourceVirtualArrayObject.createDynamic();
|
this.vao = ResourceVirtualArrayObject.createDynamic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearData() {
|
||||||
|
this.listVertex = new ArrayList<>(); //!< List of all vertex in the element
|
||||||
|
this.listUV = new ArrayList<>(); //!< List of all UV point in the mesh (for the specify texture)
|
||||||
|
this.listColor = new ArrayList<>(); //!< List of all Color point in the mesh
|
||||||
|
this.listFacesNormal = new ArrayList<>(); //!< List of all Face normal, when calculated
|
||||||
|
this.listVertexNormal = new ArrayList<>(); //!< List of all Face normal, when calculated
|
||||||
|
this.listFaces = new HashMap<>(); //!< List of all Face for the mesh
|
||||||
|
this.listFacesDrawIndex = new HashMap<>(); //!< List of all Face for the mesh
|
||||||
|
this.listPaletteFaces = new HashMap<>(); //!< List of all Face for the mesh
|
||||||
|
this.materials = new HashMap<>();
|
||||||
|
this.palettes = new HashMap<>(); // this is for information when we use external palette
|
||||||
|
this.normalMode = NormalMode.NONE;
|
||||||
|
this.mode = RenderMode.QUAD_STRIP;
|
||||||
|
this.checkNormal = false;
|
||||||
|
this.outPosition = null;
|
||||||
|
}
|
||||||
|
|
||||||
protected int findColorInList(final Color _color) {
|
protected int findColorInList(final Color _color) {
|
||||||
for (int iii = 0; iii < this.listColor.size(); ++iii) {
|
for (int iii = 0; iii < this.listColor.size(); ++iii) {
|
||||||
if (this.listColor.get(iii) == _color) {
|
if (this.listColor.get(iii) == _color) {
|
||||||
|
@ -124,7 +124,7 @@ public class ResourceMeshHeightMap extends ResourceMesh {
|
|||||||
int pos = this.listVertex.size();
|
int pos = this.listVertex.size();
|
||||||
Vector3f vertex1 = new Vector3f(ratio * (xxx + 1), ratio * (yyy + 1), ratio * heightMap[yyy + 1][xxx + 1]);
|
Vector3f vertex1 = new Vector3f(ratio * (xxx + 1), ratio * (yyy + 1), ratio * heightMap[yyy + 1][xxx + 1]);
|
||||||
this.listVertex.add(vertex1);
|
this.listVertex.add(vertex1);
|
||||||
Vector3f vertex2 = new Vector3f(ratio * (xxx), ratio * (yyy + 1 + offsetA), ratio * heightMap[yyy + 1][xxx + 1]);
|
Vector3f vertex2 = new Vector3f(ratio * (xxx), ratio * (yyy + 1 + offsetA), ratio * heightMap[yyy + 1][xxx]);
|
||||||
this.listVertex.add(vertex2);
|
this.listVertex.add(vertex2);
|
||||||
Vector3f vertex3 = new Vector3f(ratio * xxx, ratio * (yyy + offsetA), ratio * heightMap[yyy][xxx]);
|
Vector3f vertex3 = new Vector3f(ratio * xxx, ratio * (yyy + offsetA), ratio * heightMap[yyy][xxx]);
|
||||||
this.listVertex.add(vertex3);
|
this.listVertex.add(vertex3);
|
||||||
|
@ -8,18 +8,18 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package test.atriasoft.loader3d;
|
package test.atriasoft.loader3d;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
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.ResourceMeshHeightMap;
|
import org.atriasoft.loader3d.resources.ResourceMeshHeightMap;
|
||||||
|
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
@TestMethodOrder(OrderAnnotation.class)
|
@TestMethodOrder(OrderAnnotation.class)
|
||||||
public class TestBasicLog {
|
public class TestBasicLog {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Order(1)
|
@Order(1)
|
||||||
public void aaFirstInitialisation() {
|
public void aaFirstInitialisation() {
|
||||||
@ -30,8 +30,8 @@ public class TestBasicLog {
|
|||||||
Uri.addLibrary("test", ResourceMeshHeightMap.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"));
|
||||||
ResourceMeshHeightMap tmp = new ResourceMeshHeightMap(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