Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r--source/blender/blenkernel/BKE_geometry_set.hh31
1 files changed, 7 insertions, 24 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index adc08f699fd..51f7507bd6c 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -24,6 +24,7 @@
#include <iostream>
#include "BLI_float3.hh"
+#include "BLI_float4x4.hh"
#include "BLI_hash.hh"
#include "BLI_map.hh"
#include "BLI_set.hh"
@@ -427,9 +428,7 @@ class PointCloudComponent : public GeometryComponent {
/** A geometry component that stores instances. */
class InstancesComponent : public GeometryComponent {
private:
- blender::Vector<blender::float3> positions_;
- blender::Vector<blender::float3> rotations_;
- blender::Vector<blender::float3> scales_;
+ blender::Vector<blender::float4x4> transforms_;
blender::Vector<int> ids_;
blender::Vector<InstancedData> instanced_data_;
@@ -439,30 +438,14 @@ class InstancesComponent : public GeometryComponent {
GeometryComponent *copy() const override;
void clear();
- void add_instance(Object *object,
- blender::float3 position,
- blender::float3 rotation = {0, 0, 0},
- blender::float3 scale = {1, 1, 1},
- const int id = -1);
- void add_instance(Collection *collection,
- blender::float3 position,
- blender::float3 rotation = {0, 0, 0},
- blender::float3 scale = {1, 1, 1},
- const int id = -1);
- void add_instance(InstancedData data,
- blender::float3 position,
- blender::float3 rotation,
- blender::float3 scale,
- const int id = -1);
+ void add_instance(Object *object, blender::float4x4 transform, const int id = -1);
+ void add_instance(Collection *collection, blender::float4x4 transform, const int id = -1);
+ void add_instance(InstancedData data, blender::float4x4 transform, const int id = -1);
blender::Span<InstancedData> instanced_data() const;
- blender::Span<blender::float3> positions() const;
- blender::Span<blender::float3> rotations() const;
- blender::Span<blender::float3> scales() const;
+ blender::Span<blender::float4x4> transforms() const;
blender::Span<int> ids() const;
- blender::MutableSpan<blender::float3> positions();
- blender::MutableSpan<blender::float3> rotations();
- blender::MutableSpan<blender::float3> scales();
+ blender::MutableSpan<blender::float4x4> transforms();
int instances_amount() const;
bool is_empty() const final;