Blender  V2.93
DNA_object_force_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2004-2005 by Blender Foundation
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_defs.h"
27 #include "DNA_listBase.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* pd->forcefield: Effector Fields types */
34 typedef enum ePFieldType {
63 
64  /* Keep last. */
67 
68 typedef struct PartDeflect {
70  int flag;
72  short deflect;
74  short forcefield;
76  short falloff;
78  short shape;
80  short tex_mode;
82  short kink, kink_axis;
83  short zdir;
84 
85  /* Main effector values */
87  float f_strength;
89  float f_damp;
93  float f_flow;
96 
97  char _pad0[4];
98 
100  float f_size;
101 
102  /* fall-off */
104  float f_power;
106  float maxdist;
108  float mindist;
110  float f_power_r;
112  float maxrad;
113  float minrad;
114 
115  /* particle collisions */
117  float pdef_damp;
119  float pdef_rdamp;
121  float pdef_perm;
123  float pdef_frict;
125  float pdef_rfrict;
128 
130  float absorption;
131 
132  /* softbody collisions */
134  float pdef_sbdamp;
136  float pdef_sbift;
138  float pdef_sboft;
139 
140  /* guide curve, same as for particle child effects */
143 
144  /* texture effector */
146  float tex_nabla;
148  struct Tex *tex;
149 
150  /* effector noise */
152  struct RNG *rng;
154  float f_noise;
156  int seed;
157 
158  /* Display Size */
160  float drawvec1[4];
162  float drawvec2[4];
165  char _pad1[4];
168  char _pad2[4];
169 
171  struct Object *f_source;
172 
174  float pdef_cfrict;
175  char _pad[4];
177 
178 typedef struct EffectorWeights {
180  struct Collection *group;
181 
183  float weight[14];
185  short flag, rt[3];
186  char _pad[4];
188 
189 /* EffectorWeights->flag */
190 #define EFF_WEIGHT_DO_HAIR 1
191 
192 typedef struct SBVertex {
193  float vec[4];
195 
196 /* Container for data that is shared among CoW copies.
197  *
198  * This is placed in a separate struct so that values can be changed
199  * without having to update all CoW copies. */
200 typedef struct SoftBody_Shared {
202  struct ListBase ptcaches;
204 
205 typedef struct SoftBody {
206  /* dynamic data */
209  struct BodyPoint *bpoint;
212  char _pad;
213  char msg_lock;
214  short msg_value;
215 
216  /* part of UI: */
217 
218  /* general options */
220  float nodemass;
226  char namedVG_Mass[64];
228  float grav;
230  float mediafrict;
232  float rklimit;
235 
236  /* goal */
238  float goalspring;
240  float goalfrict;
242  float mingoal;
243  float maxgoal;
245  float defgoal;
247  short vertgroup;
253 
254  short fuzzyness;
255 
256  /* springs */
258  float inspring;
260  float infrict;
268 
269  /* baking */
270  int sfra, efra;
271  int interval;
274 
275  /* -- these must be kept for backwards compatibility -- */
280  /* ---------------------------------------------------- */
282 
283  /* self collision*/
285  float colball;
287  float balldamp;
289  float ballstiff;
290  short sbc_mode;
291  short aeroedge;
292  short minloops;
293  short maxloops;
294  short choke;
295  short solver_ID;
296  short plastic;
298 
301  float shearstiff;
302  float inpush;
303 
306  struct PointCache *pointcache DNA_DEPRECATED;
308  struct ListBase ptcaches DNA_DEPRECATED;
309 
311 
313  /* Reverse estimated object-matrix (run-time data, no need to store in the file). */
314  float lcom[3];
315  float lrot[3][3];
316  float lscale[3][3];
317 
320 
321 /* pd->flag: various settings */
322 #define PFIELD_USEMAX (1 << 0)
323 /*#define PDEFLE_DEFORM (1 << 1)*/ /*UNUSED*/
325 #define PFIELD_GUIDE_PATH_ADD (1 << 2)
327 #define PFIELD_PLANAR (1 << 3)
328 #define PDEFLE_KILL_PART (1 << 4)
330 #define PFIELD_POSZ (1 << 5)
331 #define PFIELD_TEX_OBJECT (1 << 6)
333 #define PFIELD_GLOBAL_CO (1 << 6)
334 #define PFIELD_TEX_2D (1 << 7)
336 #define PFIELD_MULTIPLE_SPRINGS (1 << 7)
337 #define PFIELD_USEMIN (1 << 8)
338 #define PFIELD_USEMAXR (1 << 9)
339 #define PFIELD_USEMINR (1 << 10)
340 #define PFIELD_TEX_ROOTCO (1 << 11)
342 #define PFIELD_SURFACE (1 << 12)
343 #define PFIELD_VISIBILITY (1 << 13)
344 #define PFIELD_DO_LOCATION (1 << 14)
345 #define PFIELD_DO_ROTATION (1 << 15)
347 #define PFIELD_GUIDE_PATH_WEIGHT (1 << 16)
349 #define PFIELD_SMOKE_DENSITY (1 << 17)
351 #define PFIELD_GRAVITATION (1 << 18)
353 #define PFIELD_CLOTH_USE_CULLING (1 << 19)
355 #define PFIELD_CLOTH_USE_NORMAL (1 << 20)
356 
357 /* pd->falloff */
358 #define PFIELD_FALL_SPHERE 0
359 #define PFIELD_FALL_TUBE 1
360 #define PFIELD_FALL_CONE 2
361 
362 /* pd->shape */
363 #define PFIELD_SHAPE_POINT 0
364 #define PFIELD_SHAPE_PLANE 1
365 #define PFIELD_SHAPE_SURFACE 2
366 #define PFIELD_SHAPE_POINTS 3
367 #define PFIELD_SHAPE_LINE 4
368 
369 /* pd->tex_mode */
370 #define PFIELD_TEX_RGB 0
371 #define PFIELD_TEX_GRAD 1
372 #define PFIELD_TEX_CURL 2
373 
374 /* pd->zdir */
375 #define PFIELD_Z_BOTH 0
376 #define PFIELD_Z_POS 1
377 #define PFIELD_Z_NEG 2
378 
379 /* ob->softflag */
380 #define OB_SB_ENABLE 1 /* deprecated, use modifier */
381 #define OB_SB_GOAL 2
382 #define OB_SB_EDGES 4
383 #define OB_SB_QUADS 8
384 #define OB_SB_POSTDEF 16
385 // #define OB_SB_REDO 32
386 // #define OB_SB_BAKESET 64
387 // #define OB_SB_BAKEDO 128
388 // #define OB_SB_RESET 256
389 #define OB_SB_SELF 512
390 #define OB_SB_FACECOLL 1024
391 #define OB_SB_EDGECOLL 2048
392 /* #define OB_SB_COLLFINAL 4096 */ /* deprecated */
393 /* #define OB_SB_BIG_UI 8192 */ /* deprecated */
394 #define OB_SB_AERO_ANGLE 16384
395 
396 /* sb->solverflags */
397 #define SBSO_MONITOR 1
398 #define SBSO_OLDERR 2
399 #define SBSO_ESTIMATEIPO 4
400 
401 /* sb->sbc_mode */
402 #define SBC_MODE_MANUAL 0
403 #define SBC_MODE_AVG 1
404 #define SBC_MODE_MIN 2
405 #define SBC_MODE_MAX 3
406 #define SBC_MODE_AVGMINMAX 4
407 
408 #ifdef __cplusplus
409 }
410 #endif
These structs are the foundation for all linked lists in the library system.
struct SoftBody_Shared SoftBody_Shared
struct EffectorWeights EffectorWeights
@ NUM_PFIELD_TYPES
@ PFIELD_MAGNET
@ PFIELD_FLUIDFLOW
@ PFIELD_FORCE
@ PFIELD_CHARGE
@ PFIELD_HARMONIC
@ PFIELD_TURBULENCE
@ PFIELD_GUIDE
@ PFIELD_LENNARDJ
@ PFIELD_VORTEX
@ PFIELD_TEXTURE
struct SBVertex SBVertex
struct PartDeflect PartDeflect
struct SoftBody SoftBody
struct Collection * group
float drawvec_falloff_max[3]
float drawvec_falloff_min[3]
struct Object * f_source
Definition: rand.cc:48
struct PointCache * pointcache
struct ListBase ptcaches
char namedVG_Softgoal[64]
float lscale[3][3]
float lrot[3][3]
SBVertex ** keys
struct SoftBody_Shared * shared
struct PointCache *pointcache DNA_DEPRECATED
struct Collection * collision_group
struct EffectorWeights * effector_weights
char namedVG_Spring_K[64]
struct BodySpring * bspring
struct SBScratch * scratch
struct BodyPoint * bpoint