mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
More physics and managing of Animation objects
This commit is contained in:
parent
1b835d6702
commit
7eee54bcd7
3 changed files with 17 additions and 13 deletions
|
@ -45,9 +45,16 @@ namespace MWClass
|
|||
|
||||
const std::string &model = ref->base->model;
|
||||
assert (ref->base != NULL);
|
||||
if(!model.empty()){
|
||||
physics.insertActorPhysics(ptr, "meshes\\" + model);
|
||||
}
|
||||
std::string headID = ref->base->head;
|
||||
std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
|
||||
bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
|
||||
|
||||
|
||||
std::string smodel = "meshes\\base_anim.nif";
|
||||
if(beast)
|
||||
smodel = "meshes\\base_animkna.nif";
|
||||
physics.insertActorPhysics(ptr, smodel);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -98,18 +98,15 @@ void Actors::removeCell(MWWorld::Ptr::CellStore* store){
|
|||
{
|
||||
Ogre::SceneNode* base = mCellSceneNodes[store];
|
||||
base->removeAndDestroyAllChildren();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mCellSceneNodes.erase(store);
|
||||
mRend.getScene()->destroySceneNode(base);
|
||||
base = 0;
|
||||
}
|
||||
for(std::map<MWWorld::Ptr, Animation*>::iterator iter = mAllActors.begin(); iter != mAllActors.end(); iter++)
|
||||
{
|
||||
if(iter->first.getCell() == store){
|
||||
mAllActors.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -191,7 +191,7 @@ namespace MWWorld
|
|||
|
||||
void PhysicsSystem::insertActorPhysics(const MWWorld::Ptr& ptr, const std::string model){
|
||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||
std::cout << "Adding node with name" << node->getName();
|
||||
// std::cout << "Adding node with name" << node->getName();
|
||||
addActor (node->getName(), model, node->getPosition());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue