Commit: b5e00a1482e56e3e94665ddec76219c6fafe6945 Author: Ray Molenkamp Date: Thu Feb 2 11:46:23 2023 -0700 Branches: master https://developer.blender.org/rBb5e00a1482e56e3e94665ddec76219c6fafe6945
Revert "BLI: Use BLI_math_matrix_type.hh instead of BLI_math_float4x4.hh" This reverts commit 52de84b0db1aca6b9df00c6b9be7d7839132523a. had some build issues on windows i can't quickly resolve, revert for now while we fix the problems =================================================================== M source/blender/blenkernel/BKE_crazyspace.hh M source/blender/blenkernel/BKE_curves.hh M source/blender/blenkernel/BKE_geometry_set_instances.hh M source/blender/blenkernel/BKE_instances.hh M source/blender/blenkernel/BKE_mesh_boolean_convert.hh M source/blender/blenkernel/BKE_volume.h M source/blender/blenkernel/intern/curve_to_mesh_convert.cc M source/blender/blenkernel/intern/curves.cc M source/blender/blenkernel/intern/curves_geometry.cc M source/blender/blenkernel/intern/geometry_component_instances.cc M source/blender/blenkernel/intern/geometry_set_instances.cc M source/blender/blenkernel/intern/mesh_boolean_convert.cc M source/blender/blenkernel/intern/object_dupli.cc M source/blender/blenkernel/intern/pbvh_uv_islands.cc M source/blender/blenkernel/intern/pbvh_uv_islands.hh M source/blender/blenkernel/intern/volume.cc A source/blender/blenlib/BLI_float3x3.hh A source/blender/blenlib/BLI_float4x4.hh M source/blender/blenlib/BLI_math_matrix.hh M source/blender/blenlib/BLI_math_matrix_types.hh M source/blender/blenlib/BLI_math_rotation_types.hh M source/blender/blenlib/CMakeLists.txt M source/blender/blenlib/intern/cpp_types.cc M source/blender/blenlib/intern/math_matrix.cc A source/blender/blenlib/tests/BLI_float3x3_test.cc M source/blender/compositor/realtime_compositor/COM_domain.hh M source/blender/compositor/realtime_compositor/COM_result.hh M source/blender/compositor/realtime_compositor/intern/domain.cc M source/blender/compositor/realtime_compositor/intern/realize_on_domain_operation.cc M source/blender/compositor/realtime_compositor/intern/result.cc M source/blender/draw/engines/eevee_next/eevee_camera.cc M source/blender/draw/engines/eevee_next/eevee_camera.hh M source/blender/draw/engines/eevee_next/eevee_pipeline.cc M source/blender/draw/engines/eevee_next/eevee_shader_shared.hh M source/blender/draw/engines/eevee_next/eevee_velocity.cc M source/blender/draw/engines/eevee_next/eevee_view.hh M source/blender/draw/engines/image/image_drawing_mode.hh M source/blender/draw/engines/image/image_texture_info.hh M source/blender/draw/engines/workbench/workbench_engine.cc M source/blender/draw/engines/workbench/workbench_resources.cc M source/blender/draw/engines/workbench/workbench_shadow.cc M source/blender/draw/intern/draw_command.cc M source/blender/draw/intern/draw_debug.cc M source/blender/draw/intern/draw_manager.h M source/blender/draw/intern/draw_manager_data.cc M source/blender/draw/intern/draw_resource.hh M source/blender/draw/intern/draw_view.cc M source/blender/draw/tests/draw_pass_test.cc M source/blender/editors/curves/intern/curves_ops.cc M source/blender/editors/object/object_transform.cc M source/blender/editors/sculpt_paint/curves_sculpt_add.cc M source/blender/editors/sculpt_paint/curves_sculpt_brush.cc M source/blender/editors/sculpt_paint/curves_sculpt_comb.cc M source/blender/editors/sculpt_paint/curves_sculpt_delete.cc M source/blender/editors/sculpt_paint/curves_sculpt_density.cc M source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc M source/blender/editors/sculpt_paint/curves_sculpt_ops.cc M source/blender/editors/sculpt_paint/curves_sculpt_pinch.cc M source/blender/editors/sculpt_paint/curves_sculpt_puff.cc M source/blender/editors/sculpt_paint/curves_sculpt_selection_paint.cc M source/blender/editors/sculpt_paint/curves_sculpt_slide.cc M source/blender/editors/sculpt_paint/curves_sculpt_smooth.cc M source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc M source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc M source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc M source/blender/editors/transform/transform_snap_object.cc M source/blender/functions/intern/cpp_types.cc M source/blender/geometry/GEO_add_curves_on_mesh.hh M source/blender/geometry/GEO_mesh_to_volume.hh M source/blender/geometry/intern/add_curves_on_mesh.cc M source/blender/geometry/intern/mesh_to_volume.cc M source/blender/geometry/intern/realize_instances.cc M source/blender/gpu/GPU_shader_shared_utils.h M source/blender/imbuf/intern/transform.cc M source/blender/io/usd/intern/usd_writer_volume.cc M source/blender/modifiers/intern/MOD_boolean.cc M source/blender/modifiers/intern/MOD_mesh_to_volume.cc M source/blender/modifiers/intern/MOD_volume_to_mesh.cc M source/blender/nodes/composite/nodes/node_composite_directionalblur.cc M source/blender/nodes/composite/nodes/node_composite_filter.cc M source/blender/nodes/composite/nodes/node_composite_pixelate.cc M source/blender/nodes/composite/nodes/node_composite_rotate.cc M source/blender/nodes/composite/nodes/node_composite_scale.cc M source/blender/nodes/composite/nodes/node_composite_transform.cc M source/blender/nodes/composite/nodes/node_composite_translate.cc M source/blender/nodes/geometry/node_geometry_util.hh M source/blender/nodes/geometry/nodes/node_geo_collection_info.cc M source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc M source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc M source/blender/nodes/geometry/nodes/node_geo_input_instance_rotation.cc M source/blender/nodes/geometry/nodes/node_geo_input_instance_scale.cc M source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_angle.cc M source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc M source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc M source/blender/nodes/geometry/nodes/node_geo_object_info.cc M source/blender/nodes/geometry/nodes/node_geo_proximity.cc M source/blender/nodes/geometry/nodes/node_geo_rotate_instances.cc M source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc M source/blender/nodes/geometry/nodes/node_geo_scale_instances.cc M source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc M source/blender/nodes/geometry/nodes/node_geo_transform_geometry.cc M source/blender/nodes/geometry/nodes/node_geo_translate_instances.cc =================================================================== diff --git a/source/blender/blenkernel/BKE_crazyspace.hh b/source/blender/blenkernel/BKE_crazyspace.hh index 5f206bcefb2..1d29c65454c 100644 --- a/source/blender/blenkernel/BKE_crazyspace.hh +++ b/source/blender/blenkernel/BKE_crazyspace.hh @@ -6,7 +6,8 @@ #pragma once -#include "BLI_math_matrix.hh" +#include "BLI_float3x3.hh" +#include "BLI_math_vector_types.hh" #include "BLI_span.hh" struct Depsgraph; @@ -37,7 +38,7 @@ struct GeometryDeformation { return translation; } const float3x3 &deform_mat = this->deform_mats[position_i]; - return math::transform_point(math::invert(deform_mat), translation); + return deform_mat.inverted() * translation; } }; diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 055802e9404..8e4a83a1135 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -13,9 +13,10 @@ #include "BLI_bounds_types.hh" #include "BLI_cache_mutex.hh" +#include "BLI_float3x3.hh" +#include "BLI_float4x4.hh" #include "BLI_generic_virtual_array.hh" #include "BLI_index_mask.hh" -#include "BLI_math_matrix_types.hh" #include "BLI_math_vector_types.hh" #include "BLI_offset_indices.hh" #include "BLI_shared_cache.hh" diff --git a/source/blender/blenkernel/BKE_geometry_set_instances.hh b/source/blender/blenkernel/BKE_geometry_set_instances.hh index ec3c9c0d645..3e9fb1d0379 100644 --- a/source/blender/blenkernel/BKE_geometry_set_instances.hh +++ b/source/blender/blenkernel/BKE_geometry_set_instances.hh @@ -2,7 +2,7 @@ #pragma once -#include "BLI_math_matrix_types.hh" +#include "BLI_float4x4.hh" #include "BKE_geometry_set.hh" diff --git a/source/blender/blenkernel/BKE_instances.hh b/source/blender/blenkernel/BKE_instances.hh index 90e8bbd5b1e..3d44e3a4686 100644 --- a/source/blender/blenkernel/BKE_instances.hh +++ b/source/blender/blenkernel/BKE_instances.hh @@ -19,7 +19,7 @@ #include <mutex> -#include "BLI_math_matrix_types.hh" +#include "BLI_float4x4.hh" #include "BLI_vector.hh" #include "BLI_vector_set.hh" diff --git a/source/blender/blenkernel/BKE_mesh_boolean_convert.hh b/source/blender/blenkernel/BKE_mesh_boolean_convert.hh index e7a8c7bccd9..77c90716d42 100644 --- a/source/blender/blenkernel/BKE_mesh_boolean_convert.hh +++ b/source/blender/blenkernel/BKE_mesh_boolean_convert.hh @@ -8,7 +8,7 @@ */ #include "BLI_array.hh" -#include "BLI_math_matrix_types.hh" +#include "BLI_float4x4.hh" #include "BLI_mesh_boolean.hh" #include "BLI_span.hh" diff --git a/source/blender/blenkernel/BKE_volume.h b/source/blender/blenkernel/BKE_volume.h index 9273ea14127..d300d08da91 100644 --- a/source/blender/blenkernel/BKE_volume.h +++ b/source/blender/blenkernel/BKE_volume.h @@ -161,7 +161,7 @@ bool BKE_volume_save(const struct Volume *volume, * file or copy shared grids to make them writeable. */ #ifdef __cplusplus -# include "BLI_math_matrix_types.hh" +# include "BLI_float4x4.hh" # include "BLI_math_vector_types.hh" # include "BLI_string_ref.hh" diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index d3c57e5257d..23dcda10d8a 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "BLI_array.hh" -#include "BLI_math_matrix.hh" #include "BLI_set.hh" #include "BLI_task.hh" @@ -184,26 +183,25 @@ static void fill_mesh_positions(const int main_point_num, { if (profile_point_num == 1) { for (const int i_ring : IndexRange(main_point_num)) { - float4x4 point_matrix = math::from_orthonormal_axes<float4x4>( + float4x4 point_matrix = float4x4::from_normalized_axis_data( main_positions[i_ring], normals[i_ring], tangents[i_ring]); if (!radii.is_empty()) { - point_matrix = math::scale(point_matrix, float3(radii[i_ring])); + point_matrix.apply_scale(radii[i_ring]); } - mesh_positions[i_ring] = math::transform_point(point_matrix, profile_positions.first()); + mesh_positions[i_ring] = point_matrix * profile_positions.first(); } } else { for (const int i_ring : IndexRange(main_point_num)) { - float4x4 point_matrix = math::from_orthonormal_axes<float4x4>( + float4x4 point_matrix = float4x4::from_normalized_axis_data( main_positions[i_ring], normals[i_ring], tangents[i_ring]); if (!radii.is_empty()) { - point_matrix = math::scale(point_matrix, float3(radii[i_ring])); + point_matrix.apply_scale(radii[i_ring]); } const int ring_vert_start = i_ring * profile_point_num; for (const int i_profile : IndexRange(profile_point_num)) { - mesh_positions[ring_vert_start + i_profile] = math::transform_point( - point_matrix, profile_positions[i_profile]); + mesh_positions[ring_vert_start + i_profile] = point_matrix * profile_positions[i_profile]; } } } diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc index f28b4e11861..a7ac35ce56b 100644 --- a/source/blender/blenkernel/intern/curves.cc +++ b/source/blender/blenkernel/intern/curves.cc @@ -17,7 +17,7 @@ #include "BLI_index_range.hh" #include "BLI_listbase.h" #include "BLI_math_base.h" -#include "BLI_math_matrix.hh" +#include "BLI_math_vector.hh" #include "BLI_rand.hh" #include "BLI_span.hh" #include "BLI_string.h" @@ -411,15 +411,15 @@ void curves_copy_parameters(const Curves &src, Curves &dst) CurvesSurfaceTransforms::CurvesSurfaceTransforms(const Object &curves_ob, const Object *surface_ob) { - this->curves_to_world = float4x4_view(curves_ob.object_to_world); - this->world_to_curves = math::invert(this->curves_to_world); + this->curves_to_world = curves_ob.object_to_world; + this->world_to_curves = this->curves_to_world.inverted(); if (surface_ob != nullptr) { - this->surface_to_world = float4x4_view(surface_ob->object_to_world); - this->world_to_surface = math::invert(this->surface_to_world); + this->surface_to_world = surface_ob->object_to_world; + this->world_to_surface = this->surface_to_world.inverted(); this->surface_to_curves = this->world_to_curves * this->surface_to_world; this->curves_to_surface = this->world_to_surface * this->curves_to_world; - this->surface_to_curves_normal = math::transpose(math::invert(this->surface_to_curves)); + this->surface_to_curves_normal = this->surface_to_curves.inverted().transposed(); } } diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 98d06cb6615..26a4f41db48 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -13,7 +13,6 @@ #include "BLI_bounds.hh" #include "BLI_index_mask_ops.hh" #include "BLI_length_parameterize.hh" -#include "BLI_math_matrix.hh" #include "BLI_math_rotation_legacy.hh" #include "BLI_task.hh" @@ -988,7 +987,7 @@ static void transform_positions(MutableSpan<float3> positions, const float4x4 &m { threading::parallel_for(positions.index_range(), 1024, [&](const IndexRange range) { for (float3 &position : positions.slice(range)) { - position = math::transform_point(matrix, position); + position = matrix * position; } }); } diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index 25143bf20a0..be1d9524509 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -2,9 +2,9 @@ #include <mutex> +#include "BLI_float4x4.hh" #include "BLI_index_mask.hh" #include "BLI_map.hh" -#include "BLI_math_matrix_types.hh" #include "BLI_rand.hh" #include "BLI_set.hh" #include "BLI_span.hh" @@ -117,12 +117,12 @@ namespace blender::bke { static float3 get_transform_position(const float4x4 &transform) { - return transform.location(); + return transform.translation(); } static void set_transform_position(float4x4 &transform, const float3 position) { - transform.location() = position; + copy_v3_v3(transform.values[3], position); } class InstancePositionAttributeProvider final : public BuiltinAttributeProvider { diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index 63f5ffe2740..2b36020b4e7 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -78,7 +78,7 @@ static void geometry_set_collect_recursive_collection_instance( const Collection &collection, const float4x4 &transform, Vector<GeometryInstanceGroup> &r_sets) { float4x4 offset_matrix = float4x4::identity(); - offset_matrix.location() -= float3(collection.instance_offset); + sub_v3_v3(offset_matrix.values[3], collection.instance_offset); const float4x4 instance_transform = transform * offset_matrix; geometry_set_collect_recursive_collection(collection, instance_transform, r_sets); } @@ -98,7 +98,7 @@ static void geometry_set_collect_recursive_collection(const Collection &collecti LISTBASE_FOREACH (const CollectionObject *, collection_object, &collection.gobject) { BLI_assert(collection_object->ob != nullptr); const Object &object = *collection_object->ob; - const float4x4 object_transform = transform * float4x4_view(object.object_to_world); + const float4x4 object_transform = transform * object.object_to_world; geometry_set_collect_recursive_object(object, object_transform, r_sets); } LISTBASE_FOREACH (const CollectionChild *, collection_child, &collection.children) { @@ -220,9 +220,9 @@ void Instances::ensure_geometry_instances() Collection &collection = reference.collection(); FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (&collection, object) { const int handle = instances->add_reference(*object); - instances->add_insta @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs