mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Putting the actors in a list
This commit is contained in:
parent
0902a3db89
commit
509009e5c1
@ -13,7 +13,8 @@ void Actors::setMwRoot(Ogre::SceneNode* root){
|
|||||||
}
|
}
|
||||||
void Actors::insertNPC(const MWWorld::Ptr& ptr){
|
void Actors::insertNPC(const MWWorld::Ptr& ptr){
|
||||||
insertBegin(ptr, true, true);
|
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){
|
void Actors::insertCreature (const MWWorld::Ptr& ptr){
|
||||||
insertBegin(ptr, true, true);
|
insertBegin(ptr, true, true);
|
||||||
|
MWRender::Animation anim = MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
|
||||||
MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
|
mAllActors.push_back(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Actors::deleteObject (const MWWorld::Ptr& ptr)
|
bool Actors::deleteObject (const MWWorld::Ptr& ptr)
|
||||||
@ -92,4 +93,5 @@ void Actors::removeCell(MWWorld::Ptr::CellStore* store){
|
|||||||
mRend.getScene()->destroySceneNode(base);
|
mRend.getScene()->destroySceneNode(base);
|
||||||
base = 0;
|
base = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "components/esm_store/cell_store.hpp"
|
#include "components/esm_store/cell_store.hpp"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ namespace MWRender{
|
|||||||
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
|
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
|
||||||
Ogre::SceneNode* mMwRoot;
|
Ogre::SceneNode* mMwRoot;
|
||||||
MWWorld::Environment& mEnvironment;
|
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;
|
Ogre::Entity* base;
|
||||||
public:
|
public:
|
||||||
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env){};
|
Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env){};
|
||||||
|
~Animation();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
using namespace NifOgre;
|
using namespace NifOgre;
|
||||||
namespace MWRender{
|
namespace MWRender{
|
||||||
|
|
||||||
|
CreatureAnimation::~CreatureAnimation(){
|
||||||
|
|
||||||
|
}
|
||||||
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
|
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
|
||||||
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
|
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
|
||||||
assert(insert);
|
assert(insert);
|
||||||
|
@ -16,6 +16,7 @@ namespace MWRender{
|
|||||||
class CreatureAnimation: public Animation{
|
class CreatureAnimation: public Animation{
|
||||||
std::vector<Nif::NiTriShapeCopy> shapes; //All the NiTriShapeData for this creature
|
std::vector<Nif::NiTriShapeCopy> shapes; //All the NiTriShapeData for this creature
|
||||||
public:
|
public:
|
||||||
|
~CreatureAnimation();
|
||||||
CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
using namespace NifOgre;
|
using namespace NifOgre;
|
||||||
namespace MWRender{
|
namespace MWRender{
|
||||||
|
NpcAnimation::~NpcAnimation(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
|
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
|
||||||
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
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);
|
base = mRend.getScene()->createEntity(smodel);
|
||||||
insert->attachObject(base);
|
insert->attachObject(base);
|
||||||
std::cout << "Nifloader\n";
|
|
||||||
|
|
||||||
std::string headModel = "meshes\\" +
|
std::string headModel = "meshes\\" +
|
||||||
mEnvironment.mWorld->getStore().bodyParts.find(headID)->model;
|
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* forearmr = forearml;
|
||||||
const ESM::BodyPart* wristr = wristl;
|
const ESM::BodyPart* wristr = wristl;
|
||||||
const ESM::BodyPart* armr = arml;
|
const ESM::BodyPart* armr = arml;
|
||||||
std::cout << "upperleg";
|
|
||||||
if(upperleg){
|
if(upperleg){
|
||||||
insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
|
insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
|
||||||
insertBoundedPart("meshes\\" + upperleg->model, "Right 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
|
std::vector<std::vector<Nif::NiTriShapeCopy>> shapeparts; //All the NiTriShape data that we need for animating this particular npc
|
||||||
public:
|
public:
|
||||||
NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
|
||||||
|
~NpcAnimation();
|
||||||
Ogre::Entity* insertBoundedPart(const std::string &mesh, std::string bonename);
|
Ogre::Entity* insertBoundedPart(const std::string &mesh, std::string bonename);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user