mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 15:39:02 +00:00
Attach skinned parts to the scene node instead of the named bone
This commit is contained in:
parent
5154188110
commit
d9b64b77ec
@ -342,7 +342,7 @@ void NpcAnimation::updateParts()
|
||||
NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, const std::string &bonename)
|
||||
{
|
||||
NifOgre::EntityList entities = NIFLoader::createEntities(mEntityList.mSkelBase, bonename,
|
||||
mInsert->getCreator(), mesh);
|
||||
mInsert, mesh);
|
||||
std::vector<Ogre::Entity*> &parts = entities.mEntities;
|
||||
for(size_t i = 0;i < parts.size();i++)
|
||||
parts[i]->setVisibilityFlags(RV_Actors);
|
||||
|
@ -925,7 +925,7 @@ EntityList NIFLoader::createEntities(Ogre::SceneNode *parent, const std::string
|
||||
}
|
||||
|
||||
EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bonename,
|
||||
Ogre::SceneManager *sceneMgr,
|
||||
Ogre::SceneNode *parentNode,
|
||||
const std::string &name,
|
||||
const std::string &group)
|
||||
{
|
||||
@ -935,6 +935,7 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo
|
||||
if(meshes.size() == 0)
|
||||
return entitylist;
|
||||
|
||||
Ogre::SceneManager *sceneMgr = parentNode->getCreator();
|
||||
std::string filter = "Tri "+bonename;
|
||||
for(size_t i = 0;i < meshes.size();i++)
|
||||
{
|
||||
@ -957,14 +958,14 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo
|
||||
if(entitylist.mSkelBase)
|
||||
{
|
||||
entitylist.mSkelBase->shareSkeletonInstanceWith(parent);
|
||||
parent->attachObjectToBone(bonename, entitylist.mSkelBase);
|
||||
parentNode->attachObject(entitylist.mSkelBase);
|
||||
for(size_t i = 0;i < entitylist.mEntities.size();i++)
|
||||
{
|
||||
Ogre::Entity *entity = entitylist.mEntities[i];
|
||||
if(entity != entitylist.mSkelBase && entity->hasSkeleton())
|
||||
{
|
||||
entity->shareSkeletonInstanceWith(parent);
|
||||
parent->attachObjectToBone(bonename, entity);
|
||||
parentNode->attachObject(entity);
|
||||
}
|
||||
else if(entity != entitylist.mSkelBase)
|
||||
parent->attachObjectToBone(bonename, entity);
|
||||
|
@ -91,7 +91,7 @@ class NIFLoader
|
||||
|
||||
public:
|
||||
static EntityList createEntities(Ogre::Entity *parent, const std::string &bonename,
|
||||
Ogre::SceneManager *sceneMgr,
|
||||
Ogre::SceneNode *parentNode,
|
||||
const std::string &name,
|
||||
const std::string &group="General");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user