5 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version. The Blender
11 * Foundation also sells licenses for use in proprietary software under
12 * the Blender License. See http://www.blender.org/BL/ for information
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The Original Code is Copyright (C) 2004-2005 by Blender Foundation
25 * All rights reserved.
27 * The Original Code is: all of this file.
29 * Contributor(s): none yet.
31 * ***** END GPL/BL DUAL LICENSE BLOCK *****
33 #ifndef DNA_OBJECT_FORCE_H
34 #define DNA_OBJECT_FORCE_H
40 typedef struct PartDeflect {
41 short deflect; /* Deflection flag - does mesh deflect particles*/
42 short forcefield; /* Force field type, do the vertices attract / repel particles ? */
43 short flag; /* general settings flag */
44 short falloff; /* fall-off type*/
46 float pdef_damp; /* Damping factor for particle deflection */
47 float pdef_rdamp; /* Random element of damping for deflection */
48 float pdef_perm; /* Chance of particle passing through mesh */
49 float pdef_frict; /* Friction factor for particle deflection */
50 float pdef_rfrict; /* Random element of friction for deflection */
52 float f_strength; /* The strength of the force (+ or - ) */
53 float f_power; /* The power law - real gravitation is 2 (square) */
55 float f_damp; /* The dampening factor, currently only for harmonic force */
56 float maxdist; /* if indicated, use this maximum */
57 float mindist; /* if indicated, use this minimum */
58 float maxrad; /* radial versions of above */
60 float f_power_r; /* radial fall-off power*/
62 float pdef_sbdamp; /* Damping factor for softbody deflection */
63 float pdef_sbift; /* inner face thickness for softbody deflection */
64 float pdef_sboft; /* outer face thickness for softbody deflection */
66 /* variables for guide curve */
67 float clump_fac, clump_pow;
68 float kink_freq, kink_shape, kink_amp, free_end;
71 short tex_mode, kink, kink_axis, rt2;
72 struct Tex *tex; /* Texture of the texture effector */
76 typedef struct SBVertex {
80 typedef struct SoftBody {
81 struct ParticleSystem *particles; /* particlesystem softbody */
84 int totpoint, totspring;
85 struct BodyPoint *bpoint; /* not saved in file */
86 struct BodySpring *bspring; /* not saved in file */
87 float ctime; /* last time calculated */
92 float nodemass; /* softbody mass of *vertex* */
93 float grav; /* softbody amount of gravitaion to apply */
94 float mediafrict; /* friction to env */
95 float rklimit; /* error limit for ODE solver */
96 float physics_speed;/* user control over simulation speed */
99 float goalspring; /* softbody goal springs */
100 float goalfrict; /* softbody goal springs friction */
101 float mingoal; /* quick limits for goal */
103 float defgoal; /* default goal for vertices without vgroup */
104 short vertgroup; /* index starting at 1 */
106 short fuzzyness; /* */
109 float inspring; /* softbody inner springs */
110 float infrict; /* softbody inner springs friction */
115 short local, solverflags; /* local==1: use local coords for baking */
117 /* -- these must be kept for backwards compatibility -- */
118 SBVertex **keys; /* array of size totpointkey */
119 int totpointkey, totkey; /* if totpointkey != totpoint or totkey!- (efra-sfra)/interval -> free keys */
120 /* ---------------------------------------------------- */
124 float colball; /* fixed collision ball size if > 0 */
125 float balldamp; /* cooling down collision response */
126 float ballstiff; /* pressure the ball is loaded with */
135 struct SBScratch *scratch; /* scratch pad/cache on live time not saved in file */
138 /* pd->forcefield: Effector Fields types */
139 #define PFIELD_FORCE 1
140 #define PFIELD_VORTEX 2
141 #define PFIELD_MAGNET 3
142 #define PFIELD_WIND 4
143 #define PFIELD_GUIDE 5
144 #define PFIELD_TEXTURE 6
145 #define PFIELD_HARMONIC 7
146 #define PFIELD_NUCLEAR 8
147 #define PFIELD_MDIPOLE 9
150 /* pd->flag: various settings */
151 #define PFIELD_USEMAX 1
152 #define PDEFLE_DEFORM 2
153 #define PFIELD_GUIDE_PATH_ADD 4
154 #define PFIELD_PLANAR 8
155 #define PDEFLE_KILL_PART 16
156 #define PFIELD_POSZ 32
157 #define PFIELD_TEX_OBJECT 64
158 #define PFIELD_TEX_2D 128
159 #define PFIELD_USEMIN 256
160 #define PFIELD_USEMAXR 512
161 #define PFIELD_USEMINR 1024
164 #define PFIELD_FALL_SPHERE 0
165 #define PFIELD_FALL_TUBE 1
166 #define PFIELD_FALL_CONE 2
167 //reserved for near future
168 //#define PFIELD_FALL_INSIDE 3
171 #define PFIELD_TEX_RGB 0
172 #define PFIELD_TEX_GRAD 1
173 #define PFIELD_TEX_CURL 2
176 #define OB_SB_ENABLE 1
178 #define OB_SB_EDGES 4
179 #define OB_SB_QUADS 8
180 #define OB_SB_POSTDEF 16
181 #define OB_SB_REDO 32
182 #define OB_SB_BAKESET 64
183 #define OB_SB_BAKEDO 128
184 #define OB_SB_RESET 256
185 #define OB_SB_SELF 512
186 #define OB_SB_FACECOLL 1024
187 #define OB_SB_EDGECOLL 2048
188 #define OB_SB_COLLFINAL 4096
189 #define OB_SB_PROTECT_CACHE 8192
191 /* sb->solverflags */
192 #define SBSO_MONITOR 1
193 #define SBSO_OLDERR 2
196 #define SBC_MODE_MANUAL 0
197 #define SBC_MODE_AVG 1
198 #define SBC_MODE_MIN 2
199 #define SBC_MODE_MAX 3
200 #define SBC_MODE_AVGMINMAX 4