Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_geometry_set.hh
| Show First 20 Lines • Show All 630 Lines • ▼ Show 20 Lines | private: | ||||
| * Actual instances store an index ("handle") into this set. | * Actual instances store an index ("handle") into this set. | ||||
| */ | */ | ||||
| blender::VectorSet<InstanceReference> references_; | blender::VectorSet<InstanceReference> references_; | ||||
| /** Index into `references_`. Determines what data is instanced. */ | /** Index into `references_`. Determines what data is instanced. */ | ||||
| blender::Vector<int> instance_reference_handles_; | blender::Vector<int> instance_reference_handles_; | ||||
| /** Transformation of the instances. */ | /** Transformation of the instances. */ | ||||
| blender::Vector<blender::float4x4> instance_transforms_; | blender::Vector<blender::float4x4> instance_transforms_; | ||||
| /** | |||||
| * IDs of the instances. They are used for consistency over multiple frames for things like | |||||
| * motion blur. Proper stable ID data that actually helps when rendering can only be generated | |||||
| * in some situations, so this vector is allowed to be empty, in which case the index of each | |||||
| * instance will be used for the final ID. | |||||
| */ | |||||
| blender::Vector<int> instance_ids_; | |||||
| /* These almost unique ids are generated based on `ids_`, which might not contain unique ids at | /* These almost unique ids are generated based on `ids_`, which might not contain unique ids at | ||||
| * all. They are *almost* unique, because under certain very unlikely circumstances, they are not | * all. They are *almost* unique, because under certain very unlikely circumstances, they are not | ||||
| * unique. Code using these ids should not crash when they are not unique but can generally | * unique. Code using these ids should not crash when they are not unique but can generally | ||||
| * expect them to be unique. */ | * expect them to be unique. */ | ||||
| mutable std::mutex almost_unique_ids_mutex_; | mutable std::mutex almost_unique_ids_mutex_; | ||||
| mutable blender::Array<int> almost_unique_ids_; | mutable blender::Array<int> almost_unique_ids_; | ||||
| Show All 17 Lines | public: | ||||
| void ensure_geometry_instances(); | void ensure_geometry_instances(); | ||||
| GeometrySet &geometry_set_from_reference(const int reference_index); | GeometrySet &geometry_set_from_reference(const int reference_index); | ||||
| blender::Span<int> instance_reference_handles() const; | blender::Span<int> instance_reference_handles() const; | ||||
| blender::MutableSpan<int> instance_reference_handles(); | blender::MutableSpan<int> instance_reference_handles(); | ||||
| blender::MutableSpan<blender::float4x4> instance_transforms(); | blender::MutableSpan<blender::float4x4> instance_transforms(); | ||||
| blender::Span<blender::float4x4> instance_transforms() const; | blender::Span<blender::float4x4> instance_transforms() const; | ||||
| blender::MutableSpan<int> instance_ids(); | |||||
| blender::Span<int> instance_ids() const; | |||||
| blender::MutableSpan<int> instance_ids_ensure(); | |||||
| void instance_ids_clear(); | |||||
| int instances_amount() const; | int instances_amount() const; | ||||
| int references_amount() const; | int references_amount() const; | ||||
| blender::Span<int> almost_unique_ids() const; | blender::Span<int> almost_unique_ids() const; | ||||
| blender::bke::CustomDataAttributes &attributes(); | blender::bke::CustomDataAttributes &attributes(); | ||||
| const blender::bke::CustomDataAttributes &attributes() const; | const blender::bke::CustomDataAttributes &attributes() const; | ||||
| ▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines | |||||