Removed redundant rest matrix and fixed assert compile error

pull/2731/head
RevoluPowered 2019-10-26 18:09:26 +01:00
parent 6ea97a1282
commit 93efe4197a
2 changed files with 7 additions and 19 deletions

View File

@ -151,13 +151,6 @@ namespace Assimp {
// set this bone node to be referenced properly // set this bone node to be referenced properly
ai_assert(bone_node); ai_assert(bone_node);
bone->mNode = bone_node; bone->mNode = bone_node;
// apply full hierarchy to transform for basic offset
while( bone_node->mParent )
{
bone->mRestMatrix = bone_node->mTransformation * bone->mRestMatrix;
bone_node = bone_node->mParent;
}
} }
@ -249,12 +242,12 @@ namespace Assimp {
/* Prepare flat node list which can be used for non recursive lookups later */ /* Prepare flat node list which can be used for non recursive lookups later */
void FBXConverter::BuildNodeList(aiNode *current_node, std::vector<aiNode *> &nodes) void FBXConverter::BuildNodeList(aiNode *current_node, std::vector<aiNode *> &nodes)
{ {
assert(current_node); ai_assert(current_node);
for( unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) for( unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId)
{ {
aiNode *child = current_node->mChildren[nodeId]; aiNode *child = current_node->mChildren[nodeId];
assert(child); ai_assert(child);
nodes.push_back(child); nodes.push_back(child);
@ -268,19 +261,19 @@ namespace Assimp {
/* Source: sketch fab log cutter fbx */ /* Source: sketch fab log cutter fbx */
void FBXConverter::BuildBoneList(aiNode *current_node, const aiNode * root_node, const aiScene *scene, std::vector<aiBone*> &bones ) void FBXConverter::BuildBoneList(aiNode *current_node, const aiNode * root_node, const aiScene *scene, std::vector<aiBone*> &bones )
{ {
assert(scene); ai_assert(scene);
for( unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) for( unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId)
{ {
aiNode *child = current_node->mChildren[nodeId]; aiNode *child = current_node->mChildren[nodeId];
assert(child); ai_assert(child);
// check for bones // check for bones
for( unsigned int meshId = 0; meshId < child->mNumMeshes; ++meshId) for( unsigned int meshId = 0; meshId < child->mNumMeshes; ++meshId)
{ {
assert(child->mMeshes); ai_assert(child->mMeshes);
unsigned int mesh_index = child->mMeshes[meshId]; unsigned int mesh_index = child->mMeshes[meshId];
aiMesh *mesh = scene->mMeshes[ mesh_index ]; aiMesh *mesh = scene->mMeshes[ mesh_index ];
assert(mesh); ai_assert(mesh);
for( unsigned int boneId = 0; boneId < mesh->mNumBones; ++boneId) for( unsigned int boneId = 0; boneId < mesh->mNumBones; ++boneId)
{ {
@ -1777,7 +1770,7 @@ namespace Assimp {
std::vector<size_t> &out_indices, std::vector<size_t> &index_out_indices, std::vector<size_t> &out_indices, std::vector<size_t> &index_out_indices,
std::vector<size_t> &count_out_indices, const aiMatrix4x4 &absolute_transform, std::vector<size_t> &count_out_indices, const aiMatrix4x4 &absolute_transform,
aiNode *parent, aiNode *root_node) { aiNode *parent, aiNode *root_node) {
assert(cl); // make sure cluster valid ai_assert(cl); // make sure cluster valid
std::string deformer_name = cl->TargetNode()->Name(); std::string deformer_name = cl->TargetNode()->Name();
aiString bone_name = aiString(FixNodeName(deformer_name)); aiString bone_name = aiString(FixNodeName(deformer_name));

View File

@ -293,11 +293,6 @@ struct aiBone {
*/ */
C_STRUCT aiMatrix4x4 mOffsetMatrix; C_STRUCT aiMatrix4x4 mOffsetMatrix;
/** Matrix used for the global rest transform
* This tells you directly the rest without extending as required in most game engine implementations
* */
C_STRUCT aiMatrix4x4 mRestMatrix;
#ifdef __cplusplus #ifdef __cplusplus
//! Default constructor //! Default constructor