Beispiel #1
0
IZ_BOOL CColladaAnimation::GetAnmNode(
    IZ_UINT nNodeIdx,
    izanagi::S_ANM_NODE& sNode)
{
    IZ_ASSERT(nNodeIdx < m_AnmNodes.size());

    const SAnmNode& sAnmNode = m_AnmNodes[nNodeIdx];

    sNode.target.SetString(sAnmNode.nameJoint);
    sNode.targetKey = sNode.target.GetKeyValue();

    sNode.targetIdx = sAnmNode.idxJoint;

    sNode.numChannels = GetAnmChannelNum(nNodeIdx);

    return IZ_TRUE;
}
Beispiel #2
0
IZ_BOOL AssimpImporter::GetAnmNode(
    IZ_UINT nNodeIdx,
    izanagi::S_ANM_NODE& sNode)
{
    auto scene = m_importer.GetScene();
    IZ_ASSERT(m_curAnmIdx < scene->mNumAnimations);

    auto anm = scene->mAnimations[m_curAnmIdx];
    IZ_ASSERT(nNodeIdx < anm->mNumChannels);

    auto channel = anm->mChannels[nNodeIdx];

    sNode.target.SetString(channel->mNodeName.C_Str());
    sNode.targetKey = sNode.target.GetKeyValue();

    IZ_BOOL ret = IZ_FALSE;

    auto it = m_nodes.begin();
    for (; it != m_nodes.end(); it++) {
        const Node& node = it->second;

        izanagi::S_ANM_NODE tmp;
        tmp.target.SetString(node.node->mName.C_Str());

        if (sNode.target == tmp.target) {
            sNode.targetIdx = it->first;

            ret = IZ_TRUE;
            break;
        }
    }

    IZ_ASSERT(ret);

    sNode.numChannels = GetAnmChannelNum(nNodeIdx);

    // NOTE
    // channelIdx は外部で設定される.

    return ret;
}