doxygen: prevent GPL license block from being parsed as doxygen comment.
[blender.git] / source / gameengine / Converter / BL_ShapeDeformer.h
1 /*
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 /** \file BL_ShapeDeformer.h
31  *  \ingroup bgeconv
32  */
33
34 #ifndef BL_SHAPEDEFORMER
35 #define BL_SHAPEDEFORMER
36
37 #if defined(WIN32) && !defined(FREE_WINDOWS)
38 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
39 #endif //WIN32
40
41 #include "BL_SkinDeformer.h"
42 #include "BL_DeformableGameObject.h"
43 #include <vector>
44
45 struct IpoCurve;
46
47 class BL_ShapeDeformer : public BL_SkinDeformer  
48 {
49 public:
50         BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
51                      Object *bmeshobj,
52                      RAS_MeshObject *mesh)
53                                         :       
54                                                 BL_SkinDeformer(gameobj,bmeshobj, mesh),
55                                                 m_lastShapeUpdate(-1)
56         {
57         };
58
59         /* this second constructor is needed for making a mesh deformable on the fly. */
60         BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
61                                         struct Object *bmeshobj_old,
62                                         struct Object *bmeshobj_new,
63                                         class RAS_MeshObject *mesh,
64                                         bool release_object,
65                                         bool recalc_normal,
66                                         BL_ArmatureObject* arma = NULL)
67                                         :
68                                                 BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, recalc_normal, arma),
69                                                 m_lastShapeUpdate(-1)
70         {
71         };
72
73         virtual RAS_Deformer *GetReplica();
74         virtual void ProcessReplica();
75         virtual ~BL_ShapeDeformer();
76
77         bool Update (void);
78         bool LoadShapeDrivers(Object* arma);
79         bool ExecuteShapeDrivers(void);
80
81         void ForceUpdate()
82         {
83                 m_lastShapeUpdate = -1.0;
84         };
85
86 protected:
87         vector<IpoCurve*>                m_shapeDrivers;
88         double                                   m_lastShapeUpdate;
89
90
91 #ifdef WITH_CXX_GUARDEDALLOC
92 public:
93         void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); }
94         void operator delete( void *mem ) { MEM_freeN(mem); }
95 #endif
96 };
97
98 #endif
99