2010-01-12 13:46:44 +00:00
|
|
|
/*
|
|
|
|
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
|
|
Copyright (C) 2008-2010 Nicolay Korslund
|
|
|
|
Email: < korslund@gmail.com >
|
|
|
|
WWW: http://openmw.sourceforge.net/
|
|
|
|
|
|
|
|
This file (ogre_nif_loader.h) is part of the OpenMW package.
|
|
|
|
|
|
|
|
OpenMW is distributed as free software: you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License
|
|
|
|
version 3, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
version 3 along with this program. If not, see
|
|
|
|
http://www.gnu.org/licenses/ .
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _OGRE_NIF_LOADER_H_
|
|
|
|
#define _OGRE_NIF_LOADER_H_
|
|
|
|
|
|
|
|
#include <OgreResource.h>
|
|
|
|
#include <OgreMesh.h>
|
2012-07-14 01:25:35 +00:00
|
|
|
#include <OgreSkeleton.h>
|
2012-07-03 13:32:38 +00:00
|
|
|
|
2012-07-17 17:57:15 +00:00
|
|
|
#include <vector>
|
2010-08-08 15:20:55 +00:00
|
|
|
#include <string>
|
2011-11-23 23:18:51 +00:00
|
|
|
|
2010-08-08 15:20:55 +00:00
|
|
|
|
2013-01-09 17:10:59 +00:00
|
|
|
// FIXME: This namespace really doesn't do anything Nif-specific. Any supportable
|
|
|
|
// model format should go through this.
|
2011-06-19 17:14:14 +00:00
|
|
|
namespace NifOgre
|
|
|
|
{
|
2012-07-14 01:25:35 +00:00
|
|
|
|
2012-09-29 04:57:26 +00:00
|
|
|
typedef std::multimap<float,std::string> TextKeyMap;
|
2013-01-05 12:01:11 +00:00
|
|
|
static const char sTextKeyExtraDataID[] = "TextKeyExtraData";
|
2012-07-17 20:40:03 +00:00
|
|
|
struct EntityList {
|
|
|
|
std::vector<Ogre::Entity*> mEntities;
|
|
|
|
Ogre::Entity *mSkelBase;
|
|
|
|
|
2012-07-22 00:09:16 +00:00
|
|
|
EntityList() : mSkelBase(0)
|
2012-07-17 20:40:03 +00:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
2012-07-24 00:20:47 +00:00
|
|
|
|
2013-01-07 12:21:25 +00:00
|
|
|
/* This holds a list of mesh names, the names of their parent nodes, and the offset
|
|
|
|
* from their parent nodes. */
|
|
|
|
struct MeshInfo {
|
|
|
|
std::string mMeshName;
|
|
|
|
std::string mTargetNode;
|
|
|
|
|
2013-02-24 20:42:32 +00:00
|
|
|
MeshInfo(const std::string &name, const std::string &target)
|
|
|
|
: mMeshName(name), mTargetNode(target)
|
2013-01-07 12:21:25 +00:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
typedef std::vector<MeshInfo> MeshInfoList;
|
2012-07-14 01:25:35 +00:00
|
|
|
|
2013-01-09 17:10:59 +00:00
|
|
|
class Loader
|
2010-01-12 13:46:44 +00:00
|
|
|
{
|
2013-01-31 06:37:39 +00:00
|
|
|
static MeshInfoList load(const std::string &name, const std::string &group);
|
2012-07-17 20:40:03 +00:00
|
|
|
|
2012-07-18 03:23:09 +00:00
|
|
|
public:
|
2012-07-18 18:14:13 +00:00
|
|
|
static EntityList createEntities(Ogre::Entity *parent, const std::string &bonename,
|
2012-07-19 01:38:55 +00:00
|
|
|
Ogre::SceneNode *parentNode,
|
2013-01-06 04:54:57 +00:00
|
|
|
std::string name,
|
2012-07-18 18:14:13 +00:00
|
|
|
const std::string &group="General");
|
|
|
|
|
2013-01-05 12:01:11 +00:00
|
|
|
static EntityList createEntities(Ogre::SceneNode *parentNode,
|
2013-01-06 04:54:57 +00:00
|
|
|
std::string name,
|
2012-07-17 20:40:03 +00:00
|
|
|
const std::string &group="General");
|
2013-02-06 01:55:12 +00:00
|
|
|
|
|
|
|
static bool createSkeleton(const std::string &name, const std::string &group="General");
|
2010-01-12 13:46:44 +00:00
|
|
|
};
|
|
|
|
|
2011-06-19 17:14:14 +00:00
|
|
|
}
|
|
|
|
|
2013-02-04 17:19:59 +00:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
// These operators allow extra data types to be stored in an Ogre::Any
|
|
|
|
// object, which can then be stored in user object bindings on the nodes
|
|
|
|
|
|
|
|
ostream& operator<<(ostream &o, const NifOgre::TextKeyMap&);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-01-12 13:46:44 +00:00
|
|
|
#endif
|