Pose brush: Smooth Iterations Brush Property
[blender.git] / source / blender / depsgraph / DEG_depsgraph_physics.h
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) 2018 Blender Foundation.
17  * All rights reserved.
18  */
19
20 /** \file
21  * \ingroup depsgraph
22  *
23  * Physics utilities for effectors and collision.
24  */
25
26 #ifndef __DEG_DEPSGRAPH_PHYSICS_H__
27 #define __DEG_DEPSGRAPH_PHYSICS_H__
28
29 #include "DEG_depsgraph.h"
30
31 struct DepsNodeHandle;
32 struct Depsgraph;
33 struct EffectorWeights;
34 struct ListBase;
35 struct Object;
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 typedef enum ePhysicsRelationType {
42   DEG_PHYSICS_EFFECTOR = 0,
43   DEG_PHYSICS_COLLISION = 1,
44   DEG_PHYSICS_SMOKE_COLLISION = 2,
45   DEG_PHYSICS_DYNAMIC_BRUSH = 3,
46   DEG_PHYSICS_RELATIONS_NUM = 4,
47 } ePhysicsRelationType;
48
49 /* Get collision/effector relations from collection or entire scene. These
50  * created during depsgraph relations building and should only be accessed
51  * during evaluation. */
52 struct ListBase *DEG_get_effector_relations(const struct Depsgraph *depsgraph,
53                                             struct Collection *collection);
54 struct ListBase *DEG_get_collision_relations(const struct Depsgraph *depsgraph,
55                                              struct Collection *collection,
56                                              unsigned int modifier_type);
57
58 /* Build collision/effector relations for depsgraph. */
59 typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj, struct ModifierData *md);
60
61 void DEG_add_collision_relations(struct DepsNodeHandle *handle,
62                                  struct Object *object,
63                                  struct Collection *collection,
64                                  unsigned int modifier_type,
65                                  DEG_CollobjFilterFunction filter_function,
66                                  const char *name);
67 void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
68                                   struct Object *object,
69                                   struct EffectorWeights *eff,
70                                   bool add_absorption,
71                                   int skip_forcefield,
72                                   const char *name);
73
74 #ifdef __cplusplus
75 } /* extern "C" */
76 #endif
77
78 #endif /* __DEG_DEPSGRAPH_PHYSICS_H__ */