3 #ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP
4 #define OPENMW_COMPONENTS_NIF_NIFKEY_HPP
34 template<
typename T, T (NIFStream::*getValue)()>
36 typedef std::map< float, KeyT<T> >
MapType;
59 if(count == 0 && !force)
71 for(
size_t i = 0;i < count;i++)
80 for(
size_t i = 0;i < count;i++)
89 for(
size_t i = 0;i < count;i++)
106 std::stringstream error;
107 error <<
"XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: "
115 nif->
file->
fail(
"Interpolation type 0 doesn't work with keys");
119 std::stringstream error;
128 key.
mValue = (nif.*getValue)();
131 template <
typename U>
163 #endif //#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP
static void readValue(NIFStream &nif, KeyT< T > &key)
Definition: nifkey.hpp:126
void fail(const std::string &msg) const override
Used if file parsing fails.
Definition: niffile.hpp:74
void read(NIFStream *nif, bool force=false)
Definition: nifkey.hpp:52
std::shared_ptr< QuaternionKeyMap > QuaternionKeyMapPtr
Definition: nifkey.hpp:160
T ValueType
Definition: nifkey.hpp:38
static void readQuadratic(NIFStream &nif, KeyT< U > &key)
Definition: nifkey.hpp:132
NIFFile *const file
Definition: nifstream.hpp:90
T mValue
Definition: nifkey.hpp:18
KeyMapT< osg::Vec3f,&NIFStream::getVector3 > Vector3KeyMap
Definition: nifkey.hpp:153
MapType mKeys
Definition: nifkey.hpp:47
std::map< float, KeyT< T > > MapType
Definition: nifkey.hpp:36
unsigned int mInterpolationType
Definition: nifkey.hpp:46
static void readTBC(NIFStream &nif, KeyT< T > &key)
Definition: nifkey.hpp:144
KeyMapT< float,&NIFStream::getFloat > FloatKeyMap
Definition: nifkey.hpp:152
KeyT< osg::Vec3f > Vector3Key
Definition: nifkey.hpp:30
std::shared_ptr< Vector4KeyMap > Vector4KeyMapPtr
Definition: nifkey.hpp:159
static const unsigned int sLinearInterpolation
Definition: nifkey.hpp:41
std::shared_ptr< Vector3KeyMap > Vector3KeyMapPtr
Definition: nifkey.hpp:158
static const unsigned int sXYZInterpolation
Definition: nifkey.hpp:44
KeyT< T > KeyType
Definition: nifkey.hpp:39
std::shared_ptr< FloatKeyMap > FloatKeyMapPtr
Definition: nifkey.hpp:157
KeyMapT()
Definition: nifkey.hpp:49
Definition: nifkey.hpp:17
KeyT< osg::Quat > QuaternionKey
Definition: nifkey.hpp:32
KeyMapT< osg::Vec4f,&NIFStream::getVector4 > Vector4KeyMap
Definition: nifkey.hpp:154
float getFloat()
Definition: nifstream.hpp:121
KeyT< float > FloatKey
Definition: nifkey.hpp:29
Definition: nifstream.hpp:83
unsigned int getUInt()
Definition: nifstream.hpp:116
KeyMapT< osg::Quat,&NIFStream::getQuaternion > QuaternionKeyMap
Definition: nifkey.hpp:155
Definition: nifkey.hpp:35
static const unsigned int sQuadraticInterpolation
Definition: nifkey.hpp:42
KeyT< osg::Vec4f > Vector4Key
Definition: nifkey.hpp:31
static const unsigned int sTBCInterpolation
Definition: nifkey.hpp:43
static void readQuadratic(NIFStream &nif, KeyT< osg::Quat > &key)
Definition: nifkey.hpp:139