diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2016-10-07 13:27:11 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2016-10-07 21:47:00 +0300 |
commit | 0a2a006775543292786e8642b20a594771fdc81c (patch) | |
tree | a4691a5ef1775477db13dae13ee9d9dd80efa2bc /source/blender/makesdna | |
parent | 2dccf5a6e881973858de2c230cb610a2ea3a03e1 (diff) |
Collision: skip expensive BVH update if the collider doesn't move.
Since the collision modifier cannot be disabled, it causes a constant
hit on the viewport animation playback FPS. Most of this overhead can
be automatically removed in the case when the collider is static.
The updates are only skipped when the collider was stationary during
the preceding update as well, so the state is stored in a field.
Knowing that the collider is static can also be used to disable similar
BVH updates for substeps in the actual cloth simulation code.
Differential Revision: https://developer.blender.org/D2277
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 0424dc98a25..9187b76f012 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -621,6 +621,9 @@ typedef struct CollisionModifierData { unsigned int mvert_num; unsigned int tri_num; float time_x, time_xnew; /* cfra time of modifier */ + char is_static; /* collider doesn't move this frame, i.e. x[].co==xnew[].co */ + char pad[7]; + struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */ } CollisionModifierData; |