Remove unused function

This commit is contained in:
Benau 2016-10-27 10:15:41 +08:00
parent 93197d9569
commit 956aa83a0a
4 changed files with 0 additions and 95 deletions

View File

@ -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<ISkinnedMesh::SJoint*> & 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; i<AllJoints.size(); ++i)
{
SJoint *joint = AllJoints[i];
for (unsigned int j = 0; j<joint->Weights.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

View File

@ -159,7 +159,6 @@ namespace scene
void addJoints(core::array<IBoneSceneNode*> &jointChildSceneNodes,
IAnimatedMeshSceneNode* node,
ISceneManager* smgr);
CSkinnedMesh *clone();
private:
void checkForAnimation();

View File

@ -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<CSkinnedMesh*>(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.

View File

@ -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();