Putting the actors in a list

actorid
Jason Hooks 13 years ago
parent 0902a3db89
commit 509009e5c1

@ -13,7 +13,8 @@ void Actors::setMwRoot(Ogre::SceneNode* root){
}
void Actors::insertNPC(const MWWorld::Ptr& ptr){
insertBegin(ptr, true, true);
MWRender::NpcAnimation(ptr, mEnvironment, mRend);
MWRender::Animation anim = MWRender::NpcAnimation(ptr, mEnvironment, mRend);
mAllActors.push_back(anim);
}
@ -57,8 +58,8 @@ void Actors::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
}
void Actors::insertCreature (const MWWorld::Ptr& ptr){
insertBegin(ptr, true, true);
MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
MWRender::Animation anim = MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
mAllActors.push_back(anim);
}
bool Actors::deleteObject (const MWWorld::Ptr& ptr)
@ -92,4 +93,5 @@ void Actors::removeCell(MWWorld::Ptr::CellStore* store){
mRend.getScene()->destroySceneNode(base);
base = 0;
}
}

@ -3,6 +3,7 @@
#include "components/esm_store/cell_store.hpp"
#include <map>
#include <list>
@ -22,6 +23,7 @@ namespace MWRender{
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
Ogre::SceneNode* mMwRoot;
MWWorld::Environment& mEnvironment;
std::list<Animation> mAllActors;

@ -0,0 +1,7 @@
#include "animation.hpp"
namespace MWRender{
Animation::~Animation(){
base = 0;
}
}

@ -20,6 +20,7 @@ class Animation{
Ogre::Entity* base;
public:
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env){};
~Animation();
};
}

@ -5,6 +5,10 @@
using namespace Ogre;
using namespace NifOgre;
namespace MWRender{
CreatureAnimation::~CreatureAnimation(){
}
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
assert(insert);

@ -16,6 +16,7 @@ namespace MWRender{
class CreatureAnimation: public Animation{
std::vector<Nif::NiTriShapeCopy> shapes; //All the NiTriShapeData for this creature
public:
~CreatureAnimation();
CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
};
}

@ -4,6 +4,9 @@
using namespace Ogre;
using namespace NifOgre;
namespace MWRender{
NpcAnimation::~NpcAnimation(){
}
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
@ -52,7 +55,6 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
base = mRend.getScene()->createEntity(smodel);
insert->attachObject(base);
std::cout << "Nifloader\n";
std::string headModel = "meshes\\" +
mEnvironment.mWorld->getStore().bodyParts.find(headID)->model;
@ -82,7 +84,6 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
const ESM::BodyPart* forearmr = forearml;
const ESM::BodyPart* wristr = wristl;
const ESM::BodyPart* armr = arml;
std::cout << "upperleg";
if(upperleg){
insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
insertBoundedPart("meshes\\" + upperleg->model, "Right Upper Leg");

@ -15,6 +15,7 @@ class NpcAnimation: public Animation{
std::vector<std::vector<Nif::NiTriShapeCopy>> shapeparts; //All the NiTriShape data that we need for animating this particular npc
public:
NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
~NpcAnimation();
Ogre::Entity* insertBoundedPart(const std::string &mesh, std::string bonename);
};
}

Loading…
Cancel
Save