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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 *****
28 * BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
31 #ifndef BIF_MESHLAPLACIAN_H
32 #define BIF_MESHLAPLACIAN_H
34 //#define RIGID_DEFORM
40 struct MeshDeformModifierData;
46 /* Laplacian System */
48 struct LaplacianSystem;
49 typedef struct LaplacianSystem LaplacianSystem;
51 LaplacianSystem *laplacian_construct_begin(int totvert, int totface, int lsq);
53 void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned);
54 void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3);
56 void laplacian_construct_end(LaplacianSystem *sys);
57 void laplacian_delete(LaplacianSystem *sys);
59 void laplacian_begin_solve(LaplacianSystem *sys, int index);
60 void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value);
61 int laplacian_system_solve(LaplacianSystem *sys);
62 float laplacian_system_get_solution(int v);
66 void heat_bone_weighting(struct Object *ob, struct Mesh *me, float (*verts)[3],
67 int numbones, struct bDeformGroup **dgrouplist,
68 struct bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3],
72 /* As-Rigid-As-Possible Deformation */
74 void rigid_deform_begin(struct EditMesh *em);
75 void rigid_deform_iteration(void);
76 void rigid_deform_end(int cancel);
79 /* Harmonic Coordinates */
81 void harmonic_coordinates_bind(struct Scene *scene, struct MeshDeformModifierData *mmd,
82 float (*vertexcos)[3], int totvert, float cagemat[][4]);