diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-29 19:51:18 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-29 22:31:20 +0300 |
commit | b023c911185636293e928ef998f4c9cad2c15d9c (patch) | |
tree | b43c213ea902a9868abeb9f79370b854a7f97518 /source/blender | |
parent | bf3b0db785fd4c6575c22340e6a92328538ff790 (diff) |
Fluid: Use dynamic mode whenever active rigid bodies are in the scene
Required for collisions with moving rigid bodies. Otherwise the static optimization mode will be kept and the obstacles would be calculated only once at the beginning.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index b8d9718920e..b095e6dbeec 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -36,6 +36,7 @@ #include "DNA_fluid_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_rigidbody_types.h" #include "BKE_effect.h" #include "BKE_fluid.h" @@ -644,6 +645,11 @@ static bool is_static_object(Object *ob) } } + /* Active rigid body objects considered to be dynamic fluid objects. */ + if (ob->rigidbody_object && ob->rigidbody_object->type == RBO_TYPE_ACTIVE) { + return false; + } + /* Finally, check if the object has animation data. If so, it is considered dynamic. */ return !BKE_object_moves_in_time(ob, true); } |