Blender V2.61 - r43446

TransformReader.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory.
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022  
00027 #ifndef __BC_TRANSFORMREADER_H__
00028 #define __BC_TRANSFORMREADER_H__
00029 
00030 #include "COLLADAFWNode.h"
00031 #include "COLLADAFWTransformation.h"
00032 #include "COLLADAFWTranslate.h"
00033 #include "COLLADAFWRotate.h"
00034 #include "COLLADAFWScale.h"
00035 #include "COLLADAFWMatrix.h"
00036 #include "COLLADAFWUniqueId.h"
00037 #include "Math/COLLADABUMathVector3.h"
00038 
00039 #include "DNA_object_types.h"
00040 #include "BLI_math.h"
00041 
00042 #include "collada_internal.h"
00043 
00044 //struct Object;
00045 
00046 class TransformReader : public TransformBase
00047 {
00048 protected:
00049 
00050     UnitConverter *unit_converter;
00051 
00052 public:
00053     struct Animation {
00054         Object *ob;
00055         COLLADAFW::Node *node;
00056         COLLADAFW::Transformation *tm; // which transform is animated by an AnimationList->id
00057     };
00058 
00059     TransformReader(UnitConverter* conv);
00060 
00061     void get_node_mat(float mat[][4], COLLADAFW::Node *node, std::map<COLLADAFW::UniqueId, Animation> *animation_map, Object *ob);
00062     
00063     void dae_rotate_to_mat4(COLLADAFW::Transformation *tm, float m[][4]);
00064     void dae_translate_to_mat4(COLLADAFW::Transformation *tm, float m[][4]);
00065     void dae_scale_to_mat4(COLLADAFW::Transformation *tm, float m[][4]);
00066     void dae_matrix_to_mat4(COLLADAFW::Transformation *tm, float m[][4]);
00067     void dae_translate_to_v3(COLLADAFW::Transformation *tm, float v[3]);
00068     void dae_scale_to_v3(COLLADAFW::Transformation *tm, float v[3]);
00069     void dae_vector3_to_v3(const COLLADABU::Math::Vector3 &v3, float v[3]);
00070 };
00071 
00072 #endif