diff --git a/include/Engine/Rendering/DebugCameraInputController.h b/include/Engine/Rendering/DebugCameraInputController.h
index d69098c2..4d74e288 100644
--- a/include/Engine/Rendering/DebugCameraInputController.h
+++ b/include/Engine/Rendering/DebugCameraInputController.h
@@ -61,6 +61,6 @@ public:
protected:
glm::vec3 m_Position = glm::vec3(0, 0, 0);
glm::vec3 m_Velocity = glm::vec3(0, 0, 0);
- float m_BaseSpeed = 50.0f;//2.0f;
+ float m_BaseSpeed = 2.0f;
float m_Speed = m_BaseSpeed;
};
\ No newline at end of file
diff --git a/resources/Schema/Entities/CollisionTestLevel.xml b/resources/Schema/Entities/CollisionTestLevel.xml
index d5e932c2..e58ab6ce 100644
--- a/resources/Schema/Entities/CollisionTestLevel.xml
+++ b/resources/Schema/Entities/CollisionTestLevel.xml
@@ -6,7 +6,7 @@
- Models/DummyScene.obj
+ Models/DummyScene.mesh
@@ -17,7 +17,7 @@
- Models/Core/UnitSphere.obj
+ Models/Core/UnitSphere.mesh
@@ -28,7 +28,7 @@
- Models/RotationWidgetX.obj
+ Models/RotationWidgetX.mesh
@@ -43,7 +43,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -69,7 +69,7 @@
- Models/Core/UnitRaptor.obj
+ Models/Core/UnitRaptor.mesh
@@ -94,7 +94,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -107,7 +107,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
diff --git a/resources/Schema/Entities/EditorTestWorld.xml b/resources/Schema/Entities/EditorTestWorld.xml
index 2e95d626..5649a630 100755
--- a/resources/Schema/Entities/EditorTestWorld.xml
+++ b/resources/Schema/Entities/EditorTestWorld.xml
@@ -9,7 +9,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -58,7 +58,7 @@
- Models/DirectionalLightWidget.obj
+ Models/DirectionalLightWidget.mesh
@@ -70,7 +70,7 @@
- Models/Assault.obj
+ Models/Assault.mesh
@@ -94,7 +94,7 @@
- Models/Core/UnitSphere.obj
+ Models/Core/UnitSphere.mesh
diff --git a/resources/Schema/Entities/MovementTest.xml b/resources/Schema/Entities/MovementTest.xml
index 93b4d374..dc271908 100644
--- a/resources/Schema/Entities/MovementTest.xml
+++ b/resources/Schema/Entities/MovementTest.xml
@@ -18,7 +18,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -37,7 +37,7 @@
- Models/Assault.obj
+ Models/Assault.mesh
@@ -55,7 +55,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
diff --git a/resources/Schema/Entities/OctreeTest.xml b/resources/Schema/Entities/OctreeTest.xml
index 4d7fe709..a510a98c 100644
--- a/resources/Schema/Entities/OctreeTest.xml
+++ b/resources/Schema/Entities/OctreeTest.xml
@@ -11,7 +11,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -27,7 +27,7 @@
false
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -42,7 +42,7 @@
false
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml
index 6c3b39c3..485c6cff 100644
--- a/resources/Schema/Entities/Player.xml
+++ b/resources/Schema/Entities/Player.xml
@@ -6,7 +6,7 @@
- Models/Core/UnitSphere.obj
+ Models/Core/UnitSphere.mesh
diff --git a/resources/Schema/Entities/RaptorCopter.xml b/resources/Schema/Entities/RaptorCopter.xml
index 0ee62368..82aa0efa 100644
--- a/resources/Schema/Entities/RaptorCopter.xml
+++ b/resources/Schema/Entities/RaptorCopter.xml
@@ -7,7 +7,7 @@
- Models/Core/UnitRaptor.obj
+ Models/Core/UnitRaptor.mesh
@@ -31,7 +31,7 @@
- Models/Core/UnitCylinder.obj
+ Models/Core/UnitCylinder.mesh
@@ -44,7 +44,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
@@ -57,7 +57,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
diff --git a/resources/Schema/Entities/RenderingWorld.xml b/resources/Schema/Entities/RenderingWorld.xml
index 86a3090a..67ddd046 100644
--- a/resources/Schema/Entities/RenderingWorld.xml
+++ b/resources/Schema/Entities/RenderingWorld.xml
@@ -13,7 +13,7 @@
- Models/Camera.obj
+ Models/Camera.mesh
MainCamera
@@ -26,7 +26,7 @@
- Models/Camera.obj
+ Models/Camera.mesh
ActionCamera
@@ -40,7 +40,7 @@
- Models/Core/UnitPlane.obj
+ Models/Core/UnitPlane.mesh
diff --git a/resources/Schema/Entities/SoundTestLevel.xml b/resources/Schema/Entities/SoundTestLevel.xml
index 366ae81b..4e9c3093 100644
--- a/resources/Schema/Entities/SoundTestLevel.xml
+++ b/resources/Schema/Entities/SoundTestLevel.xml
@@ -12,7 +12,7 @@
- Models/Core/UnitCube.obj
+ Models/Core/UnitCube.mesh
diff --git a/resources/Schema/Entities/SpawnTest.xml b/resources/Schema/Entities/SpawnTest.xml
index a5574027..16608b47 100644
--- a/resources/Schema/Entities/SpawnTest.xml
+++ b/resources/Schema/Entities/SpawnTest.xml
@@ -24,7 +24,7 @@
- Models/Core/UnitSphere.obj
+ Models/Core/UnitSphere.mesh
@@ -37,7 +37,7 @@
- Models/Core/UnitSphere.obj
+ Models/Core/UnitSphere.mesh
diff --git a/resources/Shaders/ForwardPlus.vert.glsl b/resources/Shaders/ForwardPlus.vert.glsl
index aa8c9446..cb5f41b3 100644
--- a/resources/Shaders/ForwardPlus.vert.glsl
+++ b/resources/Shaders/ForwardPlus.vert.glsl
@@ -24,10 +24,12 @@ void main()
mat4 boneTransform = mat4(1);
+ if(BoneWeights[0] > 0.f){
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
+ }
gl_Position = P*V*M*boneTransform * vec4(Position, 1.0);
diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp
index 46aad8df..e60890b6 100644
--- a/src/Engine/Editor/EditorSystem.cpp
+++ b/src/Engine/Editor/EditorSystem.cpp
@@ -295,7 +295,7 @@ void EditorSystem::createWidget()
#ifdef USING_ASSIMP_AS_IMPORTER
m_World->GetComponent(m_WidgetPlaneX, "Model")["Resource"] = "Models/WidgetPlaneZ.obj"; // 360NoScope widgetPlaneX
#else
- m_World->GetComponent(m_WidgetPlaneX, "Model")["Resource"] = "Models/coolCube.mesh"; // 360NoScope widgetPlaneX
+ m_World->GetComponent(m_WidgetPlaneX, "Model")["Resource"] = "Models/WidgetPlaneZ.mesh";
#endif
m_WidgetY = m_World->CreateEntity(m_Widget);
m_World->AttachComponent(m_WidgetY, "Transform");
@@ -306,7 +306,7 @@ void EditorSystem::createWidget()
#ifdef USING_ASSIMP_AS_IMPORTER
m_World->GetComponent(m_WidgetPlaneY, "Model")["Resource"] = "Models/WidgetPlaneZ.obj"; // 360NoScope widgetPlaneY
#else
- m_World->GetComponent(m_WidgetPlaneY, "Model")["Resource"] = "Models/coolCube.mesh"; // 360NoScope widgetPlaneY
+ m_World->GetComponent(m_WidgetPlaneY, "Model")["Resource"] = "Models/WidgetPlaneZ.mesh";
#endif
m_WidgetZ = m_World->CreateEntity(m_Widget);
m_World->AttachComponent(m_WidgetZ, "Transform");
@@ -317,7 +317,7 @@ void EditorSystem::createWidget()
#ifdef USING_ASSIMP_AS_IMPORTER
m_World->GetComponent(m_WidgetPlaneZ, "Model")["Resource"] = "Models/WidgetPlaneZ.obj"; // 360NoScope widgetPlaneZ
#else
- m_World->GetComponent(m_WidgetPlaneZ, "Model")["Resource"] = "Models/coolCube.mesh"; // 360NoScope widgetPlaneZ
+ m_World->GetComponent(m_WidgetPlaneZ, "Model")["Resource"] = "Models/WidgetPlaneZ.mesh";
#endif
m_WidgetOrigin = m_World->CreateEntity(m_Widget);
m_World->AttachComponent(m_WidgetOrigin, "Transform");
@@ -363,9 +363,9 @@ void EditorSystem::setWidgetMode(WidgetMode newMode)
m_World->GetComponent(m_WidgetOrigin, "Model")["Visible"] = false;
if (newMode == WidgetMode::Translate) {
- //m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/TranslationWidgetX.obj"; // 360NoScope TranslationWidgets mesh
- //m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/TranslationWidgetY.obj";
- //m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/TranslationWidgetZ.obj";
+ m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/TranslationWidgetX.mesh";
+ m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/TranslationWidgetY.mesh";
+ m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/TranslationWidgetZ.mesh";
// Temporarily disabled for local space until I can figure out what's wrong with the math
if (m_WidgetSpace != WidgetSpace::Local) {
m_World->GetComponent(m_WidgetPlaneX, "Model")["Visible"] = true;
@@ -379,19 +379,19 @@ void EditorSystem::setWidgetMode(WidgetMode newMode)
}
}
} else if (newMode == WidgetMode::Scale) {
- //m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/ScaleWidgetX.obj"; // 360NoScope ScaleWidgets mesh
- //m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/ScaleWidgetY.obj";
- //m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/ScaleWidgetZ.obj";
+ m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/ScaleWidgetX.mesh";
+ m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/ScaleWidgetY.mesh";
+ m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/ScaleWidgetZ.mesh";
m_World->GetComponent(m_WidgetOrigin, "Model")["Visible"] = true;
- //m_World->GetComponent(m_WidgetOrigin, "Model")["Resource"] = "Models/ScaleWidgetOrigin.obj"; // 360NoScope ScaleWidgetOrigin mesh
+ m_World->GetComponent(m_WidgetOrigin, "Model")["Resource"] = "Models/ScaleWidgetOrigin.mesh";
if (m_Selection != EntityID_Invalid) {
auto selectionTransform = m_World->GetComponent(m_Selection, "Transform");
widgetTransform["Orientation"] = glm::eulerAngles(Transform::AbsoluteOrientation(m_World, m_Selection));
}
} else if (newMode == WidgetMode::Rotate) {
- //m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/RotationWidgetX.obj"; // 360NoScope RotationWidget mesh
- //m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/RotationWidgetY.obj";
- //m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/RotationWidgetZ.obj";
+ m_World->GetComponent(m_WidgetX, "Model")["Resource"] = "Models/RotationWidgetX.mesh";
+ m_World->GetComponent(m_WidgetY, "Model")["Resource"] = "Models/RotationWidgetY.mesh";
+ m_World->GetComponent(m_WidgetZ, "Model")["Resource"] = "Models/RotationWidgetZ.mesh";
if (m_Selection != EntityID_Invalid) {
auto selectionTransform = m_World->GetComponent(m_Selection, "Transform");
if (m_WidgetSpace == WidgetSpace::Local) {
diff --git a/src/Engine/Network/Client.cpp b/src/Engine/Network/Client.cpp
index efd25120..162ccfd6 100644
--- a/src/Engine/Network/Client.cpp
+++ b/src/Engine/Network/Client.cpp
@@ -331,7 +331,7 @@ EntityID Client::createPlayer()
EntityID entityID = m_World->CreateEntity();
ComponentWrapper transform = m_World->AttachComponent(entityID, "Transform");
ComponentWrapper model = m_World->AttachComponent(entityID, "Model");
- model["Resource"] = "Models/Core/UnitSphere.obj"; // 360NoScope UnitSphere mesh
+ model["Resource"] = "Models/Core/UnitSphere.mesh";
ComponentWrapper player = m_World->AttachComponent(entityID, "Player");
return entityID;
}
diff --git a/src/Engine/Network/Server.cpp b/src/Engine/Network/Server.cpp
index 367f444b..951fbfb9 100644
--- a/src/Engine/Network/Server.cpp
+++ b/src/Engine/Network/Server.cpp
@@ -349,7 +349,7 @@ EntityID Server::createPlayer()
ComponentWrapper transform = m_World->AttachComponent(entityID, "Transform");
transform["Position"] = glm::vec3(-1.5f, 0.f, 0.f);
ComponentWrapper model = m_World->AttachComponent(entityID, "Model");
- model["Resource"] = "Models/Core/UnitSphere.obj"; // 360NoScope UnitSphere
+ model["Resource"] = "Models/Core/UnitSphere.mesh";
model["Color"] = glm::vec4(rand()%255 / 255.f, rand()%255 / 255.f, rand() %255 / 255.f, 1.f);
ComponentWrapper player = m_World->AttachComponent(entityID, "Player");
return entityID;
diff --git a/src/Engine/Rendering/DrawFinalPass.cpp b/src/Engine/Rendering/DrawFinalPass.cpp
index 1dd5f9bc..afb27d69 100644
--- a/src/Engine/Rendering/DrawFinalPass.cpp
+++ b/src/Engine/Rendering/DrawFinalPass.cpp
@@ -22,8 +22,6 @@ void DrawFinalPass::InitializeShaderPrograms()
m_ForwardPlusProgram->Link();
}
-static double tempFrameCounter = 6.348;
-
void DrawFinalPass::Draw(RenderScene& scene)
{
GLERROR("DrawFinalPass::Draw: Pre");
@@ -40,7 +38,6 @@ void DrawFinalPass::Draw(RenderScene& scene)
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_Renderer->Camera()->ProjectionMatrix()));
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
- //tempFrameCounter += 0.01;
//TODO: Render: Add code for more jobs than modeljobs.
for (auto &job : scene.ForwardJobs) {
auto modelJob = std::dynamic_pointer_cast(job);
@@ -57,21 +54,18 @@ void DrawFinalPass::Draw(RenderScene& scene)
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
}
+ //TODO: Fixa så att modelsJobs kan spela upp olika animationer och så att den kan få in en tid istället för 1.0f - Hälsningar Johan och Andreas :)
if (modelJob->Model->m_RawModel->m_Skeleton != nullptr) {
-#ifdef USING_ASSIMP_AS_IMPORTER
- auto animation = modelJob->Model->m_RawModel->m_Skeleton->GetAnimation("combinedAnim_0");
-#else
auto animation = modelJob->Model->m_RawModel->m_Skeleton->GetAnimation("running");
-#endif
if (animation != nullptr) {
std::vector frameBones = modelJob->Model->m_RawModel->m_Skeleton->GetFrameBones(
*animation,
- tempFrameCounter
+ 1.0f
);
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
}
}
- // -3 - 9
+
glBindVertexArray(modelJob->Model->VAO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int)));
diff --git a/src/Engine/Rendering/RawModelCustom.cpp b/src/Engine/Rendering/RawModelCustom.cpp
index 7c387dd9..3bad2ae5 100644
--- a/src/Engine/Rendering/RawModelCustom.cpp
+++ b/src/Engine/Rendering/RawModelCustom.cpp
@@ -162,8 +162,9 @@ void RawModelCustom::ReadMaterialSingle(unsigned int &offset, char* fileData, un
if (offset + nameLengths[1] > fileByteSize) {
throw Resource::FailedLoadingException("Reading Material NormalMap path failed");
}
-
- newMaterial.NormalMapPath = (fileData + offset);
+ newMaterial.NormalMapPath = "Textures/";
+ newMaterial.NormalMapPath += (fileData + offset);
+ newMaterial.NormalMapPath += ".png";
offset += nameLengths[1];
}
@@ -171,8 +172,9 @@ void RawModelCustom::ReadMaterialSingle(unsigned int &offset, char* fileData, un
if (offset + nameLengths[2] > fileByteSize) {
throw Resource::FailedLoadingException("Reading Material SpecularMap path failed");
}
-
- newMaterial.SpecularMapPath = (fileData + offset);
+ newMaterial.SpecularMapPath = "Textures/";
+ newMaterial.SpecularMapPath += (fileData + offset);
+ newMaterial.SpecularMapPath += ".png";
offset += nameLengths[2];
}
@@ -180,8 +182,9 @@ void RawModelCustom::ReadMaterialSingle(unsigned int &offset, char* fileData, un
if (offset + nameLengths[3] > fileByteSize) {
throw Resource::FailedLoadingException("Reading Material IncandescenceMap path failed");
}
-
- newMaterial.IncandescenceMapPath = (fileData + offset);
+ newMaterial.IncandescenceMapPath = "Textures/";
+ newMaterial.IncandescenceMapPath += (fileData + offset);
+ newMaterial.IncandescenceMapPath += ".png";
offset += nameLengths[3];
}
diff --git a/src/Engine/Rendering/RenderSystem.cpp b/src/Engine/Rendering/RenderSystem.cpp
index 5d9d474d..16de4961 100644
--- a/src/Engine/Rendering/RenderSystem.cpp
+++ b/src/Engine/Rendering/RenderSystem.cpp
@@ -99,14 +99,14 @@ void RenderSystem::fillModels(std::list>& jobs, World
#ifdef USING_ASSIMP_AS_IMPORTER
model = ResourceManager::Load<::Model>("Models/WidgetPlaneZ.obj"); // 360NoScope StillLoading mesh
#else
- model = ResourceManager::Load<::Model>("Models/coolCube.mesh"); // 360NoScope StillLoading mesh
+ model = ResourceManager::Load<::Model>("Models/WidgetPlaneZ.mesh");
#endif
} catch (const std::exception&) {
try {
#ifdef USING_ASSIMP_AS_IMPORTER
model = ResourceManager::Load<::Model>("Models/WidgetPlaneZ.obj"); // 360NoScope Error mesh
#else
- model = ResourceManager::Load<::Model>("Models/coolCube.mesh"); // 360NoScope Error mesh
+ model = ResourceManager::Load<::Model>("Models/WidgetPlaneZ.mesh");
#endif
} catch (const std::exception&) {
continue;
diff --git a/src/Engine/Sound/SoundSystem.cpp b/src/Engine/Sound/SoundSystem.cpp
index 2494581d..a55c1fee 100644
--- a/src/Engine/Sound/SoundSystem.cpp
+++ b/src/Engine/Sound/SoundSystem.cpp
@@ -198,7 +198,7 @@ bool SoundSystem::OnPlaySoundOnPosition(const Events::PlaySoundOnPosition & e)
(float&)(double)emitter["RollOffFactor"] = e.RollOffFactor;
(float&)(double)emitter["ReferenceDistance"] = e.ReferenceDistance;
auto model = m_World->AttachComponent(emitterID, "Model");
- (std::string&)model["Resource"] = "Models/Core/UnitCube.obj"; // 360NoScope UnitCube
+ (std::string&)model["Resource"] = "Models/Core/UnitCube.mesh"; // 360NoScope UnitCube
source->Type = SoundType::SFX;
m_Sources[emitterID] = source;
playSound(source);
diff --git a/src/Tests/CollisionTest.cpp b/src/Tests/CollisionTest.cpp
index 767fbe3a..42d7667c 100644
--- a/src/Tests/CollisionTest.cpp
+++ b/src/Tests/CollisionTest.cpp
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(collisionTest2)
BOOST_AUTO_TEST_CASE(rayVsModelTest)
{
//simple box test
- RayTest("Models/Core/UnitCube.obj"); // 360NoScope Unitcube
+ RayTest("Models/Core/UnitCube.mesh"); // 360NoScope Unitcube
}
BOOST_AUTO_TEST_CASE(rayVsModelTest2)
@@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE(rayVsModelTest2)
someAABB = AABB(minPos, maxPos);
//using a rawmodel here, else we have to init the renderingsystem
ResourceManager::RegisterType("RawModel");
- auto unitBox = ResourceManager::Load("Models/Core/UnitCube.obj"); // 360NoScope unitcube
+ auto unitBox = ResourceManager::Load("Models/Core/UnitCube.mesh"); // 360NoScope unitcube
BOOST_CHECK(unitBox != nullptr);
for (size_t i = 0; i < 1000000; i++)
@@ -189,19 +189,19 @@ BOOST_AUTO_TEST_CASE(rayVsModelTest2)
BOOST_AUTO_TEST_CASE(rayVsModelTest3)
{
//simple test
- RayTest("Models/Core/UnitSphere.obj"); // 360NoScope unitSphere
+ RayTest("Models/Core/UnitSphere.mesh"); // 360NoScope unitSphere
}
BOOST_AUTO_TEST_CASE(rayVsModelTest4)
{
//simple test
- RayTest("Models/Core/UnitCylinder.obj"); // 360NoScope unitCylinder
+ RayTest("Models/Core/UnitCylinder.mesh"); // 360NoScope unitCylinder
}
BOOST_AUTO_TEST_CASE(rayVsModelTest5)
{
//simple test
- RayTest("Models/Core/UnitRaptor.obj"); // 360NoScope unitRaptor
+ RayTest("Models/Core/UnitRaptor.mesh"); // 360NoScope unitRaptor
}
BOOST_AUTO_TEST_CASE(octTest)
{
diff --git a/src/Tests/HealthSystemTest.cpp b/src/Tests/HealthSystemTest.cpp
index 7c3ad641..6f157352 100644
--- a/src/Tests/HealthSystemTest.cpp
+++ b/src/Tests/HealthSystemTest.cpp
@@ -55,7 +55,7 @@ GameHealthSystemTest::GameHealthSystemTest()
EntityID playerID = m_World->CreateEntity();
ComponentWrapper transform = m_World->AttachComponent(playerID, "Transform");
ComponentWrapper model = m_World->AttachComponent(playerID, "Model");
- model["Resource"] = "Models/Core/UnitSphere.obj"; // 360NoScope UnitSphere
+ model["Resource"] = "Models/Core/UnitSphere.mesh"; // 360NoScope UnitSphere
ComponentWrapper player = m_World->AttachComponent(playerID, "Player");
ComponentWrapper health = m_World->AttachComponent(playerID, "Health");
healthsID = playerID;
@@ -80,7 +80,7 @@ GameHealthSystemTest::GameHealthSystemTest()
EntityID playerID2 = m_World->CreateEntity();
ComponentWrapper transform2 = m_World->AttachComponent(playerID2, "Transform");
ComponentWrapper model2 = m_World->AttachComponent(playerID2, "Model");
- model2["Resource"] = "Models/Core/UnitSphere.obj"; // 360NoScope UnitSphere
+ model2["Resource"] = "Models/Core/UnitSphere.mesh"; // 360NoScope UnitSphere
ComponentWrapper player2 = m_World->AttachComponent(playerID2, "Player");
ComponentWrapper health2 = m_World->AttachComponent(playerID2, "Health");
//END TEST
diff --git a/src/Tests/OctTreeTestGameClass.cpp b/src/Tests/OctTreeTestGameClass.cpp
index d03153e7..9ddee19b 100644
--- a/src/Tests/OctTreeTestGameClass.cpp
+++ b/src/Tests/OctTreeTestGameClass.cpp
@@ -149,7 +149,7 @@ void Game::Tick()
ComponentWrapper transform = m_World->AttachComponent(m_BoxID, "Transform");
transform["Scale"] = boxSize;
ComponentWrapper model = m_World->AttachComponent(m_BoxID, "Model");
- model["Resource"] = "Models/Core/UnitBox.obj"; // 360NoScope UnitBox
+ model["Resource"] = "Models/Core/UnitBox.mesh"; // 360NoScope UnitBox
m_World->createTestEntitiesTest2();
}
diff --git a/src/Tests/OctTreeTestHardCodedTestWorld.h b/src/Tests/OctTreeTestHardCodedTestWorld.h
index 89c3c3f3..9c8f3988 100644
--- a/src/Tests/OctTreeTestHardCodedTestWorld.h
+++ b/src/Tests/OctTreeTestHardCodedTestWorld.h
@@ -112,7 +112,7 @@ private:
ComponentWrapper transform = world.AttachComponent(entityCollisionBox, "Transform");
transform["Position"] = glm::vec3(0.f, 2.f, 0.f);
ComponentWrapper model = world.AttachComponent(entityCollisionBox, "Model");
- model["Resource"] = "Models/Core/UnitBox.obj"; // 360NoScope UnitBox
+ model["Resource"] = "Models/Core/UnitBox.mesh"; // 360NoScope UnitBox
}
void AddBoxModel(const glm::vec3 ¢er, const float &halfSize, Octree::Child* child, EntityID &outEntityId) {
@@ -124,7 +124,7 @@ private:
transform["Position"] = center;
transform["Scale"] = glm::vec3(1.0f, 1.0f, 1.0f)*halfSize*2.0f*0.97f;
ComponentWrapper model = world.AttachComponent(entityDummyScene, "Model");
- model["Resource"] = "Models/Core/UnitBox.obj"; // 360NoScope unitBox
+ model["Resource"] = "Models/Core/UnitBox.mesh"; // 360NoScope unitBox
model["Color"] = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
if (child->m_DynamicObjIndices.size() != 0)
model["Color"] = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
diff --git a/src/Tests/OldOctTree.cpp b/src/Tests/OldOctTree.cpp
index a94bf465..ec51b522 100644
--- a/src/Tests/OldOctTree.cpp
+++ b/src/Tests/OldOctTree.cpp
@@ -112,7 +112,7 @@ void OctTree::Update(float dt, World* world, Camera* cam)
ComponentWrapper transform = world->AttachComponent(m_BoxID, "Transform");
transform["Scale"] = boxSize;
ComponentWrapper model = world->AttachComponent(m_BoxID, "Model");
- model["Resource"] = "Models/Core/UnitBox.obj"; // 360NoScope UnitBox
+ model["Resource"] = "Models/Core/UnitBox.mesh"; // 360NoScope UnitBox
m_UpdatedOnce = true;
}
diff --git a/src/Tests/ResourceManagerTest.cpp b/src/Tests/ResourceManagerTest.cpp
index f83c6c9f..1f52472e 100644
--- a/src/Tests/ResourceManagerTest.cpp
+++ b/src/Tests/ResourceManagerTest.cpp
@@ -26,8 +26,8 @@ BOOST_AUTO_TEST_CASE(resourceManagerTest)
//configfile without register
//check so output says "EE failed to load: type not registered..."
- auto m_ScreenQuadNoRegister = ResourceManager::Load("Models/Core/ScreenQuad.obj"); // 360NoScope ScreenQuad
- BOOST_CHECK(!ResourceManager::IsResourceLoaded("Model", "Models/Core/ScreenQuad.obj"));
+ auto m_ScreenQuadNoRegister = ResourceManager::Load("Models/Core/ScreenQuad.mesh"); // 360NoScope ScreenQuad
+ BOOST_CHECK(!ResourceManager::IsResourceLoaded("Model", "Models/Core/ScreenQuad.mesh"));
//there is no error feedback to check if you try to release the wrong resources - hence that cant be tested either
}
diff --git a/tools/MayaExporter/MayaExporter/Material.cpp b/tools/MayaExporter/MayaExporter/Material.cpp
index 8f6b0a62..0a897e6e 100644
--- a/tools/MayaExporter/MayaExporter/Material.cpp
+++ b/tools/MayaExporter/MayaExporter/Material.cpp
@@ -57,22 +57,27 @@ void Material::grabPhongProperties(MaterialNode& material_node, MFnDependencyNod
bool Material::findColorTexture(MaterialNode& material_node, MFnDependencyNode& node)
{
MPlugArray AllConnections;
-
+
m_Plug = node.findPlug("color", true);
m_Plug.connectedTo(AllConnections, true, false);
for (int i = 0; i < AllConnections.length(); i++) {
if (AllConnections[i].node().hasFn(MFn::kFileTexture)) {
MFnDependencyNode TextureNode(AllConnections[i].node());
-
- std::string FullPath = TextureNode.findPlug("ftn").asString().asChar();
+
+ std::string FullPath = TextureNode.findPlug("fileTextureName").asString().asChar();
m_TexturePaths.push_back(FullPath);
- FullPath = FullPath.substr(FullPath.find_last_of("/") + 1);
+ MString workspace;
+ MStatus status = MGlobal::executeCommand(MString("workspace -q -rd;"),
+ workspace);
+ FullPath = FullPath.substr(workspace.length());
+ FullPath = FullPath.substr(FullPath.find_first_of("/") + 1);
material_node.ColorMapFile = FullPath.erase(FullPath.find_last_of("."), FullPath.find_last_of(".") - FullPath.size());
material_node.ColorMapFileLength = material_node.ColorMapFile.length() + 1;
// Test
+ MGlobal::displayInfo(MString() + "getAbsolutePathToResources: " + workspace);
MGlobal::displayInfo(MString() + "Texture file: " + FullPath.c_str());
return true;
}
@@ -101,7 +106,11 @@ bool Material::findNormalTexture(MaterialNode& material_node, MFnDependencyNode&
std::string FullPath = TextureNode.findPlug("ftn").asString().asChar();
m_TexturePaths.push_back(FullPath);
- FullPath = FullPath.substr(FullPath.find_last_of("/") + 1);
+ MString workspace;
+ MStatus status = MGlobal::executeCommand(MString("workspace -q -rd;"),
+ workspace);
+ FullPath = FullPath.substr(workspace.length());
+ FullPath = FullPath.substr(FullPath.find_first_of("/") + 1);
material_node.NormalMapFile = FullPath.erase(FullPath.find_last_of("."), FullPath.find_last_of(".") - FullPath.size());
material_node.NormalMapFileLength = material_node.NormalMapFile.length() + 1;
return true;
@@ -127,7 +136,11 @@ bool Material::findSpecularTexture(MaterialNode& material_node, MFnDependencyNod
std::string FullPath = TextureNode.findPlug("ftn").asString().asChar();
m_TexturePaths.push_back(FullPath);
- FullPath = FullPath.substr(FullPath.find_last_of("/") + 1);
+ MString workspace;
+ MStatus status = MGlobal::executeCommand(MString("workspace -q -rd;"),
+ workspace);
+ FullPath = FullPath.substr(workspace.length());
+ FullPath = FullPath.substr(FullPath.find_first_of("/") + 1);
material_node.SpecularMapFile = FullPath.erase(FullPath.find_last_of("."), FullPath.find_last_of(".") - FullPath.size());
material_node.SpecularMapFileLength = material_node.SpecularMapFile.length() + 1;
return true;
@@ -150,7 +163,11 @@ bool Material::findIncandescenceTexture(MaterialNode& material_node, MFnDependen
std::string FullPath = TextureNode.findPlug("ftn").asString().asChar();
m_TexturePaths.push_back(FullPath);
- FullPath = FullPath.substr(FullPath.find_last_of("/") + 1);
+ MString workspace;
+ MStatus status = MGlobal::executeCommand(MString("workspace -q -rd;"),
+ workspace);
+ FullPath = FullPath.substr(workspace.length());
+ FullPath = FullPath.substr(FullPath.find_first_of("/") + 1);
material_node.IncandescenceMapFile = FullPath.erase(FullPath.find_last_of("."), FullPath.find_last_of(".") - FullPath.size());
material_node.IncandescenceMapFileLength = material_node.IncandescenceMapFile.length() + 1;
return true;
diff --git a/tools/MayaExporter/MayaExporter/Menu.cpp b/tools/MayaExporter/MayaExporter/Menu.cpp
index 897cc655..4f32af84 100644
--- a/tools/MayaExporter/MayaExporter/Menu.cpp
+++ b/tools/MayaExporter/MayaExporter/Menu.cpp
@@ -60,7 +60,7 @@ Menu::Menu(QDialog* dialog)
m_ExportPath = new QLineEdit;
m_FileDialog = new QFileDialog;
- QString tmpPath("C:/Users/Nickelodion/Desktop/animTest");
+ QString tmpPath("C:/Users/Nickelodion/Desktop/workspace/tacticalZ/assets/models/");
m_ExportPath->setText(tmpPath);
QLabel* exportLabel = new QLabel;
exportLabel->setText("Export Path:");