4 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
30 #ifndef BL_MODIFIERDEFORMER
31 #define BL_MODIFIERDEFORMER
33 #if defined(WIN32) && !defined(FREE_WINDOWS)
34 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
37 #include "BL_ShapeDeformer.h"
38 #include "BL_DeformableGameObject.h"
44 class BL_ModifierDeformer : public BL_ShapeDeformer
47 static bool HasCompatibleDeformer(Object *ob);
48 static bool HasArmatureDeformer(Object *ob);
51 BL_ModifierDeformer(BL_DeformableGameObject *gameobj,
56 BL_ShapeDeformer(gameobj,bmeshobj, mesh),
57 m_lastModifierUpdate(-1),
61 m_recalcNormal = false;
64 /* this second constructor is needed for making a mesh deformable on the fly. */
65 BL_ModifierDeformer(BL_DeformableGameObject *gameobj,
67 struct Object *bmeshobj_old,
68 struct Object *bmeshobj_new,
69 class RAS_MeshObject *mesh,
71 BL_ArmatureObject* arma = NULL)
73 BL_ShapeDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, false, arma),
74 m_lastModifierUpdate(-1),
80 virtual void ProcessReplica();
81 virtual RAS_Deformer *GetReplica();
82 virtual ~BL_ModifierDeformer();
83 virtual bool UseVertexArray()
89 bool Apply(RAS_IPolyMaterial *mat);
92 m_lastModifierUpdate = -1.0;
94 virtual struct DerivedMesh* GetFinalMesh()
101 double m_lastModifierUpdate;
106 #ifdef WITH_CXX_GUARDEDALLOC
108 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); }
109 void operator delete( void *mem ) { MEM_freeN(mem); }