Blender  V3.3
DNA_object_force_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2004-2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_defs.h"
11 #include "DNA_listBase.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 struct BodySpring;
18 
20 typedef enum ePFieldType {
49 
50  /* Keep last. */
53 
54 typedef struct PartDeflect {
56  int flag;
58  short deflect;
60  short forcefield;
62  short falloff;
64  short shape;
66  short tex_mode;
68  short kink, kink_axis;
69  short zdir;
70 
71  /* Main effector values */
73  float f_strength;
75  float f_damp;
79  float f_flow;
82 
83  char _pad0[4];
84 
86  float f_size;
87 
88  /* fall-off */
90  float f_power;
92  float maxdist;
94  float mindist;
96  float f_power_r;
98  float maxrad;
99  float minrad;
100 
101  /* particle collisions */
103  float pdef_damp;
105  float pdef_rdamp;
107  float pdef_perm;
109  float pdef_frict;
111  float pdef_rfrict;
114 
116  float absorption;
117 
118  /* softbody collisions */
120  float pdef_sbdamp;
122  float pdef_sbift;
124  float pdef_sboft;
125 
126  /* guide curve, same as for particle child effects */
129 
130  /* texture effector */
132  float tex_nabla;
134  struct Tex *tex;
135 
136  /* effector noise */
138  struct RNG *rng;
140  float f_noise;
142  int seed;
143 
144  /* Display Size */
146  float drawvec1[4];
148  float drawvec2[4];
151  char _pad1[4];
154  char _pad2[4];
155 
157  struct Object *f_source;
158 
160  float pdef_cfrict;
161  char _pad[4];
163 
164 typedef struct EffectorWeights {
166  struct Collection *group;
167 
169  float weight[14];
171  short flag;
172  char _pad[2];
174 
175 /* EffectorWeights->flag */
176 #define EFF_WEIGHT_DO_HAIR 1
177 
178 typedef struct SBVertex {
179  float vec[4];
181 
182 /* Container for data that is shared among CoW copies.
183  *
184  * This is placed in a separate struct so that values can be changed
185  * without having to update all CoW copies. */
186 typedef struct SoftBody_Shared {
188  struct ListBase ptcaches;
190 
191 typedef struct SoftBody {
192  /* dynamic data */
195  struct BodyPoint *bpoint;
198  char _pad;
199  char msg_lock;
200  short msg_value;
201 
202  /* part of UI: */
203 
204  /* general options */
206  float nodemass;
212  char namedVG_Mass[64];
214  float grav;
216  float mediafrict;
218  float rklimit;
221 
222  /* goal */
224  float goalspring;
226  float goalfrict;
228  float mingoal;
229  float maxgoal;
231  float defgoal;
233  short vertgroup;
239 
240  short fuzzyness;
241 
242  /* springs */
244  float inspring;
246  float infrict;
254 
255  /* baking */
256  char _pad1[6];
259 
260  /* -- these must be kept for backwards compatibility -- */
265  /* ---------------------------------------------------- */
267 
268  /* Self collision. */
270  float colball;
272  float balldamp;
274  float ballstiff;
275  short sbc_mode;
276  short aeroedge;
277  short minloops;
278  short maxloops;
279  short choke;
280  short solver_ID;
281  short plastic;
283 
286  float shearstiff;
287  float inpush;
288 
291  struct PointCache *pointcache DNA_DEPRECATED;
293  struct ListBase ptcaches DNA_DEPRECATED;
294 
296 
298  /* Reverse estimated object-matrix (run-time data, no need to store in the file). */
299  float lcom[3];
300  float lrot[3][3];
301  float lscale[3][3];
302 
305 
306 /* pd->flag: various settings */
307 #define PFIELD_USEMAX (1 << 0)
308 // #define PDEFLE_DEFORM (1 << 1) /* UNUSED */
310 #define PFIELD_GUIDE_PATH_ADD (1 << 2)
312 #define PFIELD_PLANAR (1 << 3)
313 #define PDEFLE_KILL_PART (1 << 4)
315 #define PFIELD_POSZ (1 << 5)
316 #define PFIELD_TEX_OBJECT (1 << 6)
318 #define PFIELD_GLOBAL_CO (1 << 6)
319 #define PFIELD_TEX_2D (1 << 7)
321 #define PFIELD_MULTIPLE_SPRINGS (1 << 7)
322 #define PFIELD_USEMIN (1 << 8)
323 #define PFIELD_USEMAXR (1 << 9)
324 #define PFIELD_USEMINR (1 << 10)
325 #define PFIELD_TEX_ROOTCO (1 << 11)
327 #define PFIELD_SURFACE (1 << 12)
328 #define PFIELD_VISIBILITY (1 << 13)
329 #define PFIELD_DO_LOCATION (1 << 14)
330 #define PFIELD_DO_ROTATION (1 << 15)
332 #define PFIELD_GUIDE_PATH_WEIGHT (1 << 16)
334 #define PFIELD_SMOKE_DENSITY (1 << 17)
336 #define PFIELD_GRAVITATION (1 << 18)
338 #define PFIELD_CLOTH_USE_CULLING (1 << 19)
340 #define PFIELD_CLOTH_USE_NORMAL (1 << 20)
341 
342 /* pd->falloff */
343 #define PFIELD_FALL_SPHERE 0
344 #define PFIELD_FALL_TUBE 1
345 #define PFIELD_FALL_CONE 2
346 
347 /* pd->shape */
348 #define PFIELD_SHAPE_POINT 0
349 #define PFIELD_SHAPE_PLANE 1
350 #define PFIELD_SHAPE_SURFACE 2
351 #define PFIELD_SHAPE_POINTS 3
352 #define PFIELD_SHAPE_LINE 4
353 
354 /* pd->tex_mode */
355 #define PFIELD_TEX_RGB 0
356 #define PFIELD_TEX_GRAD 1
357 #define PFIELD_TEX_CURL 2
358 
359 /* pd->zdir */
360 #define PFIELD_Z_BOTH 0
361 #define PFIELD_Z_POS 1
362 #define PFIELD_Z_NEG 2
363 
364 /* ob->softflag */
365 #define OB_SB_ENABLE 1 /* deprecated, use modifier */
366 #define OB_SB_GOAL 2
367 #define OB_SB_EDGES 4
368 #define OB_SB_QUADS 8
369 #define OB_SB_POSTDEF 16
370 // #define OB_SB_REDO 32
371 // #define OB_SB_BAKESET 64
372 // #define OB_SB_BAKEDO 128
373 // #define OB_SB_RESET 256
374 #define OB_SB_SELF 512
375 #define OB_SB_FACECOLL 1024
376 #define OB_SB_EDGECOLL 2048
377 /* #define OB_SB_COLLFINAL 4096 */ /* deprecated */
378 /* #define OB_SB_BIG_UI 8192 */ /* deprecated */
379 #define OB_SB_AERO_ANGLE 16384
380 
381 /* sb->solverflags */
382 #define SBSO_MONITOR 1
383 #define SBSO_OLDERR 2
384 #define SBSO_ESTIMATEIPO 4
385 
386 /* sb->sbc_mode */
387 #define SBC_MODE_MANUAL 0
388 #define SBC_MODE_AVG 1
389 #define SBC_MODE_MIN 2
390 #define SBC_MODE_MAX 3
391 #define SBC_MODE_AVGMINMAX 4
392 
393 #ifdef __cplusplus
394 }
395 #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:33
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