/* OpenMW - The completely unofficial reimplementation of Morrowind Copyright (C) 2008-2010 Nicolay Korslund Email: < korslund@gmail.com > WWW: http://openmw.sourceforge.net/ This file (data.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 OPENMW_COMPONENTS_NIF_DATA_HPP #define OPENMW_COMPONENTS_NIF_DATA_HPP #include "base.hpp" #include "niftypes.hpp" // Transformation namespace Nif { // Common ancestor for several data classes class ShapeData : public Record { public: std::vector vertices, normals; std::vector colors; std::vector< std::vector > uvlist; osg::Vec3f center; float radius; void read(NIFStream *nif); }; class NiTriShapeData : public ShapeData { public: // Triangles, three vertex indices per triangle std::vector triangles; void read(NIFStream *nif); }; class NiAutoNormalParticlesData : public ShapeData { public: int numParticles; float particleRadius; int activeCount; std::vector sizes; void read(NIFStream *nif); }; class NiRotatingParticlesData : public NiAutoNormalParticlesData { public: std::vector rotations; void read(NIFStream *nif); }; class NiPosData : public Record { public: Vector3KeyMap mKeyList; void read(NIFStream *nif); }; class NiUVData : public Record { public: FloatKeyMap mKeyList[4]; void read(NIFStream *nif); }; class NiFloatData : public Record { public: FloatKeyMap mKeyList; void read(NIFStream *nif); }; class NiPixelData : public Record { public: unsigned int rmask, gmask, bmask, amask; int bpp, mips; void read(NIFStream *nif); }; class NiColorData : public Record { public: Vector4KeyMap mKeyMap; void read(NIFStream *nif); }; class NiVisData : public Record { public: struct VisData { float time; char isSet; }; std::vector mVis; void read(NIFStream *nif); }; class NiSkinInstance : public Record { public: NiSkinDataPtr data; NodePtr root; NodeList bones; void read(NIFStream *nif); void post(NIFFile *nif); }; class NiSkinData : public Record { public: struct VertWeight { short vertex; float weight; }; struct BoneInfo { Transformation trafo; osg::Vec4f unknown; std::vector weights; }; Transformation trafo; std::vector bones; void read(NIFStream *nif); }; struct NiMorphData : public Record { struct MorphData { FloatKeyMap mData; std::vector mVertices; }; std::vector mMorphs; void read(NIFStream *nif); }; struct NiKeyframeData : public Record { QuaternionKeyMap mRotations; FloatKeyMap mXRotations; FloatKeyMap mYRotations; FloatKeyMap mZRotations; Vector3KeyMap mTranslations; FloatKeyMap mScales; void read(NIFStream *nif); }; } // Namespace #endif