|
Blender V5.0
|
#include "implicit.h"#include "MEM_guardedalloc.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_task.hh"#include "BKE_cloth.hh"#include "SIM_mass_spring.h"Go to the source code of this file.
Classes | |
| struct | fmatrix3x3 |
| struct | Implicit_Data |
Macros | |
| #define | CLOTH_PARALLEL_LIMIT 1024 |
Typedefs | |
| using | lfVector = float[3] |
Variables | |
| static float | I [3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}} |
| static float | ZERO [3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}} |
| #define CLOTH_PARALLEL_LIMIT 1024 |
Definition at line 28 of file implicit_blender.cc.
Referenced by dot_lfvector(), and mul_bfmatrix_lfvector().
Definition at line 53 of file implicit_blender.cc.
| DO_INLINE void add_fmatrix_fmatrix | ( | float | to[3][3], |
| const float | matrixA[3][3], | ||
| const float | matrixB[3][3] ) |
Definition at line 422 of file implicit_blender.cc.
References add_v3_v3v3(), and DO_INLINE.
| DO_INLINE void add_lfvector_lfvector | ( | float(*) | to[3], |
| float(*) | fLongVectorA[3], | ||
| float(*) | fLongVectorB[3], | ||
| uint | verts ) |
Definition at line 192 of file implicit_blender.cc.
References add_v3_v3v3(), DO_INLINE, i, and verts.
Referenced by mul_bfmatrix_lfvector(), and SIM_mass_spring_solve_velocities().
| DO_INLINE void add_lfvector_lfvectorS | ( | float(*) | to[3], |
| float(*) | fLongVectorA[3], | ||
| float(*) | fLongVectorB[3], | ||
| float | bS, | ||
| uint | verts ) |
Definition at line 204 of file implicit_blender.cc.
References DO_INLINE, i, VECADDS, and verts.
Referenced by cg_filtered(), and SIM_mass_spring_solve_positions().
| DO_INLINE void add_lfvectorS_lfvectorS | ( | float(*) | to[3], |
| float(*) | fLongVectorA[3], | ||
| float | aS, | ||
| float(*) | fLongVectorB[3], | ||
| float | bS, | ||
| uint | verts ) |
Definition at line 214 of file implicit_blender.cc.
References DO_INLINE, i, VECADDSS, and verts.
Referenced by SIM_mass_spring_solve_velocities().
| BLI_INLINE void apply_spring | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| const float | f[3], | ||
| const float | dfdx[3][3], | ||
| const float | dfdv[3][3] ) |
Definition at line 1745 of file implicit_blender.cc.
References add_m3_m3m3(), add_v3_v3(), BLI_INLINE, data, i, SIM_mass_spring_add_block(), sub_m3_m3m3(), and sub_v3_v3().
Referenced by SIM_mass_spring_force_spring_bending(), and SIM_mass_spring_force_spring_linear().
| BLI_INLINE float bend_angle | ( | const float | dir_a[3], |
| const float | dir_b[3], | ||
| const float | dir_e[3] ) |
Definition at line 1888 of file implicit_blender.cc.
References atan2f, BLI_INLINE, cos, cross_v3_v3v3(), dot_v3v3(), and sin.
Referenced by spring_angle().
|
static |
Definition at line 1431 of file implicit_blender.cc.
References cross_v3_v3v3(), nor, normalize_v3(), sub_v3_v3v3(), and v2.
Referenced by SIM_mass_spring_force_face_extern(), SIM_mass_spring_force_face_wind(), SIM_mass_spring_force_pressure(), and SIM_tri_area().
|
static |
Definition at line 822 of file implicit_blender.cc.
References add_lfvector_lfvectorS(), cp_lfvector(), create_lfvector(), del_lfvector(), dot_lfvector(), filter, mul_bfmatrix_lfvector(), print_lvector(), printf, result, SIM_SOLVER_NO_CONVERGENCE, SIM_SOLVER_SUCCESS, sqrtf, sub_lfvector_lfvector(), fmatrix3x3::vcount, and z().
Referenced by SIM_mass_spring_solve_velocities().
| DO_INLINE void cp_bfmatrix | ( | fmatrix3x3 * | to, |
| fmatrix3x3 * | from ) |
Definition at line 555 of file implicit_blender.cc.
References DO_INLINE.
Referenced by SIM_mass_spring_solve_velocities().
Definition at line 338 of file implicit_blender.cc.
References copy_v3_v3(), and DO_INLINE.
Referenced by init_bfmatrix(), initdiag_bfmatrix(), and initdiag_fmatrixS().
Definition at line 129 of file implicit_blender.cc.
References DO_INLINE, and verts.
Referenced by cg_filtered(), and SIM_mass_spring_apply_result().
| DO_INLINE fmatrix3x3 * create_bfmatrix | ( | uint | verts, |
| uint | springs ) |
Definition at line 530 of file implicit_blender.cc.
References DO_INLINE, i, init_fmatrix(), MEM_calloc_arrayN(), fmatrix3x3::scount, fmatrix3x3::vcount, and verts.
Referenced by SIM_mass_spring_solver_create().
Definition at line 114 of file implicit_blender.cc.
References DO_INLINE, MEM_calloc_arrayN(), and verts.
Referenced by cg_filtered(), mul_bfmatrix_lfvector(), SIM_mass_spring_solve_velocities(), and SIM_mass_spring_solver_create().
| BLI_INLINE void cross_m3_v3m3 | ( | float | r[3][3], |
| const float | v[3], | ||
| const float | m[3][3] ) |
Definition at line 473 of file implicit_blender.cc.
References BLI_INLINE, cross_v3_v3v3(), and v.
Referenced by SIM_mass_spring_force_reference_frame().
| BLI_INLINE void cross_v3_identity | ( | float | r[3][3], |
| const float | v[3] ) |
Definition at line 480 of file implicit_blender.cc.
References BLI_INLINE, and v.
Referenced by SIM_mass_spring_force_reference_frame().
| DO_INLINE void del_bfmatrix | ( | fmatrix3x3 * | matrix | ) |
Definition at line 547 of file implicit_blender.cc.
References DO_INLINE, and MEM_freeN().
Referenced by SIM_mass_spring_solver_free().
Definition at line 121 of file implicit_blender.cc.
References DO_INLINE, and MEM_freeN().
Referenced by cg_filtered(), mul_bfmatrix_lfvector(), SIM_mass_spring_solve_velocities(), and SIM_mass_spring_solver_free().
| BLI_INLINE void dfdv_damp | ( | float | to[3][3], |
| const float | dir[3], | ||
| float | damping ) |
Definition at line 1662 of file implicit_blender.cc.
References BLI_INLINE, mul_m3_fl(), and outerproduct().
Referenced by SIM_mass_spring_force_spring_goal(), and SIM_mass_spring_force_spring_linear().
Definition at line 1633 of file implicit_blender.cc.
References BLI_INLINE, I, L, length(), mul_m3_fl(), outerproduct(), and sub_m3_m3m3().
Referenced by SIM_mass_spring_force_spring_goal(), and SIM_mass_spring_force_spring_linear().
Definition at line 165 of file implicit_blender.cc.
References CLOTH_PARALLEL_LIMIT, DO_INLINE, dot_v3v3(), i, blender::threading::parallel_deterministic_reduce(), and verts.
Referenced by cg_filtered().
| BLI_INLINE void edge_avg | ( | lfVector * | data, |
| int | i, | ||
| int | j, | ||
| float | r_avg[3] ) |
Definition at line 1875 of file implicit_blender.cc.
References BLI_INLINE, data, and i.
Referenced by spring_angle().
| BLI_INLINE void edge_norm | ( | lfVector * | data, |
| int | i, | ||
| int | j, | ||
| float | r_dir[3] ) |
Definition at line 1882 of file implicit_blender.cc.
References BLI_INLINE, data, i, normalize_v3(), and sub_v3_v3v3().
Referenced by spring_angle().
|
static |
Definition at line 1575 of file implicit_blender.cc.
References dot_v3v3(), float, len_v3(), length(), M_PI, mul_v3_v3fl(), sqrtf, and zero_v3().
Referenced by SIM_mass_spring_force_edge_wind().
| BLI_INLINE float fb | ( | float | length, |
| float | L ) |
Definition at line 1669 of file implicit_blender.cc.
References BLI_INLINE, L, length(), and x.
Referenced by blender::gpu::Texture::attach_to(), EPA< btConvexTemplate >::bind(), gjkepa2_impl::EPA::bind(), BM_edge_calc_rotate(), BM_edge_rotate(), BM_edge_rotate_check(), BPyGPUFrameBuffer_CreatePyObject(), blender::gpu::GLTexture::check_feedback_loop(), blender::gpu::GLTexture::clear(), blender::gpu::MTLTexture::clear(), convertJoints(), blender::gpu::Texture::detach_from(), ED_region_do_draw(), edbm_edge_rotate_selected_exec(), blender::gpu::MTLContext::ensure_depth_stencil_state(), blender::draw::command::Clear::execute(), blender::draw::command::ClearMulti::execute(), fbstar(), fbstar_jacobi(), GPU_framebuffer_bind(), GPU_framebuffer_bind_loadstore(), GPU_framebuffer_bind_no_srgb(), GPU_framebuffer_clear_color(), GPU_framebuffer_clear_color_depth(), GPU_framebuffer_clear_color_depth_stencil(), GPU_framebuffer_clear_depth(), GPU_framebuffer_clear_depth_stencil(), GPU_framebuffer_clear_stencil(), GPU_framebuffer_config_array(), GPU_framebuffer_free(), GPU_framebuffer_get_name(), GPU_framebuffer_multi_clear(), GPU_framebuffer_push(), GPU_framebuffer_py_reference_get(), GPU_framebuffer_py_reference_set(), GPU_framebuffer_read_color(), GPU_framebuffer_read_depth(), GPU_framebuffer_subpass_transition_array(), GPU_framebuffer_texture_attach(), GPU_framebuffer_texture_cubeface_attach(), GPU_framebuffer_texture_detach(), GPU_framebuffer_texture_layer_attach(), GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_unbind(), gpu_select_pick_load_id(), blender::gpu::tests::gpu_shader_lib_test(), GPU_viewport_bind_from_offscreen(), IMB_rectfill_area(), internalInitMultipleJoints(), lineart_bounding_area_triangle_intersect(), pygpu_framebuffer_free_if_possible(), pygpu_framebuffer_stack_pop_and_restore_or_error(), pygpu_framebuffer_stack_push_and_bind_or_error(), pygpu_state_active_framebuffer_get(), blender::gpu::Texture::read(), blender::gpu::MTLRenderPassState::reset_state(), blender::ed::vse::sequencer_ibuf_get(), blender::draw::test_draw_curves_lib(), blender::draw::test_draw_pass_all_commands(), blender::ed::vse::update_gpu_scopes(), blender::gpu::tests::ShaderSpecializationConst::validate(), write_render_color_output(), write_render_z_output(), and writeBackJoints().
| BLI_INLINE float fbderiv | ( | float | length, |
| float | L ) |
Definition at line 1678 of file implicit_blender.cc.
References BLI_INLINE, L, length(), and x.
Referenced by fbstar_jacobi().
Definition at line 1686 of file implicit_blender.cc.
References BLI_INLINE, fb(), L, and length().
Referenced by SIM_mass_spring_force_spring_bending(), and SIM_mass_spring_force_spring_linear().
Definition at line 1699 of file implicit_blender.cc.
References BLI_INLINE, fb(), fbderiv(), L, and length().
Referenced by SIM_mass_spring_force_spring_bending(), and SIM_mass_spring_force_spring_linear().
| DO_INLINE void filter | ( | lfVector * | V, |
| fmatrix3x3 * | S ) |
Definition at line 743 of file implicit_blender.cc.
References DO_INLINE, i, mul_m3_v3(), and V.
| DO_INLINE void init_bfmatrix | ( | fmatrix3x3 * | matrix, |
| float | m3[3][3] ) |
Definition at line 563 of file implicit_blender.cc.
References cp_fmatrix(), DO_INLINE, i, fmatrix3x3::scount, and fmatrix3x3::vcount.
Referenced by SIM_mass_spring_clear_forces().
| BLI_INLINE void init_fmatrix | ( | fmatrix3x3 * | matrix, |
| int | r, | ||
| int | c ) |
Definition at line 523 of file implicit_blender.cc.
References BLI_INLINE, fmatrix3x3::c, and fmatrix3x3::r.
Referenced by create_bfmatrix(), and SIM_mass_spring_add_block().
Definition at line 134 of file implicit_blender.cc.
References copy_v3_v3(), DO_INLINE, i, and verts.
| DO_INLINE void initdiag_bfmatrix | ( | fmatrix3x3 * | matrix, |
| float | m3[3][3] ) |
Definition at line 574 of file implicit_blender.cc.
References cp_fmatrix(), DO_INLINE, i, fmatrix3x3::scount, and fmatrix3x3::vcount.
Referenced by SIM_mass_spring_solver_create().
Definition at line 347 of file implicit_blender.cc.
References cp_fmatrix(), DO_INLINE, and ZERO.
| BLI_INLINE void madd_m3_m3fl | ( | float | r[3][3], |
| const float | m[3][3], | ||
| float | f ) |
Definition at line 493 of file implicit_blender.cc.
References BLI_INLINE.
Referenced by SIM_mass_spring_force_spring_bending_hair().
| DO_INLINE void mul_bfmatrix_lfvector | ( | float(*) | to[3], |
| fmatrix3x3 * | from, | ||
| lfVector * | fLongVector ) |
Definition at line 589 of file implicit_blender.cc.
References add_lfvector_lfvector(), CLOTH_PARALLEL_LIMIT, create_lfvector(), del_lfvector(), DO_INLINE, i, muladd_fmatrix_fvector(), muladd_fmatrixT_fvector(), blender::threading::parallel_invoke(), fmatrix3x3::scount, fmatrix3x3::vcount, and zero_lfvector().
Referenced by cg_filtered(), and SIM_mass_spring_solve_velocities().
Definition at line 415 of file implicit_blender.cc.
References DO_INLINE, and dot_v3v3().
Definition at line 397 of file implicit_blender.cc.
References DO_INLINE, and mul_fvector_S().
Definition at line 406 of file implicit_blender.cc.
References DO_INLINE.
Definition at line 68 of file implicit_blender.cc.
References DO_INLINE.
Referenced by mul_fmatrix_S(), mul_fvectorT_fvector(), mul_fvectorT_fvectorS(), and mul_lfvectorS().
| DO_INLINE void mul_fvectorT_fvector | ( | float | to[3][3], |
| const float | vectorA[3], | ||
| const float | vectorB[3] ) |
Definition at line 76 of file implicit_blender.cc.
References DO_INLINE, and mul_fvector_S().
Referenced by mul_fvectorT_fvectorS(), SIM_mass_spring_add_constraint_ndof1(), and SIM_mass_spring_add_constraint_ndof2().
| DO_INLINE void mul_fvectorT_fvectorS | ( | float | to[3][3], |
| float | vectorA[3], | ||
| float | vectorB[3], | ||
| float | aS ) |
Definition at line 84 of file implicit_blender.cc.
References DO_INLINE, mul_fvector_S(), and mul_fvectorT_fvector().
Definition at line 147 of file implicit_blender.cc.
References DO_INLINE, i, mul_fvector_S(), and verts.
| DO_INLINE void muladd_fmatrix_fvector | ( | float | to[3], |
| const float | matrix[3][3], | ||
| const float | from[3] ) |
Definition at line 452 of file implicit_blender.cc.
References DO_INLINE, and dot_v3v3().
Referenced by mul_bfmatrix_lfvector().
| DO_INLINE void muladd_fmatrixT_fvector | ( | float | to[3], |
| const float | matrix[3][3], | ||
| const float | from[3] ) |
Definition at line 459 of file implicit_blender.cc.
References DO_INLINE.
Referenced by mul_bfmatrix_lfvector().
| BLI_INLINE void outerproduct | ( | float | r[3][3], |
| const float | a[3], | ||
| const float | b[3] ) |
Definition at line 466 of file implicit_blender.cc.
References b, BLI_INLINE, and mul_v3_v3fl().
Referenced by dfdv_damp(), dfdx_spring(), SIM_mass_spring_force_spring_bending(), SIM_mass_spring_force_spring_linear(), and spring_grad_dir().
| BLI_INLINE void poly_avg | ( | lfVector * | data, |
| const int * | inds, | ||
| int | len, | ||
| float | r_avg[3] ) |
Definition at line 1855 of file implicit_blender.cc.
References BLI_INLINE, data, float, i, len, madd_v3_v3fl(), and zero_v3().
Referenced by poly_norm(), and spring_angle().
| BLI_INLINE void poly_norm | ( | lfVector * | data, |
| int | i, | ||
| int | j, | ||
| int * | inds, | ||
| int | len, | ||
| float | r_dir[3] ) |
Definition at line 1866 of file implicit_blender.cc.
References BLI_INLINE, data, i, len, normal_tri_v3(), and poly_avg().
Referenced by spring_angle().
| BLI_INLINE void root_to_world_m3 | ( | Implicit_Data * | data, |
| int | index, | ||
| float | r[3][3], | ||
| const float | m[3][3] ) |
Definition at line 733 of file implicit_blender.cc.
References BLI_INLINE, data, and mul_m3_m3m3().
| BLI_INLINE void root_to_world_v3 | ( | Implicit_Data * | data, |
| int | index, | ||
| float | r[3], | ||
| const float | v[3] ) |
Definition at line 717 of file implicit_blender.cc.
References BLI_INLINE, data, mul_v3_m3v3(), and v.
Referenced by SIM_mass_spring_get_motion_state(), SIM_mass_spring_get_new_position(), SIM_mass_spring_get_new_velocity(), SIM_mass_spring_get_position(), and SIM_mass_spring_get_velocity().
|
static |
Definition at line 1255 of file implicit_blender.cc.
References BLI_assert, data, init_fmatrix(), M, and v2.
Referenced by apply_spring(), and SIM_mass_spring_force_spring_bending_hair().
| void SIM_mass_spring_add_constraint_ndof0 | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | dV[3] ) |
Definition at line 1282 of file implicit_blender.cc.
References data, world_to_root_v3(), and zero_m3().
Referenced by cloth_setup_constraints().
| void SIM_mass_spring_add_constraint_ndof1 | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | c1[3], | ||
| const float | c2[3], | ||
| const float | dV[3] ) |
Definition at line 1289 of file implicit_blender.cc.
References add_v3_v3(), copy_m3_m3(), data, I, mul_fvectorT_fvector(), sub_m3_m3m3(), and world_to_root_v3().
| void SIM_mass_spring_add_constraint_ndof2 | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | c1[3], | ||
| const float | dV[3] ) |
Definition at line 1310 of file implicit_blender.cc.
References add_v3_v3(), copy_m3_m3(), data, I, mul_fvectorT_fvector(), sub_m3_m3m3(), and world_to_root_v3().
| void SIM_mass_spring_apply_result | ( | Implicit_Data * | data | ) |
Definition at line 1171 of file implicit_blender.cc.
References cp_lfvector(), and data.
Referenced by SIM_cloth_solve().
| void SIM_mass_spring_clear_constraints | ( | Implicit_Data * | data | ) |
Definition at line 1273 of file implicit_blender.cc.
References data, i, unit_m3(), and zero_v3().
Referenced by cloth_setup_constraints().
| void SIM_mass_spring_clear_forces | ( | struct Implicit_Data * | data | ) |
Clear the force vector at the beginning of the time step.
Definition at line 1328 of file implicit_blender.cc.
References data, init_bfmatrix(), ZERO, and zero_lfvector().
Referenced by SIM_cloth_solve().
| void SIM_mass_spring_force_drag | ( | struct Implicit_Data * | data, |
| float | drag ) |
Global drag force (velocity damping).
Definition at line 1403 of file implicit_blender.cc.
References add_m3_m3m3(), copy_m3_m3(), data, I, i, madd_v3_v3fl(), and mul_m3_fl().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_edge_wind | ( | struct Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| float | radius1, | ||
| float | radius2, | ||
| const float(*) | winvec[3] ) |
Wind force, acting on an edge.
Definition at line 1600 of file implicit_blender.cc.
References add_v3_v3(), data, edge_wind_vertex(), length(), normalize_v3(), sub_v3_v3v3(), v2, and world_to_root_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_extern | ( | struct Implicit_Data * | data, |
| int | i, | ||
| const float | f[3], | ||
| float | dfdx[3][3], | ||
| float | dfdv[3][3] ) |
Custom external force.
Definition at line 1418 of file implicit_blender.cc.
References add_m3_m3m3(), add_v3_v3(), data, i, world_to_root_m3(), and world_to_root_v3().
| void SIM_mass_spring_force_face_extern | ( | struct Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| int | v3, | ||
| const float(*) | forcevec[3] ) |
Arbitrary per-unit-area vector force field acting on a face..
Definition at line 1488 of file implicit_blender.cc.
References add_v3_v3(), calc_nor_area_tri(), data, i, mul_v3_fl(), nor, v2, world_to_root_v3(), and zero_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_face_wind | ( | struct Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| int | v3, | ||
| const float(*) | winvec[3] ) |
Wind force, acting on a face (only generates pressure from the normal component).
Definition at line 1445 of file implicit_blender.cc.
References calc_nor_area_tri(), data, dot_v3v3(), i, madd_v3_v3fl(), mul_v3_fl(), nor, v2, and world_to_root_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_gravity | ( | struct Implicit_Data * | data, |
| int | index, | ||
| float | mass, | ||
| const float | g[3] ) |
Simple uniform gravity force.
Definition at line 1393 of file implicit_blender.cc.
References add_v3_v3(), data, mul_v3_fl(), and world_to_root_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_pressure | ( | Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| int | v3, | ||
| float | common_pressure, | ||
| const float * | vertex_pressure, | ||
| const float | weights[3] ) |
Definition at line 1532 of file implicit_blender.cc.
References calc_nor_area_tri(), copy_v3_fl3(), data, madd_v3_v3fl(), mul_v3_fl(), nor, v2, and zero_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_force_reference_frame | ( | struct Implicit_Data * | data, |
| int | index, | ||
| const float | acceleration[3], | ||
| const float | omega[3], | ||
| const float | domega_dt[3], | ||
| float | mass ) |
Fictitious forces introduced by moving coordinate systems.
Definition at line 1338 of file implicit_blender.cc.
References add_m3_m3m3(), add_v3_v3(), copy_m3_m3(), cross_m3_v3m3(), cross_v3_identity(), cross_v3_v3v3(), data, mul_m3_fl(), mul_v3_fl(), negate_m3(), sub_v3_v3(), sub_v3_v3v3(), w(), and world_to_root_v3().
| bool SIM_mass_spring_force_spring_angular | ( | struct Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int * | i_a, | ||
| int * | i_b, | ||
| int | len_a, | ||
| int | len_b, | ||
| float | restang, | ||
| float | stiffness, | ||
| float | damping ) |
Angular spring force between two polygons.
Definition at line 1932 of file implicit_blender.cc.
References add_v3_v3(), add_v3_v3v3(), angle(), data, dot_v3v3(), i, mul_v3_v3fl(), spring_angle(), sub_v3_v3(), and x.
Referenced by cloth_calc_spring_force().
| bool SIM_mass_spring_force_spring_bending | ( | struct Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| float | restlen, | ||
| float | kb, | ||
| float | cb ) |
Bending force, forming a triangle at the base of two structural springs.
Definition at line 1826 of file implicit_blender.cc.
References apply_spring(), data, fbstar(), fbstar_jacobi(), i, length(), mul_m3_fl(), mul_v3_v3fl(), outerproduct(), spring_length(), and zero_m3().
Referenced by cloth_calc_spring_force().
| bool SIM_mass_spring_force_spring_bending_hair | ( | struct Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int | k, | ||
| const float | target[3], | ||
| float | stiffness, | ||
| float | damping ) |
Angular bending force based on local target vectors.
Definition at line 2150 of file implicit_blender.cc.
References add_m3_m3m3(), add_v3_v3(), copy_m3_m3(), copy_v3_v3(), data, dot_v3v3(), I, i, madd_m3_m3fl(), madd_v3_v3fl(), madd_v3_v3v3fl(), mul_v3_v3fl(), negate_m3(), negate_v3_v3(), SIM_mass_spring_add_block(), spring_grad_dir(), spring_hairbend_estimate_dfdv(), spring_hairbend_estimate_dfdx(), spring_hairbend_forces(), sub_m3_m3m3(), sub_v3_v3(), sub_v3_v3v3(), world_to_root_v3(), zero_m3(), and zero_v3().
Referenced by cloth_calc_spring_force().
| bool SIM_mass_spring_force_spring_goal | ( | struct Implicit_Data * | data, |
| int | i, | ||
| const float | goal_x[3], | ||
| const float | goal_v[3], | ||
| float | stiffness, | ||
| float | damping ) |
Global goal spring.
Definition at line 2302 of file implicit_blender.cc.
References add_m3_m3m3(), add_v3_v3(), ALMOST_ZERO, data, dfdv_damp(), dfdx_spring(), dot_v3v3(), i, length(), madd_v3_v3fl(), mul_v3_v3fl(), normalize_v3_v3(), sub_v3_v3v3(), and world_to_root_v3().
Referenced by cloth_calc_force().
| bool SIM_mass_spring_force_spring_linear | ( | struct Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| float | restlen, | ||
| float | stiffness_tension, | ||
| float | damping_tension, | ||
| float | stiffness_compression, | ||
| float | damping_compression, | ||
| bool | resist_compress, | ||
| bool | new_compress, | ||
| float | clamp_force ) |
Linear spring force between two points.
Definition at line 1766 of file implicit_blender.cc.
References apply_spring(), data, dfdv_damp(), dfdx_spring(), dot_v3v3(), fbstar(), fbstar_jacobi(), i, length(), madd_v3_v3fl(), mul_m3_fl(), mul_v3_v3fl(), outerproduct(), and spring_length().
Referenced by cloth_calc_spring_force().
| void SIM_mass_spring_force_vertex_wind | ( | struct Implicit_Data * | data, |
| int | v, | ||
| float | radius, | ||
| const float(*) | winvec[3] ) |
Wind force, acting on a vertex.
Definition at line 1618 of file implicit_blender.cc.
References add_v3_v3(), data, mul_v3_v3fl(), v, and world_to_root_v3().
Referenced by cloth_calc_force().
| void SIM_mass_spring_get_motion_state | ( | Implicit_Data * | data, |
| int | index, | ||
| float | x[3], | ||
| float | v[3] ) |
Definition at line 1213 of file implicit_blender.cc.
References data, root_to_world_v3(), v, and x.
Referenced by cloth_calc_force(), cloth_calc_spring_force(), hair_get_boundbox(), and SIM_cloth_solve().
| void SIM_mass_spring_get_new_position | ( | Implicit_Data * | data, |
| int | index, | ||
| float | x[3] ) |
Definition at line 1233 of file implicit_blender.cc.
References data, root_to_world_v3(), and x.
Referenced by cloth_solve_collisions().
| void SIM_mass_spring_get_new_velocity | ( | Implicit_Data * | data, |
| int | index, | ||
| float | v[3] ) |
Definition at line 1243 of file implicit_blender.cc.
References data, root_to_world_v3(), and v.
Referenced by cloth_calc_average_acceleration(), cloth_continuum_step(), cloth_get_grid_location(), and cloth_solve_collisions().
| void SIM_mass_spring_get_position | ( | Implicit_Data * | data, |
| int | index, | ||
| float | x[3] ) |
Definition at line 1223 of file implicit_blender.cc.
References data, root_to_world_v3(), and x.
Referenced by cloth_calc_pressure_gradient(), cloth_continuum_step(), and cloth_get_grid_location().
| void SIM_mass_spring_get_velocity | ( | Implicit_Data * | data, |
| int | index, | ||
| float | v[3] ) |
Definition at line 1228 of file implicit_blender.cc.
References data, root_to_world_v3(), and v.
Referenced by cloth_calc_average_acceleration().
| void SIM_mass_spring_set_motion_state | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | x[3], | ||
| const float | v[3] ) |
Definition at line 1194 of file implicit_blender.cc.
References data, v, world_to_root_v3(), and x.
Referenced by SIM_cloth_solver_init(), and SIM_cloth_solver_set_positions().
| void SIM_mass_spring_set_new_position | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | x[3] ) |
Definition at line 1238 of file implicit_blender.cc.
References data, world_to_root_v3(), and x.
| void SIM_mass_spring_set_new_velocity | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | v[3] ) |
Definition at line 1248 of file implicit_blender.cc.
References data, v, and world_to_root_v3().
Referenced by cloth_continuum_step(), and cloth_solve_collisions().
| void SIM_mass_spring_set_position | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | x[3] ) |
Definition at line 1203 of file implicit_blender.cc.
References data, world_to_root_v3(), and x.
Referenced by SIM_cloth_solve().
| void SIM_mass_spring_set_rest_transform | ( | Implicit_Data * | data, |
| int | index, | ||
| float | tfm[3][3] ) |
Definition at line 1184 of file implicit_blender.cc.
References copy_m3_m3(), data, and unit_m3().
Referenced by SIM_cloth_solver_set_positions().
| void SIM_mass_spring_set_velocity | ( | Implicit_Data * | data, |
| int | index, | ||
| const float | v[3] ) |
Definition at line 1208 of file implicit_blender.cc.
References data, v, and world_to_root_v3().
Referenced by SIM_cloth_solve().
| void SIM_mass_spring_set_vertex_mass | ( | Implicit_Data * | data, |
| int | index, | ||
| float | mass ) |
Definition at line 1178 of file implicit_blender.cc.
References data, mul_m3_fl(), and unit_m3().
Referenced by SIM_mass_spring_set_implicit_vertex_mass().
| bool SIM_mass_spring_solve_positions | ( | Implicit_Data * | data, |
| float | dt ) |
Definition at line 1161 of file implicit_blender.cc.
References add_lfvector_lfvectorS(), and data.
Referenced by cloth_solve_collisions(), and SIM_cloth_solve().
| bool SIM_mass_spring_solve_velocities | ( | Implicit_Data * | data, |
| float | dt, | ||
| ImplicitSolverResult * | result ) |
Definition at line 1124 of file implicit_blender.cc.
References add_lfvector_lfvector(), add_lfvectorS_lfvectorS(), BLI_time_now_seconds(), cg_filtered(), cp_bfmatrix(), create_lfvector(), data, del_lfvector(), mul_bfmatrix_lfvector(), printf, result, SIM_SOLVER_SUCCESS, subadd_bfmatrixS_bfmatrixS(), and zero_lfvector().
Referenced by SIM_cloth_solve().
| Implicit_Data * SIM_mass_spring_solver_create | ( | int | numverts, |
| int | numsprings ) |
Definition at line 657 of file implicit_blender.cc.
References Implicit_Data::bigI, create_bfmatrix(), create_lfvector(), I, initdiag_bfmatrix(), and MEM_callocN().
Referenced by SIM_cloth_solver_init().
| void SIM_mass_spring_solver_free | ( | Implicit_Data * | id | ) |
Definition at line 685 of file implicit_blender.cc.
References Implicit_Data::A, Implicit_Data::B, Implicit_Data::bigI, del_bfmatrix(), del_lfvector(), Implicit_Data::dFdV, Implicit_Data::dFdX, Implicit_Data::dV, Implicit_Data::F, Implicit_Data::M, MEM_freeN(), Implicit_Data::P, Implicit_Data::Pinv, Implicit_Data::S, Implicit_Data::tfm, Implicit_Data::V, Implicit_Data::Vnew, Implicit_Data::X, Implicit_Data::Xnew, and Implicit_Data::z.
Referenced by SIM_cloth_solver_free().
| float SIM_tri_area | ( | Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| int | v3 ) |
Definition at line 1525 of file implicit_blender.cc.
References calc_nor_area_tri(), data, nor, and v2.
Referenced by cloth_calc_average_pressure().
| float SIM_tri_tetra_volume_signed_6x | ( | Implicit_Data * | data, |
| int | v1, | ||
| int | v2, | ||
| int | v3 ) |
Definition at line 1519 of file implicit_blender.cc.
References data, v2, and volume_tri_tetrahedron_signed_v3_6x().
Referenced by cloth_calc_volume().
| BLI_INLINE void spring_angle | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int * | i_a, | ||
| int * | i_b, | ||
| int | len_a, | ||
| int | len_b, | ||
| float | r_dir_a[3], | ||
| float | r_dir_b[3], | ||
| float * | r_angle, | ||
| float | r_vel_a[3], | ||
| float | r_vel_b[3] ) |
Definition at line 1901 of file implicit_blender.cc.
References bend_angle(), BLI_INLINE, data, edge_avg(), edge_norm(), i, poly_avg(), poly_norm(), and sub_v3_v3().
Referenced by SIM_mass_spring_force_spring_angular().
| BLI_INLINE void spring_grad_dir | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| float | edge[3], | ||
| float | dir[3], | ||
| float | grad_dir[3][3] ) |
Definition at line 1984 of file implicit_blender.cc.
References ALMOST_ZERO, BLI_INLINE, data, I, i, length(), mul_m3_fl(), normalize_v3_v3(), outerproduct(), sub_m3_m3m3(), sub_v3_v3v3(), and zero_m3().
Referenced by SIM_mass_spring_force_spring_bending_hair().
| BLI_INLINE void spring_hairbend_estimate_dfdv | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int | k, | ||
| const float | goal[3], | ||
| float | stiffness, | ||
| float | damping, | ||
| int | q, | ||
| float | dfdv[3][3] ) |
Definition at line 2112 of file implicit_blender.cc.
References b, BLI_INLINE, copy_m3_m3(), copy_v3_v3(), data, i, mul_m3_fl(), negate_m3(), spring_hairbend_forces(), sub_v3_v3(), unit_m3(), and zero_m3().
Referenced by SIM_mass_spring_force_spring_bending_hair().
| BLI_INLINE void spring_hairbend_estimate_dfdx | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int | k, | ||
| const float | goal[3], | ||
| float | stiffness, | ||
| float | damping, | ||
| int | q, | ||
| float | dfdx[3][3] ) |
Definition at line 2073 of file implicit_blender.cc.
References b, BLI_INLINE, copy_m3_m3(), copy_v3_v3(), data, i, mul_m3_fl(), negate_m3(), spring_hairbend_forces(), sub_v3_v3(), unit_m3(), and zero_m3().
Referenced by SIM_mass_spring_force_spring_bending_hair().
| BLI_INLINE void spring_hairbend_forces | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| int | k, | ||
| const float | goal[3], | ||
| float | stiffness, | ||
| float | damping, | ||
| int | q, | ||
| const float | dx[3], | ||
| const float | dv[3], | ||
| float | r_f[3] ) |
Definition at line 2002 of file implicit_blender.cc.
References add_v3_v3(), BLI_INLINE, copy_v3_v3(), data, dot_v3v3(), i, madd_v3_v3v3fl(), mul_v3_v3fl(), normalize_v3_v3(), sub_v3_v3(), sub_v3_v3v3(), and zero_v3().
Referenced by SIM_mass_spring_force_spring_bending_hair(), spring_hairbend_estimate_dfdv(), and spring_hairbend_estimate_dfdx().
| BLI_INLINE bool spring_length | ( | Implicit_Data * | data, |
| int | i, | ||
| int | j, | ||
| float | r_extent[3], | ||
| float | r_dir[3], | ||
| float * | r_length, | ||
| float | r_vel[3] ) |
Definition at line 1712 of file implicit_blender.cc.
References ALMOST_ZERO, BLI_INLINE, data, i, L, len_v3(), length(), mul_v3_v3fl(), sub_v3_v3v3(), and zero_v3().
Referenced by SIM_mass_spring_force_spring_bending(), and SIM_mass_spring_force_spring_linear().
| DO_INLINE void sub_fmatrix_fmatrix | ( | float | to[3][3], |
| const float | matrixA[3][3], | ||
| const float | matrixB[3][3] ) |
Definition at line 439 of file implicit_blender.cc.
References DO_INLINE, and sub_v3_v3v3().
| DO_INLINE void sub_lfvector_lfvector | ( | float(*) | to[3], |
| float(*) | fLongVectorA[3], | ||
| float(*) | fLongVectorB[3], | ||
| uint | verts ) |
Definition at line 237 of file implicit_blender.cc.
References DO_INLINE, i, sub_v3_v3v3(), and verts.
Referenced by cg_filtered().
| DO_INLINE void subadd_bfmatrixS_bfmatrixS | ( | fmatrix3x3 * | to, |
| fmatrix3x3 * | from, | ||
| float | aS, | ||
| fmatrix3x3 * | matrix, | ||
| float | bS ) |
Definition at line 619 of file implicit_blender.cc.
References DO_INLINE, i, fmatrix3x3::scount, subadd_fmatrixS_fmatrixS(), and fmatrix3x3::vcount.
Referenced by SIM_mass_spring_solve_velocities().
| DO_INLINE void subadd_fmatrixS_fmatrixS | ( | float | to[3][3], |
| const float | matrixA[3][3], | ||
| float | aS, | ||
| const float | matrixB[3][3], | ||
| float | bS ) |
Definition at line 431 of file implicit_blender.cc.
References DO_INLINE, and VECSUBADDSS.
Referenced by subadd_bfmatrixS_bfmatrixS().
| BLI_INLINE void world_to_root_m3 | ( | Implicit_Data * | data, |
| int | index, | ||
| float | r[3][3], | ||
| const float | m[3][3] ) |
Definition at line 722 of file implicit_blender.cc.
References BLI_INLINE, copy_m3_m3(), data, mul_m3_m3m3(), and transpose_m3().
Referenced by SIM_mass_spring_force_extern().
| BLI_INLINE void world_to_root_v3 | ( | Implicit_Data * | data, |
| int | index, | ||
| float | r[3], | ||
| const float | v[3] ) |
Definition at line 711 of file implicit_blender.cc.
References BLI_INLINE, copy_v3_v3(), data, mul_transposed_m3_v3(), and v.
Referenced by SIM_mass_spring_add_constraint_ndof0(), SIM_mass_spring_add_constraint_ndof1(), SIM_mass_spring_add_constraint_ndof2(), SIM_mass_spring_force_edge_wind(), SIM_mass_spring_force_extern(), SIM_mass_spring_force_face_extern(), SIM_mass_spring_force_face_wind(), SIM_mass_spring_force_gravity(), SIM_mass_spring_force_reference_frame(), SIM_mass_spring_force_spring_bending_hair(), SIM_mass_spring_force_spring_goal(), SIM_mass_spring_force_vertex_wind(), SIM_mass_spring_set_motion_state(), SIM_mass_spring_set_new_position(), SIM_mass_spring_set_new_velocity(), SIM_mass_spring_set_position(), and SIM_mass_spring_set_velocity().
Definition at line 142 of file implicit_blender.cc.
References DO_INLINE, and verts.
Referenced by mul_bfmatrix_lfvector(), SIM_mass_spring_clear_forces(), and SIM_mass_spring_solve_velocities().
|
static |
Definition at line 36 of file implicit_blender.cc.
|
static |
Definition at line 37 of file implicit_blender.cc.