Depsgraph: Remove duplicated sets of recalc/update flags
[blender.git] / source / blender / depsgraph / DEG_depsgraph_physics.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2018 Blender Foundation.
19  * All rights reserved.
20  *
21  * ***** END GPL LICENSE BLOCK *****
22  */
23
24 /** \file blender/depsgraph/DEG_depsgraph_physics.h
25  *  \ingroup depsgraph
26  *
27  * Physics utilities for effectors and collision.
28  */
29
30 #ifndef __DEG_DEPSGRAPH_PHYSICS_H__
31 #define __DEG_DEPSGRAPH_PHYSICS_H__
32
33 #include "DEG_depsgraph.h"
34
35 struct Colllection;
36 struct Depsgraph;
37 struct DepsNodeHandle;
38 struct EffectorWeights;
39 struct ListBase;
40 struct Object;
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 typedef enum ePhysicsRelationType {
47         DEG_PHYSICS_EFFECTOR        = 0,
48         DEG_PHYSICS_COLLISION       = 1,
49         DEG_PHYSICS_SMOKE_COLLISION = 2,
50         DEG_PHYSICS_DYNAMIC_BRUSH   = 3,
51         DEG_PHYSICS_RELATIONS_NUM   = 4
52 } ePhysicsRelationType;
53
54 /* Get collision/effector relations from collection or entire scene. These
55  * created during depsgraph relations building and should only be accessed
56  * during evaluation. */
57 struct ListBase *DEG_get_effector_relations(const struct Depsgraph *depsgraph,
58                                             struct Collection *collection);
59 struct ListBase *DEG_get_collision_relations(const struct Depsgraph *depsgraph,
60                                              struct Collection *collection,
61                                              unsigned int modifier_type);
62
63
64 /* Build collision/effector relations for depsgraph. */
65 typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj,
66                                           struct ModifierData *md);
67
68 void DEG_add_collision_relations(struct DepsNodeHandle *handle,
69                                  struct Object *object,
70                                  struct Collection *collection,
71                                  unsigned int modifier_type,
72                                  DEG_CollobjFilterFunction filter_function,
73                                  const char *name);
74 void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
75                                   struct Object *object,
76                                   struct EffectorWeights *eff,
77                                   bool add_absorption,
78                                   int skip_forcefield,
79                                   const char *name);
80
81 #ifdef __cplusplus
82 } /* extern "C" */
83 #endif
84
85 #endif  /* __DEG_DEPSGRAPH_PHYSICS_H__ */