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