Win64 fix: disable 1GB restriction for 64bit windows systems, baking fluid with ...
[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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 #ifndef BL_SHAPEDEFORMER
31 #define BL_SHAPEDEFORMER
32
33 #ifdef WIN32
34 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
35 #endif //WIN32
36
37 #include "BL_SkinDeformer.h"
38 #include "BL_DeformableGameObject.h"
39 #include <vector>
40
41 struct IpoCurve;
42
43 class BL_ShapeDeformer : public BL_SkinDeformer  
44 {
45 public:
46         virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
47         {
48                 void **h_obj = (*map)[m_gameobj];
49                 if (h_obj){
50                         m_gameobj = (BL_DeformableGameObject*)(*h_obj);
51                 }
52                 else
53                         m_gameobj=NULL;
54                 // relink the underlying skin deformer
55                 BL_SkinDeformer::Relink(map);
56         };
57         BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
58                      Object *bmeshobj,
59                      BL_SkinMeshObject *mesh)
60                                         :       
61                                                 BL_SkinDeformer(gameobj,bmeshobj, mesh),
62                                                 m_lastShapeUpdate(-1)
63         {
64         };
65
66         /* this second constructor is needed for making a mesh deformable on the fly. */
67         BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
68                                         struct Object *bmeshobj_old,
69                                         struct Object *bmeshobj_new,
70                                         class BL_SkinMeshObject *mesh,
71                                         bool release_object,
72                                         BL_ArmatureObject* arma = NULL)
73                                         :
74                                                 BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, arma),
75                                                 m_lastShapeUpdate(-1)
76         {
77         };
78
79         virtual void ProcessReplica();
80         virtual RAS_Deformer *GetReplica();
81         virtual ~BL_ShapeDeformer();
82
83         bool Update (void);
84         bool LoadShapeDrivers(Object* arma);
85         bool ExecuteShapeDrivers(void);
86
87         void ForceUpdate()
88         {
89                 m_lastShapeUpdate = -1.0;
90         };
91
92 protected:
93         vector<IpoCurve*>                m_shapeDrivers;
94         double                                   m_lastShapeUpdate;
95
96 };
97
98 #endif
99