doxygen: add newline after \file
[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
59 /* Build collision/effector relations for depsgraph. */
60 typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj,
61                                           struct ModifierData *md);
62
63 void DEG_add_collision_relations(struct DepsNodeHandle *handle,
64                                  struct Object *object,
65                                  struct Collection *collection,
66                                  unsigned int modifier_type,
67                                  DEG_CollobjFilterFunction filter_function,
68                                  const char *name);
69 void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
70                                   struct Object *object,
71                                   struct EffectorWeights *eff,
72                                   bool add_absorption,
73                                   int skip_forcefield,
74                                   const char *name);
75
76 #ifdef __cplusplus
77 } /* extern "C" */
78 #endif
79
80 #endif  /* __DEG_DEPSGRAPH_PHYSICS_H__ */