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.
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.
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.
16 * The Original Code is Copyright (C) 2018 Blender Foundation.
17 * All rights reserved.
20 /** \file blender/depsgraph/DEG_depsgraph_physics.h
23 * Physics utilities for effectors and collision.
26 #ifndef __DEG_DEPSGRAPH_PHYSICS_H__
27 #define __DEG_DEPSGRAPH_PHYSICS_H__
29 #include "DEG_depsgraph.h"
31 struct DepsNodeHandle;
33 struct EffectorWeights;
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;
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);
59 /* Build collision/effector relations for depsgraph. */
60 typedef bool (*DEG_CollobjFilterFunction)(struct Object *obj,
61 struct ModifierData *md);
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,
69 void DEG_add_forcefield_relations(struct DepsNodeHandle *handle,
70 struct Object *object,
71 struct EffectorWeights *eff,
80 #endif /* __DEG_DEPSGRAPH_PHYSICS_H__ */