diff --git a/data/material3D.vert b/data/material3D.vert index e99656a..2856451 100644 --- a/data/material3D.vert +++ b/data/material3D.vert @@ -14,8 +14,10 @@ varying vec3 v_ecNormal; void main(void) { gl_Position = EW_MatrixTransformation * EW_MatrixPosition * vec4(EW_coord3d, 1.0); mat4 MatrixPosition = EW_MatrixPosition; + /* MatrixPosition[3][0] = 0.0; MatrixPosition[3][1] = 0.0; MatrixPosition[3][2] = 0.0; + */ v_ecNormal = vec3(MatrixPosition * vec4(EW_normal, 1.0) ); } diff --git a/ege/CollisionShapeCreator.cpp b/ege/CollisionShapeCreator.cpp index c8cb7d8..d2174cd 100644 --- a/ege/CollisionShapeCreator.cpp +++ b/ege/CollisionShapeCreator.cpp @@ -67,6 +67,8 @@ btCollisionShape* ege::collision::createShape(const ememory::SharedPtrgetOrigin()); outputShape->addChildShape(localTransform, tmpShape); } + } else { + EGE_ERROR("Allocation shape error BOX"); } break; } diff --git a/ege/resource/Mesh.cpp b/ege/resource/Mesh.cpp index b1556e2..5fce898 100644 --- a/ege/resource/Mesh.cpp +++ b/ege/resource/Mesh.cpp @@ -102,7 +102,7 @@ void ege::resource::Mesh::clean() { } -#define DISPLAY_NB_VERTEX_DISPLAYED +//#define DISPLAY_NB_VERTEX_DISPLAYED void ege::resource::Mesh::draw(mat4& _positionMatrix, bool _enableDepthTest, @@ -223,9 +223,9 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, EGE_ERROR(" !!!! No Face to display elements [" << m_name << "]"); } else { if (nbElementDrawTheoric != 0) { - EGE_DEBUG(((float)nbElementDraw/(float)nbElementDrawTheoric*100.0f) << "% Request draw : " << m_listFaces.size() << ":" << nbElementDraw << "/" << nbElementDrawTheoric << " elements [" << m_name << "]"); + EGE_WARNING(((float)nbElementDraw/(float)nbElementDrawTheoric*100.0f) << "% Request draw : " << m_listFaces.size() << ":" << nbElementDraw << "/" << nbElementDrawTheoric << " elements [" << m_name << "]"); } else { - EGE_DEBUG("0% Request draw : " << m_listFaces.size() << ":" << nbElementDraw << "/" << nbElementDrawTheoric << " elements [" << m_name << "]"); + EGE_WARNING("0% Request draw : " << m_listFaces.size() << ":" << nbElementDraw << "/" << nbElementDrawTheoric << " elements [" << m_name << "]"); } } #endif diff --git a/ege/resource/MeshEmf.cpp b/ege/resource/MeshEmf.cpp index b4c7fde..6b8cd77 100644 --- a/ege/resource/MeshEmf.cpp +++ b/ege/resource/MeshEmf.cpp @@ -197,7 +197,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { offsetUV = m_listUV.size(); offsetFaceNormal = m_listFacesNormal.size(); offsetVertexNormal = m_listVertexNormal.size(); - + //EGE_ERROR("new offset: " << offsetVertexId << " " << offsetUV << " " << offsetFaceNormal << " " << offsetVertexNormal); } else if(strncmp(inputDataLine, "Materials:", 9) == 0) { currentMode = EMFModuleMaterial; // add previous material: @@ -344,7 +344,9 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { // new maretial selection currentMode = EMFModuleMeshFaceMaterial; FaceIndexing empty; - m_listFaces.add(inputDataLine, empty); + if (m_listFaces.exist(inputDataLine) == false) { + m_listFaces.add(inputDataLine, empty); + } meshFaceMaterialID = m_listFaces.getId(inputDataLine); EGE_VERBOSE(" " << inputDataLine); } else if (currentMode == EMFModuleMeshFaceMaterial) { @@ -564,6 +566,17 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { EGE_VERBOSE("Stop parsing Mesh file"); fileName.fileClose(); + + EGE_VERBOSE("New mesh : "); + EGE_VERBOSE(" nb vertex: " << m_listVertex.size()); + EGE_VERBOSE(" nb UV: " << m_listUV.size()); + EGE_VERBOSE(" nb Colors: " << m_listColor.size()); + EGE_VERBOSE(" nb Normal Face: " << m_listFacesNormal.size()); + EGE_VERBOSE(" nb vertex Face: " << m_listVertexNormal.size()); + EGE_VERBOSE(" nb Faces: " << m_listFaces.size()); + EGE_VERBOSE(" nb material: " << m_materials.size()); + EGE_VERBOSE(" nb physic: " << m_physics.size()); generateVBO(); + return true; } \ No newline at end of file diff --git a/sample/LowPoly/appl/Windows.cpp b/sample/LowPoly/appl/Windows.cpp index eecec6e..6d4b5da 100644 --- a/sample/LowPoly/appl/Windows.cpp +++ b/sample/LowPoly/appl/Windows.cpp @@ -79,7 +79,7 @@ namespace appl { } void onLifeChange() { - APPL_DEBUG("Looze life " << m_life); + APPL_DEBUG("Loose life " << m_life); } }; } diff --git a/sample/LowPoly/data/tree_1.emf b/sample/LowPoly/data/tree_1.emf index 68aff57..3259fe8 100644 --- a/sample/LowPoly/data/tree_1.emf +++ b/sample/LowPoly/data/tree_1.emf @@ -20,6 +20,9 @@ Physics: Box half-extents:0.567449 1.48439 0.565881 origin:0.0233975 1.08701 0.559573 + Sphere + radius:0.27172986930174403 + origin:1.67238 -1.15006 2.6986 Mesh:wheel_1_rear_right Vertex:59 -0.490127 0.129425 -3.755534|-0.285279 0.193374 -2.020798|-0.285279 0.193374 -2.223388|-0.510380 0.193374 -2.223388|-0.285279 0.281275 -2.203326|-0.510380 0.281275 -2.203326|-0.285279 0.351766 -2.147111|-0.510380 0.351766 -2.147111|-0.285279 0.390886 -2.065878|-0.510380 0.390886 -2.065878|-0.285279 0.390886 -1.975717|-0.510380 0.390886 -1.975717|-0.285279 0.351766 -1.894485|-0.510380 0.351766 -1.894485|-0.285279 0.281275 -1.838270|-0.510380 0.281275 -1.838270|-0.285279 0.193374 -1.818207|-0.510380 0.193374 -1.818207|-0.285279 0.105474 -1.838270|-0.510380 0.105474 -1.838270|-0.285279 0.034983 -1.894484|-0.510380 0.034983 -1.894484|-0.285279 -0.004137 -1.975717|-0.510380 -0.004137 -1.975717|-0.285279 -0.004137 -2.065878|-0.510380 -0.004137 -2.065878|-0.285279 0.034983 -2.147111|-0.510380 0.034983 -2.147111|-0.285279 0.105474 -2.203326|-0.510380 0.105474 -2.203326|-0.510811 0.193374 -2.165229|-0.510811 0.257918 -2.150926|-0.510811 0.309678 -2.110849|-0.510811 0.338403 -2.052937|-0.510811 0.338403 -1.988659|-0.510811 0.309678 -1.930746|-0.510811 0.257918 -1.890669|-0.510811 0.193374 -1.876366|-0.510811 0.128831 -1.890669|-0.510811 0.077070 -1.930746|-0.510811 0.048346 -1.988659|-0.510811 0.048346 -2.052937|-0.510811 0.077070 -2.110849|-0.510811 0.128831 -2.150926|-0.486623 0.193374 -2.020798|-0.486623 0.193374 -2.165229|-0.486623 0.257918 -2.150926|-0.486623 0.309678 -2.110849|-0.486623 0.338403 -2.052937|-0.486623 0.338403 -1.988659|-0.486623 0.309678 -1.930746|-0.486623 0.257918 -1.890669|-0.486623 0.193374 -1.876366|-0.486623 0.128831 -1.890669|-0.486623 0.077070 -1.930746|-0.486623 0.048346 -1.988659|-0.486623 0.048346 -2.052937|-0.486623 0.077070 -2.110849|-0.486623 0.128831 -2.150926|