mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
Cell changing fixes
This commit is contained in:
parent
7cf3fc8991
commit
1b835d6702
5 changed files with 31 additions and 11 deletions
|
@ -47,7 +47,7 @@ namespace MWClass
|
|||
const std::string &model = ref->base->model;
|
||||
assert (ref->base != NULL);
|
||||
if(!model.empty()){
|
||||
// physics.insertActorPhysics(ptr, "meshes\\" + model);
|
||||
physics.insertActorPhysics(ptr, "meshes\\" + model);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace MWClass
|
|||
void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace MWClass
|
|||
assert (ref->base != NULL);
|
||||
if(!model.empty()){
|
||||
physics.insertActorPhysics(ptr, "meshes\\" + model);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,13 @@ void Actors::setMwRoot(Ogre::SceneNode* root){
|
|||
mMwRoot = root;
|
||||
}
|
||||
void Actors::insertNPC(const MWWorld::Ptr& ptr){
|
||||
|
||||
insertBegin(ptr, true, true);
|
||||
NpcAnimation* anim = new MWRender::NpcAnimation(ptr, mEnvironment, mRend);
|
||||
mAllActors.push_back(anim);
|
||||
NpcAnimation* anim = new MWRender::NpcAnimation(ptr, mEnvironment, mRend);
|
||||
|
||||
//
|
||||
|
||||
mAllActors[ptr] = anim;
|
||||
|
||||
|
||||
}
|
||||
|
@ -57,17 +61,20 @@ void Actors::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
|
|||
|
||||
}
|
||||
void Actors::insertCreature (const MWWorld::Ptr& ptr){
|
||||
|
||||
insertBegin(ptr, true, true);
|
||||
CreatureAnimation* anim = new MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
|
||||
//mAllActors.insert(std::pair<MWWorld::Ptr, Animation*>(ptr,anim));
|
||||
mAllActors.push_back(anim);
|
||||
//mAllActors.push_back(&anim);
|
||||
mAllActors[ptr] = anim;
|
||||
//mAllActors.push_back(&anim);*/
|
||||
}
|
||||
|
||||
bool Actors::deleteObject (const MWWorld::Ptr& ptr)
|
||||
{
|
||||
mAllActors.erase(ptr);
|
||||
if (Ogre::SceneNode *base = ptr.getRefData().getBaseNode())
|
||||
{
|
||||
|
||||
Ogre::SceneNode *parent = base->getParentSceneNode();
|
||||
|
||||
for (std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *>::const_iterator iter (
|
||||
|
@ -91,6 +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;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MWRender{
|
|||
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
|
||||
Ogre::SceneNode* mMwRoot;
|
||||
MWWorld::Environment& mEnvironment;
|
||||
std::list<Animation*> mAllActors;
|
||||
std::map<MWWorld::Ptr, Animation*> mAllActors;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,9 @@ namespace MWWorld
|
|||
ListHandles functor;
|
||||
|
||||
MWWorld::Ptr::CellStore* active = *iter;
|
||||
mRendering.removeCell(active);
|
||||
|
||||
|
||||
|
||||
|
||||
active->forEach<ListHandles>(functor);
|
||||
|
||||
|
@ -73,11 +75,13 @@ namespace MWWorld
|
|||
mPhysics->removeObject (node->getName());
|
||||
}
|
||||
}
|
||||
//mPhysics->removeObject("Unnamed_43");
|
||||
mRendering.removeCell(active);
|
||||
//mPhysics->removeObject("Unnamed_43");
|
||||
mWorld->getLocalScripts().clearCell (active);
|
||||
mEnvironment.mMechanicsManager->dropActors (active);
|
||||
mEnvironment.mSoundManager->stopSound (active);
|
||||
mActiveCells.erase (iter);
|
||||
mActiveCells.erase(active);
|
||||
|
||||
}
|
||||
|
||||
void Scene::loadCell (Ptr::CellStore *cell)
|
||||
|
|
Loading…
Reference in a new issue