diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 02b3c88183a..5b429a61b3f 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -467,3 +467,25 @@ class VolumeComponent : public GeometryComponent { static constexpr inline GeometryComponentType static_type = GeometryComponentType::Volume; }; + +/** + * Used to keep track of a group of instances using the same geometry data. + */ +struct GeometryInstanceGroup { + /** + * The geometry set instanced on each of the transforms. The components are not necessarily + * owned here. For example, they may be owned by the instanced object. This cannot be a + * reference because not all instanced data will necessarily have a #geometry_set_eval. + */ + GeometrySet geometry_set; + + /** + * As an optimization to avoid copying, the same geometry set can be associated with multiple + * instances. Each instance is stored as a transform matrix here. Again, these must be owned + * because they may be transformed from the original data. TODO: Validate that last statement. + */ + blender::Vector<blender::float4x4> transforms; +}; + +blender::Vector<GeometryInstanceGroup> BKE_geometry_set_gather_instances( + const GeometrySet &geometry_set); |