3 #ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP
4 #define OPENMW_COMPONENTS_NIF_NIFKEY_HPP
11 #include <boost/shared_ptr.hpp>
36 template<
typename T, T (NIFStream::*getValue)()>
38 typedef std::map< float, KeyT<T> >
MapType;
61 if(count == 0 && !force)
73 for(
size_t i = 0;i < count;i++)
82 for(
size_t i = 0;i < count;i++)
91 for(
size_t i = 0;i < count;i++)
108 std::stringstream error;
109 error <<
"XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: "
117 nif->
file->
fail(
"Interpolation type 0 doesn't work with keys");
121 std::stringstream error;
130 key.
mValue = (nif.*getValue)();
133 template <
typename U>
165 #endif //#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP
static void readValue(NIFStream &nif, KeyT< T > &key)
Definition: nifkey.hpp:128
void read(NIFStream *nif, bool force=false)
Definition: nifkey.hpp:54
boost::shared_ptr< FloatKeyMap > FloatKeyMapPtr
Definition: nifkey.hpp:159
T ValueType
Definition: nifkey.hpp:40
static void readQuadratic(NIFStream &nif, KeyT< U > &key)
Definition: nifkey.hpp:134
NIFFile *const file
Definition: nifstream.hpp:38
T mValue
Definition: nifkey.hpp:20
KeyMapT< osg::Vec3f,&NIFStream::getVector3 > Vector3KeyMap
Definition: nifkey.hpp:155
MapType mKeys
Definition: nifkey.hpp:49
std::map< float, KeyT< T > > MapType
Definition: nifkey.hpp:38
unsigned int mInterpolationType
Definition: nifkey.hpp:48
static void readTBC(NIFStream &nif, KeyT< T > &key)
Definition: nifkey.hpp:146
KeyMapT< float,&NIFStream::getFloat > FloatKeyMap
Definition: nifkey.hpp:154
KeyT< osg::Vec3f > Vector3Key
Definition: nifkey.hpp:32
boost::shared_ptr< Vector3KeyMap > Vector3KeyMapPtr
Definition: nifkey.hpp:160
static const unsigned int sLinearInterpolation
Definition: nifkey.hpp:43
void fail(const std::string &msg) const
Used if file parsing fails.
Definition: niffile.hpp:51
static const unsigned int sXYZInterpolation
Definition: nifkey.hpp:46
KeyT< T > KeyType
Definition: nifkey.hpp:41
KeyMapT()
Definition: nifkey.hpp:51
Definition: nifkey.hpp:19
boost::shared_ptr< Vector4KeyMap > Vector4KeyMapPtr
Definition: nifkey.hpp:161
KeyT< osg::Quat > QuaternionKey
Definition: nifkey.hpp:34
boost::shared_ptr< QuaternionKeyMap > QuaternionKeyMapPtr
Definition: nifkey.hpp:162
KeyMapT< osg::Vec4f,&NIFStream::getVector4 > Vector4KeyMap
Definition: nifkey.hpp:156
float getFloat()
Definition: nifstream.hpp:49
KeyT< float > FloatKey
Definition: nifkey.hpp:31
Definition: nifstream.hpp:26
unsigned int getUInt()
Definition: nifstream.hpp:48
KeyMapT< osg::Quat,&NIFStream::getQuaternion > QuaternionKeyMap
Definition: nifkey.hpp:157
Definition: nifkey.hpp:37
static const unsigned int sQuadraticInterpolation
Definition: nifkey.hpp:44
KeyT< osg::Vec4f > Vector4Key
Definition: nifkey.hpp:33
static const unsigned int sTBCInterpolation
Definition: nifkey.hpp:45
static void readQuadratic(NIFStream &nif, KeyT< osg::Quat > &key)
Definition: nifkey.hpp:141