SO3Engine
|
ALConverterNodeAnim.cpp
Go to the documentation of this file.
16 ALConverterNodeAnim::ALConverterNodeAnim(ALScene* scene, aiAnimation* animation, aiNodeAnim* nodeAnim, aiNode* node, double tickPerSec)
81 unsigned int nbKey[3] = {mNodeAnim->mNumPositionKeys, mNodeAnim->mNumRotationKeys, mNodeAnim->mNumScalingKeys};
145 XMLkeyframe->SetAttribute("time", ConversionTools::formatFloatToString(keyframes[n].getTime()/mTickPerSec).c_str());
177 SNodeAnimation* animation = ogNode->CreateNodeAnimation(ALStringCleaner::cleanString(animName), static_cast<float>(ConversionTools::formatFloat(getTime())));
178 SAnimTrack* animationTrack = animation->CreateAnimationTrack(boost::str(boost::format("%1%") %animation->GetNumAnimationsTracks()));
183 unsigned int nbKey[3] = {mNodeAnim->mNumPositionKeys, mNodeAnim->mNumRotationKeys, mNodeAnim->mNumScalingKeys};
246 animationTrack->CreateKey(static_cast<float>(ConversionTools::formatFloat(keyframes[n].getTime()/mTickPerSec)), Ogre::Vector3(keypos.x, keypos.y, keypos.z), Ogre::Quaternion(keyquat.w, keyquat.x, keyquat.y, keyquat.z), Ogre::Vector3(keyscale.x, keyscale.y, keyscale.z));
static std::string cleanString(std::string str, bool toLower=true, bool clASCII=true, bool clSpaces=true, bool bUID=true)
Clean a string.
Definition ALStringCleaner.cpp:130
ALConverterNodeAnim(ALScene *scene, aiAnimation *animation, aiNodeAnim *nodeAnim, aiNode *node, double tickPerSec)
Definition ALConverterNodeAnim.cpp:16
~ALConverterNodeAnim()
Definition ALConverterNodeAnim.cpp:25
bool isAffected(aiString nodeName)
Definition ALConverterNodeAnim.cpp:30
void convert(tinyxml2::XMLElement *xmlAnimations, bool first=false)
Definition ALConverterNodeAnim.cpp:62
Definition ALKeyFrame.h:9
Definition ALScene.h:31
static float formatFloat(float val)
Definition SO3ConversionTools.cpp:682
static std::string formatFloatToString(double val)
Definition SO3ConversionTools.cpp:700
SAnimTrack * CreateAnimationTrack(const std::string &newAnimationTrackName)
Definition SO3Anim.cpp:145
Definition SO3AnimTrack.h:42
virtual void CreateKey(const float &timepos, const Ogre::Vector3 &pos, const Ogre::Quaternion &quat, const Ogre::Vector3 &scale)
Definition SO3AnimTrack.cpp:91
Definition SO3NodeAnimation.h:41
Definition SO3NodeScol.h:43
SNodeAnimation * CreateNodeAnimation(const std::string &animationName, const float &animationLength)
Definition SO3NodeScol.cpp:1051
Definition tinyxml2.h:1502
XMLElement * NewElement(const char *name)
Definition tinyxml2.h:1130
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
Definition tinyxml2.h:1303
const XMLDocument * GetDocument() const
Get the XMLDocument that owns this XMLNode.
Definition tinyxml2.h:592
XMLNode * InsertEndChild(XMLNode *addThis)
Definition SO3DataScol.h:38
Generated by 1.9.8