Blender V4.3
DNA_rigidbody_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#include "DNA_listBase.h"
14
15struct Collection;
16
17struct EffectorWeights;
18
19/* ******************************** */
20/* RigidBody World */
21
23typedef struct RigidBodyWorld_Shared {
24 /* cache */
27
28 /* References to Physics Sim objects. Exist at runtime only ---------------------- */
32
33/* RigidBodyWorld (rbw)
34 *
35 * Represents a "simulation scene" existing within the parent scene.
36 */
37typedef struct RigidBodyWorld {
38 /* Sim World Settings ------------------------------------------------------------- */
41
45 struct Object **objects;
46
49
50 char _pad[4];
52 float ltime;
53
57 struct PointCache *pointcache DNA_DEPRECATED;
59 struct ListBase ptcaches DNA_DEPRECATED;
62
67
69 int flag;
73
76 /* should sim world be skipped when evaluating (user setting) */
77 RBW_FLAG_MUTED = (1 << 0),
78 /* sim data needs to be rebuilt */
79 /* RBW_FLAG_NEEDS_REBUILD = (1 << 1), */ /* UNUSED */
83
84/* ******************************** */
85/* RigidBody Object */
86
87/* Container for data that is shared among evaluated copies.
88 *
89 * This is placed in a separate struct so that, for example, the physics_shape
90 * pointer can be replaced without having to update all evaluated copies. */
91#
92#
93typedef struct RigidBodyOb_Shared {
94 /* References to Physics Sim objects. Exist at runtime only */
100
101/* RigidBodyObject (rbo)
102 *
103 * Represents an object participating in a RigidBody sim.
104 * This is attached to each object that is currently
105 * participating in a sim.
106 */
107typedef struct RigidBodyOb {
108 /* General Settings for this RigidBodyOb */
110 short type;
112 short shape;
113
115 int flag;
120 char _pad[2];
121
122 /* Physics Parameters */
124 float mass;
125
127 float friction;
130
132 float margin;
133
138
143
145 float orn[4];
147 float pos[3];
148 char _pad1[4];
149
153
155typedef enum eRigidBodyOb_Type {
156 /* active geometry participant in simulation. is directly controlled by sim */
158 /* passive geometry participant in simulation. is directly controlled by animsys */
161
163typedef enum eRigidBodyOb_Flag {
164 /* rigidbody is kinematic (controlled by the animation system) */
166 /* rigidbody needs to be validated (usually set after duplicating and not hooked up yet) */
168 /* rigidbody shape needs refreshing (usually after exiting editmode) */
170 /* rigidbody can be deactivated */
172 /* rigidbody is deactivated at the beginning of simulation */
174 /* rigidbody is not dynamically simulated */
176 /* collision margin is not embedded (only used by convex hull shapes for now) */
178 /* collision shape deforms during simulation (only for passive triangle mesh shapes) */
181
203
212
213/* ******************************** */
214/* RigidBody Constraint */
215
216/* RigidBodyConstraint (rbc)
217 *
218 * Represents an constraint connecting two rigid bodies.
219 */
220typedef struct RigidBodyCon {
222 struct Object *ob1;
224 struct Object *ob2;
225
226 /* General Settings for this RigidBodyCon */
228 short type;
231
233 int flag;
234
239 char _pad[3];
240
241 /* limits */
242 /* translation limits */
249 /* rotation limits */
256
257 /* spring settings */
258 /* resistance to deformation */
265 /* amount of velocity lost over time */
272
273 /* motor settings */
282
283 /* References to Physics Sim object. Exist at runtime only */
287
289typedef enum eRigidBodyCon_Type {
295 /* RBC_TYPE_HINGE2 = 2, */ /* UNUSED */
299 /* RBC_TYPE_CONE_TWIST = 4, */ /* UNUSED */
305 /* RBC_TYPE_UNIVERSAL = 7, */ /* UNUSED */
312 /* RBC_TYPE_SPRING = 10, */ /* UNUSED */
316
319 RBC_SPRING_TYPE1 = 0, /* btGeneric6DofSpringConstraint */
320 RBC_SPRING_TYPE2 = 1, /* btGeneric6DofSpring2Constraint */
322
324typedef enum eRigidBodyCon_Flag {
325 /* constraint influences rigid body motion */
327 /* constraint needs to be validated */
329 /* allow constrained bodies to collide */
331 /* constraint can break */
333 /* constraint use custom number of constraint solver iterations */
335 /* limits */
342 /* springs */
346 /* motors */
349 /* angular springs */
354
355/* ******************************** */
enum eAnimEdit_AutoSnap DNA_DEPRECATED
These structs are the foundation for all linked lists in the library system.
eRigidBodyOb_Type
@ RBO_TYPE_ACTIVE
@ RBO_TYPE_PASSIVE
eRigidBodyWorld_Flag
@ RBW_FLAG_MUTED
@ RBW_FLAG_USE_SPLIT_IMPULSE
struct RigidBodyOb_Shared RigidBodyOb_Shared
eRigidBody_MeshSource
@ RBO_MESH_DEFORM
@ RBO_MESH_FINAL
@ RBO_MESH_BASE
struct RigidBodyOb RigidBodyOb
eRigidBodyCon_Type
@ RBC_TYPE_POINT
@ RBC_TYPE_HINGE
@ RBC_TYPE_FIXED
@ RBC_TYPE_SLIDER
@ RBC_TYPE_MOTOR
@ RBC_TYPE_6DOF_SPRING
@ RBC_TYPE_PISTON
@ RBC_TYPE_6DOF
eRigidBodyOb_Flag
@ RBO_FLAG_USE_MARGIN
@ RBO_FLAG_START_DEACTIVATED
@ RBO_FLAG_KINEMATIC
@ RBO_FLAG_USE_DEFORM
@ RBO_FLAG_NEEDS_VALIDATE
@ RBO_FLAG_USE_DEACTIVATION
@ RBO_FLAG_NEEDS_RESHAPE
@ RBO_FLAG_DISABLED
eRigidBodyCon_Flag
@ RBC_FLAG_NEEDS_VALIDATE
@ RBC_FLAG_USE_MOTOR_ANG
@ RBC_FLAG_USE_SPRING_Y
@ RBC_FLAG_USE_SPRING_ANG_Y
@ RBC_FLAG_USE_SPRING_ANG_X
@ RBC_FLAG_USE_LIMIT_ANG_X
@ RBC_FLAG_USE_LIMIT_LIN_Y
@ RBC_FLAG_USE_LIMIT_ANG_Y
@ RBC_FLAG_USE_MOTOR_LIN
@ RBC_FLAG_DISABLE_COLLISIONS
@ RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS
@ RBC_FLAG_USE_BREAKING
@ RBC_FLAG_ENABLED
@ RBC_FLAG_USE_SPRING_Z
@ RBC_FLAG_USE_LIMIT_LIN_X
@ RBC_FLAG_USE_SPRING_ANG_Z
@ RBC_FLAG_USE_SPRING_X
@ RBC_FLAG_USE_LIMIT_LIN_Z
@ RBC_FLAG_USE_LIMIT_ANG_Z
@ RB_SHAPE_CAPSULE
@ RB_SHAPE_CONVEXH
@ RB_SHAPE_COMPOUND
@ RB_SHAPE_BOX
@ RB_SHAPE_TRIMESH
@ RB_SHAPE_SPHERE
@ RB_SHAPE_CYLINDER
@ RB_SHAPE_CONE
struct RigidBodyWorld RigidBodyWorld
eRigidBodyCon_SpringType
@ RBC_SPRING_TYPE1
@ RBC_SPRING_TYPE2
struct RigidBodyCon RigidBodyCon
struct RigidBodyWorld_Shared RigidBodyWorld_Shared
struct Object * ob1
struct Object * ob2
struct RigidBodyOb_Shared * shared
struct PointCache * pointcache
struct Collection * constraints
struct Collection * group
struct PointCache *pointcache DNA_DEPRECATED
struct RigidBodyWorld_Shared * shared
struct Object ** objects
struct EffectorWeights * effector_weights