Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp
void PrepareCollisionMeshesNodesString(EMotionFX::Actor* actor, size_t lod, AZStd::string* outNodeNames)
    {
        // reset the resulting string
        outNodeNames->clear();
        outNodeNames->reserve(16384);

        // check if the actor is invalid
        if (actor == nullptr)
        {
            return;
        }

        // check if the lod is invalid
        if (lod > (actor->GetNumLODLevels() - 1))
        {
            return;
        }

        // get the number of nodes and iterate through them
        const size_t numNodes = actor->GetNumNodes();
        for (size_t i = 0; i < numNodes; ++i)
        {
            EMotionFX::Mesh* mesh = actor->GetMesh(lod, i);
            if (mesh && mesh->GetIsCollisionMesh())
            {
                *outNodeNames += AZStd::string::format("%s;", actor->GetSkeleton()->GetNode(i)->GetName());
            }
        }

        // make sure there is no semicolon at the end
        AzFramework::StringFunc::Strip(*outNodeNames, MCore::CharacterConstants::semiColon, true /* case sensitive */, false /* beginning */, true /* ending */);
    }
// walk over the meshes and check which of them we want to set as collision mesh
walk over the meshes and check which of them we want to set as collision mesh
walk over the meshes and check which of them we want to set as collision mesh
void PrepareCollisionMeshesNodesString(EMotionFX::Actor* actor, size_t lod, AZStd::string* outNodeNames)
    {
        outNodeNames->clear();
        outNodeNames->reserve(16384);
        if (actor == nullptr)
        {
            return;
        }
        if (lod > (actor->GetNumLODLevels() - 1))
        {
            return;
        }
        const size_t numNodes = actor->GetNumNodes();
        for (size_t i = 0; i < numNodes; ++i)
        {
            EMotionFX::Mesh* mesh = actor->GetMesh(lod, i);
            if (mesh && mesh->GetIsCollisionMesh())
            {
                *outNodeNames += AZStd::string::format("%s;", actor->GetSkeleton()->GetNode(i)->GetName());
            }
        }
        AzFramework::StringFunc::Strip(*outNodeNames, MCore::CharacterConstants::semiColon, true , false , true );
    }
void PrepareCollisionMeshesNodesString ( EMotionFX :: Actor * actor , size_t lod , AZStd :: string * outNodeNames ) { outNodeNames -> clear ( ) ; outNodeNames -> reserve ( 16384 ) ; if ( actor == nullptr ) { return ; } if ( lod > ( actor -> GetNumLODLevels ( ) - 1 ) ) { return ; } const size_t numNodes = actor -> GetNumNodes ( ) ; for ( size_t i = 0 ; i < numNodes ; ++ i ) { EMotionFX :: Mesh * mesh = actor -> GetMesh ( lod , i ) ; if ( mesh && mesh -> GetIsCollisionMesh ( ) ) { * outNodeNames += AZStd :: string :: format ( " " , actor -> GetSkeleton ( ) -> GetNode ( i ) -> GetName ( ) ) ; } } AzFramework :: StringFunc :: Strip ( * outNodeNames , MCore :: CharacterConstants :: semiColon , true , false , true ) ; }
walk over the meshes and check which of them we want to set as collision mesh
walk over the meshes and check which of them we want to set as collision mesh
// reset the resulting string // check if the actor is invalid // check if the lod is invalid // get the number of nodes and iterate through them // make sure there is no semicolon at the end /* case sensitive */ /* beginning */ /* ending */