Blender V5.3
DNA_object_force_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_enum_flags.hh"
12
13#include "DNA_defs.h"
14#include "DNA_listBase.h"
15
16namespace blender {
17
18struct BodySpring;
19
25
26
27enum ePField_Flag : int {
28 PFIELD_USEMAX = 1 << 0,
29 // PDEFLE_DEFORM = 1 << 1, /* UNUSED */
33 PFIELD_PLANAR = 1 << 3,
36 PFIELD_POSZ = 1 << 5,
40 PFIELD_TEX_2D = 1 << 7,
43 PFIELD_USEMIN = 1 << 8,
45 PFIELD_USEMINR = 1 << 10,
48 PFIELD_SURFACE = 1 << 12,
62};
64
65
71
80
87
94
96enum eSoftBody_Flag : int {
97 OB_SB_ENABLE = 1 << 0, /* Deprecated (use modifier). */
98 OB_SB_GOAL = 1 << 1,
99 OB_SB_EDGES = 1 << 2,
100 OB_SB_QUADS = 1 << 3,
102 // OB_SB_REDO = 1 << 5,
103 // OB_SB_BAKESET = 1 << 6,
104 // OB_SB_BAKEDO = 1 << 7,
105 // OB_SB_RESET = 1 << 8,
106 OB_SB_SELF = 1 << 9,
107 OB_SB_FACECOLL = 1 << 10,
108 OB_SB_EDGECOLL = 1 << 11,
109 // OB_SB_COLLFINAL = 1 << 12, /* Deprecated. */
110 // OB_SB_BIG_UI = 1 << 13, /* Deprecated. */
112};
114
115
117 SBSO_MONITOR = 1 << 0,
118 SBSO_OLDERR = 1 << 1,
120};
122
123
131
166
171 short deflect = 0;
181 short kink = 0, kink_axis = 0;
183
184 /* Main effector values */
186 float f_strength = 0;
188 float f_damp = 0;
192 float f_flow = 0;
194 float f_wind_factor = 0;
195
196 char _pad0[4] = {};
197
199 float f_size = 0;
200
201 /* fall-off */
203 float f_power = 0;
205 float maxdist = 0;
207 float mindist = 0;
209 float f_power_r = 0;
211 float maxrad = 0;
212 float minrad = 0;
213
214 /* particle collisions */
216 float pdef_damp = 0;
218 float pdef_rdamp = 0;
220 float pdef_perm = 0;
222 float pdef_frict = 0;
224 float pdef_rfrict = 0;
226 float pdef_stickness = 0;
227
229 float absorption = 0;
230
231 /* softbody collisions */
233 float pdef_sbdamp = 0;
235 float pdef_sbift = 0;
237 float pdef_sboft = 0;
238
239 /* guide curve, same as for particle child effects */
240 float clump_fac = 0, clump_pow = 0;
241 float kink_freq = 0, kink_shape = 0, kink_amp = 0, free_end = 0;
242
243 /* texture effector */
245 float tex_nabla = 0;
247 struct Tex *tex = nullptr;
248
249 /* effector noise */
251 float f_noise = 0;
253 int seed = 0;
254
255 /* Display Size */
257 float drawvec1[4] = {};
259 float drawvec2[4] = {};
261 float drawvec_falloff_min[3] = {};
262 char _pad1[4] = {};
264 float drawvec_falloff_max[3] = {};
265 char _pad2[4] = {};
266
268 struct Object *f_source = nullptr;
269
271 float pdef_cfrict = 0;
272 char _pad[4] = {};
273};
274
277 struct Collection *group = nullptr;
278
280 float weight[14] = {};
281 float global_gravity = 0;
283 char _pad[2] = {};
284};
285
286struct SBVertex {
287 float vec[4] = {};
288};
289
290/* Container for data that is shared among evaluated copies.
291 *
292 * This is placed in a separate struct so that values can be changed
293 * without having to update all evaluated copies. */
295 struct PointCache *pointcache = nullptr;
296 ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
297};
298
299struct SoftBody {
301
302 /* dynamic data */
303 int totpoint = 0, totspring = 0;
305 struct BodyPoint *bpoint = nullptr;
307 struct BodySpring *bspring = nullptr;
308 char _pad = {};
309 char msg_lock = 0;
310 short msg_value = 0;
311
312 /* part of UI: */
313
314 /* general options */
316 float nodemass = 0;
321 char namedVG_Mass[/*MAX_VGROUP_NAME*/ 64] = "";
323 float grav = 0;
325 float mediafrict = 0;
327 float rklimit = 0;
329 float physics_speed = 0;
330
331 /* goal */
333 float goalspring = 0;
335 float goalfrict = 0;
337 float mingoal = 0;
338 float maxgoal = 0;
340 float defgoal = 0;
342 short vertgroup = 0;
347 char namedVG_Softgoal[/*MAX_VGROUP_NAME*/ 64] = "";
348
349 short fuzzyness = 0;
350
351 /* springs */
353 float inspring = 0;
355 float infrict = 0;
361 char namedVG_Spring_K[/*MAX_VGROUP_NAME*/ 64] = "";
362
363 /* baking */
364 char _pad1[6] = {};
366 char local = 0;
368
369 /* -- these must be kept for backwards compatibility -- */
371 SBVertex **keys = nullptr;
373 int totpointkey = 0, totkey = 0;
374 /* ---------------------------------------------------- */
375 float secondspring = 0;
376
377 /* Self collision. */
379 float colball = 0;
381 float balldamp = 0;
383 float ballstiff = 0;
385 short aeroedge = 0;
386 short minloops = 0;
387 short maxloops = 0;
388 short choke = 0;
389 short solver_ID = 0;
390 short plastic = 0;
391 short springpreload = 0;
392
394 struct SBScratch *scratch = nullptr;
395 float shearstiff = 0;
396 float inpush = 0;
397
398 struct SoftBody_Shared *shared = nullptr;
402 ListBaseT<PointCache> ptcaches = {nullptr, nullptr};
403
404 struct Collection *collision_group = nullptr;
405
407 /* Reverse estimated object-matrix (run-time data, no need to store in the file). */
408 float lcom[3] = {};
409 float lrot[3][3] = {};
410 float lscale[3][3] = {};
411
412 int last_frame = 0;
413};
414
415} // namespace blender
#define ENUM_OPERATORS(_enum_type)
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:104
#define DNA_DEPRECATED
Definition DNA_defs.h:21
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
ListBaseT< PointCache > ptcaches
struct EffectorWeights * effector_weights
eSoftBody_SolverFlag solverflags
struct SoftBody_Shared * shared
struct Collection * collision_group
struct SBScratch * scratch
DNA_DEPRECATED struct PointCache * pointcache
struct BodyPoint * bpoint
ListBaseT< PointCache > ptcaches
struct BodySpring * bspring