Esempio n. 1
0
int CEditableObject::GetSelectedBones(BoneVec& sel_bones)
{
    BoneVec& lst 	= m_Bones;
    for(BoneIt b_it=lst.begin(); b_it!=lst.end(); b_it++)
        if ((*b_it)->flags.is(CBone::flSelected)) sel_bones.push_back(*b_it);
    return sel_bones.size();
}
Esempio n. 2
0
void CSMotion::SortBonesBySkeleton(BoneVec& bones)
{
    BoneMotionVec new_bone_mots;
    for (BoneIt b_it = bones.begin(); b_it != bones.end(); ++b_it)
    {
        st_BoneMotion* BM = FindBoneMotion((*b_it)->Name());
        if (!BM)
        {
            CBone* B = *(b_it);
            bone_mots.push_back(st_BoneMotion());
            st_BoneMotion& bm0 = bone_mots[0];
            st_BoneMotion& bm = bone_mots.back();
            bm.SetName(B->Name().c_str());
            bm.m_Flags.assign(bm0.m_Flags);

            for (int ch = 0; ch < ctMaxChannel; ++ch)
            {
                bm.envs[ch] = xr_new<CEnvelope>();
                //. bm.envs[ch]->Load_2(F);
            }
            bm.envs[ctPositionX]->InsertKey(0.0f, B->_Offset().x);
            bm.envs[ctPositionY]->InsertKey(0.0f, B->_Offset().y);
            bm.envs[ctPositionZ]->InsertKey(0.0f, B->_Offset().z);
            bm.envs[ctRotationH]->InsertKey(0.0f, B->_Rotate().x);
            bm.envs[ctRotationP]->InsertKey(0.0f, B->_Rotate().y);
            bm.envs[ctRotationB]->InsertKey(0.0f, B->_Rotate().z);
            BM = &bm;
        };
        new_bone_mots.push_back(*BM);
    }
    bone_mots.clear();
    bone_mots = new_bone_mots;
}
Esempio n. 3
0
void CSMotion::SortBonesBySkeleton(BoneVec& bones)
{
	BoneMotionVec new_bone_mots;
	for (BoneIt b_it=bones.begin(); b_it!=bones.end(); b_it++){
    	st_BoneMotion* BM = FindBoneMotion((*b_it)->Name()); R_ASSERT(BM);
		new_bone_mots.push_back(*BM);
    }
    bone_mots.clear	();
    bone_mots 		= new_bone_mots;
}
Esempio n. 4
0
ICF void fill_bones_by_parent(BoneVec& bones,CBone* start)
{
    bones.push_back		(start);
    for (BoneIt b_it=start->children.begin(); b_it!=start->children.end(); b_it++)
    	fill_bones_by_parent(bones,*b_it);
}