Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_bounding_box.cc
| Show All 37 Lines | static void compute_min_max_from_position_and_transform(const GeometryComponent &component, | ||||
| Span<float4x4> transforms, | Span<float4x4> transforms, | ||||
| float3 &r_min, | float3 &r_min, | ||||
| float3 &r_max) | float3 &r_max) | ||||
| { | { | ||||
| GVArray_Typed<float3> positions = component.attribute_get_for_read<float3>( | GVArray_Typed<float3> positions = component.attribute_get_for_read<float3>( | ||||
| "position", ATTR_DOMAIN_POINT, {0, 0, 0}); | "position", ATTR_DOMAIN_POINT, {0, 0, 0}); | ||||
| for (const float4x4 &transform : transforms) { | for (const float4x4 &transform : transforms) { | ||||
| for (const int i : positions.index_range()) { | for (const int i : iter_indices(positions)) { | ||||
| const float3 position = positions[i]; | const float3 position = positions[i]; | ||||
| const float3 transformed_position = transform * position; | const float3 transformed_position = transform * position; | ||||
| minmax_v3v3_v3(r_min, r_max, transformed_position); | minmax_v3v3_v3(r_min, r_max, transformed_position); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void compute_min_max_from_volume_and_transforms(const VolumeComponent &volume_component, | static void compute_min_max_from_volume_and_transforms(const VolumeComponent &volume_component, | ||||
| ▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines | |||||