From 5b462d484b01753026076158b0cd98a7f288dafd Mon Sep 17 00:00:00 2001 From: jonathanklein Date: Sun, 3 Jun 2012 11:06:47 +0000 Subject: [PATCH] Ogre: small tweaks git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1253 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/OgreMaterial.cpp | 4 ---- code/OgreSkeleton.cpp | 14 ++++++-------- doc/dox.h | 6 +++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/code/OgreMaterial.cpp b/code/OgreMaterial.cpp index 64de3a861..eab92ad48 100644 --- a/code/OgreMaterial.cpp +++ b/code/OgreMaterial.cpp @@ -51,10 +51,6 @@ to make it shorter easier to maintain. #include using namespace std; -//#include "boost/format.hpp" -//#include "boost/foreach.hpp" -//using namespace boost; - #include "OgreImporter.hpp" #include "irrXMLWrapper.h" #include "TinyFormatter.h" diff --git a/code/OgreSkeleton.cpp b/code/OgreSkeleton.cpp index c045b2d4f..567a22fb7 100644 --- a/code/OgreSkeleton.cpp +++ b/code/OgreSkeleton.cpp @@ -169,7 +169,7 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector &Bones, vecto Bones[ChildId].ParentId=ParentId; Bones[ParentId].Children.push_back(ChildId); - XmlRead(SkeletonFile);//i once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks?? + XmlRead(SkeletonFile);//I once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks?? } //_____________________________________________________________________________ @@ -218,7 +218,7 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector &Bones, vecto //loop over the attributes: - while(true) + while(true) //will quit, if a Node is not a animationkey { XmlRead(SkeletonFile); @@ -268,12 +268,9 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector &Bones, vecto break; } - NewTrack.Keyframes.push_back(NewKeyframe); - //XmlRead(SkeletonFile); } - NewAnimation.Tracks.push_back(NewTrack); } @@ -295,7 +292,7 @@ void OgreImporter::CreateAssimpSkeleton(const std::vector &Bones, const st //Createt the assimp bone hierarchy vector RootBoneNodes; - BOOST_FOREACH(Bone theBone, Bones) + BOOST_FOREACH(const Bone &theBone, Bones) { if(-1==theBone.ParentId) //the bone is a root bone { @@ -304,7 +301,8 @@ void OgreImporter::CreateAssimpSkeleton(const std::vector &Bones, const st } } - if (RootBoneNodes.size()) { + if(RootBoneNodes.size() > 0) + { m_CurrentScene->mRootNode->mNumChildren=RootBoneNodes.size(); m_CurrentScene->mRootNode->mChildren=new aiNode*[RootBoneNodes.size()]; memcpy(m_CurrentScene->mRootNode->mChildren, &RootBoneNodes[0], sizeof(aiNode*)*RootBoneNodes.size()); @@ -359,7 +357,7 @@ void OgreImporter::PutAnimationsInScene(const std::vector &Bones, const st aiMatrix4x4 PoseToKey= aiMatrix4x4::Translation(Animations[i].Tracks[j].Keyframes[k].Position, t3) //pos * aiMatrix4x4(Animations[i].Tracks[j].Keyframes[k].Rotation.GetMatrix()) //rot - * aiMatrix4x4::Scaling(Animations[i].Tracks[j].Keyframes[k].Scaling, t2); //scale + * aiMatrix4x4::Scaling(Animations[i].Tracks[j].Keyframes[k].Scaling, t2); //scale //calculate the complete transformation from world space to bone space diff --git a/doc/dox.h b/doc/dox.h index 221599979..1477139e4 100644 --- a/doc/dox.h +++ b/doc/dox.h @@ -1427,11 +1427,11 @@ IFC support is new and considered experimental. Please report any bugs you may e This section contains implementations notes for the OgreXML importer. @subsection overview Overview -Ogre importer is currently optimized for the Blender Ogre exporter, because thats the only one that i use. You can find the Blender Ogre exporter at: http://www.ogre3d.org/forums/viewtopic.php?f=8&t=45922 +Ogre importer is currently optimized for the Blender Ogre exporter, because thats the only one that I use. You can find the Blender Ogre exporter at: http://www.ogre3d.org/forums/viewtopic.php?f=8&t=45922 @subsection what What will be loaded? -Mesh: Faces, Positions, Normals and one Uv pair. The Materialname will be used to load the material. +Mesh: Faces, Positions, Normals and all TexCoords. The Materialname will be used to load the material. Material: The right material in the file will be searched, the importer should work with materials who have 1 technique and 1 pass in this technique. From there, the texturename (for 1 color- and 1 normalmap) and the @@ -1477,7 +1477,7 @@ Just look in OgreImporterMaterial.cpp - Load colors in custom materials - extend custom and normal material loading - fix bone hierarchy bug -- tes everything elaboratly +- test everything elaboratly - check for non existent animation keys (what happens if a one time not all bones have a key?) */