diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp index 74e472ca5..92ec49820 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp @@ -1474,77 +1474,6 @@ void CSkinnedMesh::calculateTangents( } } -// ---------------------------------------------------------------------------- -/** Copies a mesh. - */ -CSkinnedMesh *CSkinnedMesh::clone() -{ - - CSkinnedMesh* skinned_mesh = new CSkinnedMesh(); - - for (u32 i = 0; i < getMeshBuffers().size(); i++) - { - SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); - *buffer = *(getMeshBuffers()[i]); - } - - for (u32 j = 0; j < getAllJoints().size(); ++j) - { - ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); - *joint = *(getAllJoints()[j]); - } - - // fix children pointers (they still have old pointers) - core::array & new_joints = skinned_mesh->getAllJoints(); - for (u32 i = 0; i < new_joints.size(); ++i) - { - ISkinnedMesh::SJoint * joint = new_joints[i]; - for (u32 c = 0; c < joint->Children.size(); ++c) - { - // the child is one of the oldJoints and must be replaced by the newjoint on the same index - bool found = false; - for (u32 k = 0; k < AllJoints.size(); ++k) - { - if (joint->Children[c] == AllJoints[k]) - { - joint->Children[c] = new_joints[k]; - found = true; - break; - } - } // k < old_joints.size - - if (!found) - found = true; - } // c < joint->Children.size() - } // i < new_joints.size() - - // In finalize the values from LocalBuffers are copied into - // Weights[].StaticPos. Since skinned_mesh already has the correct - // values in Weights, we have to copy the values from Weights - // into LocalBuffer (so that in the copy from LocalBuffer to weights - // no values are overwritten). - // FIXME: Not ideal, better would be not to copy the values in - // finalize(). - for (unsigned int i = 0; iWeights.size(); ++j) - { - const u16 buffer_id = joint->Weights[j].buffer_id; - const u32 vertex_id = joint->Weights[j].vertex_id; - - skinned_mesh->LocalBuffers[buffer_id]->getVertex(vertex_id)->Pos = joint->Weights[j].StaticPos; - skinned_mesh->LocalBuffers[buffer_id]->getVertex(vertex_id)->Normal = joint->Weights[j].StaticNormal; - } - } - skinned_mesh->finalize(); - - - - return skinned_mesh; - -} // clone - } // end namespace scene } // end namespace irr diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h index 2946d14c2..2c66bbf9b 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h @@ -159,7 +159,6 @@ namespace scene void addJoints(core::array &jointChildSceneNodes, IAnimatedMeshSceneNode* node, ISceneManager* smgr); - CSkinnedMesh *clone(); private: void checkForAnimation(); diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 51cadb2f3..994a0015c 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1069,28 +1069,6 @@ scene::IMesh *IrrDriver::getMesh(const std::string &filename) return am->getMesh(0); } // getMesh -// ---------------------------------------------------------------------------- -/** Create a skinned mesh which has copied all meshbuffers and joints of the - * original mesh. Note, that this will not copy any other information like - * joints data. - * \param mesh Original mesh - * \return Newly created skinned mesh. You should call drop() when you don't - * need it anymore. - */ -scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig) -{ - using namespace scene; - CSkinnedMesh *mesh = dynamic_cast(orig); - if (!mesh) - { - Log::error("copyAnimatedMesh", "Given mesh was not a skinned mesh."); - return NULL; - } - - scene::IAnimatedMesh* out = mesh->clone(); - return out; -} // copyAnimatedMesh - // ---------------------------------------------------------------------------- /** Sets the material flags in this mesh depending on the settings in * material_manager. diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 3f78657b5..d7fa11a75 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -358,7 +358,6 @@ public: void setAllMaterialFlags(scene::IMesh *mesh) const; scene::IAnimatedMesh *getAnimatedMesh(const std::string &name); scene::IMesh *getMesh(const std::string &name); - scene::IAnimatedMesh *copyAnimatedMesh(scene::IAnimatedMesh *orig); video::ITexture *applyMask(video::ITexture* texture, const std::string& mask_path); void displayFPS();