diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-01-26 20:21:12 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-01-26 20:21:12 +0300 |
commit | abd6b1d7b281c85fce748e0535f1f769916cd9b3 (patch) | |
tree | e228ff3ac96e6aa9de6b776e9f4605e86d93fcbd /source/blender/blenkernel/BKE_geometry_set.hh | |
parent | 6d40d7218971b558074eb418afd244ab13ab8fbf (diff) |
Fix T85049: Geometry Nodes: How to handle instances with shear?
Use transform matrices instead of loc, rot, scale variables to store instance transforms.
Reviewed By: JacquesLucke
Differential Revision: http://developer.blender.org/D10211
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 31 |
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 ad5a5d57045..3b093ae730a 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" @@ -422,9 +423,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_; @@ -434,30 +433,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; |