|
Blender V5.0
|
Go to the source code of this file.
Classes | |
| struct | EffectedPoint |
| struct | GuideEffectorData |
| struct | EffectorData |
| struct | EffectorCache |
| struct | EffectorRelation |
| struct | SimDebugElement |
| struct | SimDebugData |
Macros | |
| #define | PE_WIND_AS_SPEED 1 |
| #define | PE_USE_NORMAL_DATA 4 |
| #define | PE_VELOCITY_TO_IMPULSE 1 |
| #define | _VA_SIM_DEBUG_HASH1(a) |
| #define | _VA_SIM_DEBUG_HASH2(a, b) |
| #define | _VA_SIM_DEBUG_HASH3(a, b, c) |
| #define | _VA_SIM_DEBUG_HASH4(a, b, c, d) |
| #define | _VA_SIM_DEBUG_HASH5(a, b, c, d, e) |
| #define | _VA_SIM_DEBUG_HASH6(a, b, c, d, e, f) |
| #define | _VA_SIM_DEBUG_HASH7(a, b, c, d, e, f, g) |
| #define | _VA_SIM_DEBUG_HASH8(a, b, c, d, e, f, g, h) |
| #define | SIM_DEBUG_HASH(...) |
| #define | BKE_sim_debug_data_add_dot(p, r, g, b, category, ...) |
| #define | BKE_sim_debug_data_add_circle(p, radius, r, g, b, category, ...) |
| #define | BKE_sim_debug_data_add_line(p1, p2, r, g, b, category, ...) |
| #define | BKE_sim_debug_data_add_vector(p, d, r, g, b, category, ...) |
| #define | BKE_sim_debug_data_add_string(p, str, r, g, b, category, ...) |
| #define | BKE_sim_debug_data_remove(...) |
Typedefs | |
| typedef struct EffectedPoint | EffectedPoint |
| typedef struct GuideEffectorData | GuideEffectorData |
| typedef struct EffectorData | EffectorData |
| typedef struct EffectorCache | EffectorCache |
| typedef struct EffectorRelation | EffectorRelation |
| typedef struct SimDebugElement | SimDebugElement |
| typedef enum eSimDebugElement_Type | eSimDebugElement_Type |
| typedef struct SimDebugData | SimDebugData |
Enumerations | |
| enum | eSimDebugElement_Type { SIM_DEBUG_ELEM_DOT , SIM_DEBUG_ELEM_CIRCLE , SIM_DEBUG_ELEM_LINE , SIM_DEBUG_ELEM_VECTOR , SIM_DEBUG_ELEM_STRING } |
Variables | |
| SimDebugData * | _sim_debug_data |
| #define _VA_SIM_DEBUG_HASH1 | ( | a | ) |
Definition at line 178 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH2 | ( | a, | |
| b ) |
Definition at line 179 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH3 | ( | a, | |
| b, | |||
| c ) |
Definition at line 181 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH4 | ( | a, | |
| b, | |||
| c, | |||
| d ) |
Definition at line 183 of file BKE_effect.h.
Definition at line 185 of file BKE_effect.h.
Definition at line 187 of file BKE_effect.h.
Definition at line 189 of file BKE_effect.h.
Definition at line 192 of file BKE_effect.h.
| #define BKE_sim_debug_data_add_circle | ( | p, | |
| radius, | |||
| r, | |||
| g, | |||
| b, | |||
| category, | |||
| ... ) |
Definition at line 245 of file BKE_effect.h.
Referenced by cloth_continuum_step(), and SIM_hair_volume_solve_divergence().
| #define BKE_sim_debug_data_add_dot | ( | p, | |
| r, | |||
| g, | |||
| b, | |||
| category, | |||
| ... ) |
Definition at line 238 of file BKE_effect.h.
Referenced by cloth_calc_spring_force(), cloth_continuum_step(), and SIM_hair_volume_solve_divergence().
| #define BKE_sim_debug_data_add_line | ( | p1, | |
| p2, | |||
| r, | |||
| g, | |||
| b, | |||
| category, | |||
| ... ) |
Definition at line 252 of file BKE_effect.h.
Referenced by cloth_calc_spring_force().
Definition at line 264 of file BKE_effect.h.
| #define BKE_sim_debug_data_add_vector | ( | p, | |
| d, | |||
| r, | |||
| g, | |||
| b, | |||
| category, | |||
| ... ) |
Definition at line 258 of file BKE_effect.h.
Referenced by cloth_calc_spring_force(), cloth_continuum_step(), and SIM_hair_volume_solve_divergence().
| #define BKE_sim_debug_data_remove | ( | ... | ) |
Definition at line 270 of file BKE_effect.h.
| #define PE_USE_NORMAL_DATA 4 |
Definition at line 166 of file BKE_effect.h.
Referenced by get_effector_data(), and precalculate_effector().
| #define PE_VELOCITY_TO_IMPULSE 1 |
Definition at line 169 of file BKE_effect.h.
Referenced by BKE_effectors_apply().
| #define PE_WIND_AS_SPEED 1 |
Definition at line 165 of file BKE_effect.h.
Referenced by BKE_effectors_apply(), and pd_point_from_soft().
| #define SIM_DEBUG_HASH | ( | ... | ) |
Definition at line 196 of file BKE_effect.h.
| typedef struct EffectedPoint EffectedPoint |
| typedef struct EffectorCache EffectorCache |
| typedef struct EffectorData EffectorData |
| typedef struct EffectorRelation EffectorRelation |
| typedef struct GuideEffectorData GuideEffectorData |
| typedef struct SimDebugData SimDebugData |
| typedef struct SimDebugElement SimDebugElement |
| Enumerator | |
|---|---|
| SIM_DEBUG_ELEM_DOT | |
| SIM_DEBUG_ELEM_CIRCLE | |
| SIM_DEBUG_ELEM_LINE | |
| SIM_DEBUG_ELEM_VECTOR | |
| SIM_DEBUG_ELEM_STRING | |
Definition at line 209 of file BKE_effect.h.
| struct EffectorWeights * BKE_effector_add_weights | ( | struct Collection * | collection | ) |
Definition at line 58 of file effect.cc.
References EffectorWeights::global_gravity, EffectorWeights::group, i, MEM_callocN(), NUM_PFIELD_TYPES, and EffectorWeights::weight.
Referenced by BKE_fluid_modifier_create_type_data(), BKE_modifier_blend_read_data(), do_versions_after_linking_400(), dynamicPaint_createNewSurface(), init_data(), object_blend_read_data(), particle_settings_blend_read_data(), particle_settings_init(), sbNew(), and scene_blend_read_data().
| struct ListBase * BKE_effector_relations_create | ( | struct Depsgraph * | depsgraph, |
| const struct Scene * | scene, | ||
| struct ViewLayer * | view_layer, | ||
| struct Collection * | collection ) |
Create list of effector relations in the collection or entire scene. This is used by the depsgraph to build relations, as well as faster lookup of effectors during evaluation.
References depsgraph, and state.
Referenced by blender::deg::build_effector_relations().
| void BKE_effector_relations_free | ( | struct ListBase * | lb | ) |
Definition at line 239 of file effect.cc.
References BLI_freelistN(), and MEM_freeN().
Referenced by blender::deg::clear_physics_relations().
| void BKE_effectors_apply | ( | struct ListBase * | effectors, |
| struct ListBase * | colliders, | ||
| struct EffectorWeights * | weights, | ||
| struct EffectedPoint * | point, | ||
| float * | force, | ||
| float * | wind_force, | ||
| float * | impulse ) |
Generic force/speed system, now used for particles, soft-bodies & dynamic-paint.
Definition at line 1106 of file effect.cc.
References add_v3_v3(), add_v3_v3v3(), do_physical_effector(), do_texture_effector(), eff_calc_visibility(), effector_falloff(), EffectorData::falloff, EffectedPoint::flag, get_effector_data(), get_effector_tot(), LISTBASE_FOREACH, madd_v3_v3fl(), PE_VELOCITY_TO_IMPULSE, PE_WIND_AS_SPEED, PFIELD_TEXTURE, step, sub_v3_v3v3(), and EffectorData::vel.
Referenced by _scan_for_ext_spring_forces(), _softbody_calc_forces_slice_in_a_thread(), basic_force_cb(), boid_body(), cloth_calc_force(), do_path_effectors(), and dynamic_paint_prepare_effect_cb().
| struct ListBase * BKE_effectors_create | ( | struct Depsgraph * | depsgraph, |
| struct Object * | ob_src, | ||
| struct ParticleSystem * | psys_src, | ||
| struct EffectorWeights * | weights, | ||
| bool | use_rotation ) |
Create effective list of effectors from relations built beforehand.
Definition at line 306 of file effect.cc.
References add_effector_evaluation(), BKE_object_get_evaluated_mesh(), BLI_findstring(), DEG_get_effector_relations(), DEG_get_evaluated(), DEG_get_evaluated_scene(), depsgraph, ParticleSettings::flag, EffectorWeights::group, is_effector_relevant(), LISTBASE_FOREACH, name, offsetof, ParticleSystem::part, PART_SELF_EFFECT, Object::particlesystem, Object::pd, ParticleSettings::pd, ParticleSettings::pd2, PFIELD_SHAPE_POINTS, and PartDeflect::shape.
Referenced by do_step_cloth(), dynamicPaint_prepareEffectStep(), psys_update_effectors(), sb_sfesf_threads_run(), and softbody_calc_forces().
| void BKE_effectors_free | ( | struct ListBase * | lb | ) |
Definition at line 361 of file effect.cc.
References BLI_freelistN(), BLI_rng_free(), LISTBASE_FOREACH, and MEM_freeN().
Referenced by do_step_cloth(), dynamicPaint_prepareEffectStep(), psys_free(), psys_update_effectors(), sb_sfesf_threads_run(), and softbody_calc_forces().
| struct PartDeflect * BKE_partdeflect_copy | ( | const struct PartDeflect * | pd_src | ) |
Referenced by particle_settings_copy_data().
| void BKE_partdeflect_free | ( | struct PartDeflect * | pd | ) |
Definition at line 119 of file effect.cc.
References MEM_freeN().
Referenced by object_free_data(), and particle_settings_free_data().
| struct PartDeflect * BKE_partdeflect_new | ( | int | type | ) |
Definition at line 71 of file effect.cc.
References BLI_time_now_seconds(), ceil, PartDeflect::f_damp, PartDeflect::f_flow, PartDeflect::f_size, PartDeflect::f_strength, PartDeflect::f_wind_factor, PartDeflect::flag, PartDeflect::forcefield, MEM_callocN(), PartDeflect::pdef_cfrict, PartDeflect::pdef_sbdamp, PartDeflect::pdef_sbift, PartDeflect::pdef_sboft, PFIELD_CLOTH_USE_CULLING, PFIELD_DO_LOCATION, PFIELD_DO_ROTATION, PFIELD_FLUIDFLOW, PFIELD_SHAPE_PLANE, PFIELD_TEXTURE, PFIELD_VORTEX, PFIELD_WIND, PartDeflect::seed, and PartDeflect::shape.
Referenced by blender::ed::object::effector_add_exec(), blender::ed::object::forcefield_toggle_exec(), blender::ed::object::modifier_add(), and particle_settings_init().
| void BKE_sim_debug_data_add_element | ( | int | type, |
| const float | v1[3], | ||
| const float | v2[3], | ||
| const char * | str, | ||
| float | r, | ||
| float | g, | ||
| float | b, | ||
| const char * | category, | ||
| unsigned int | hash ) |
Definition at line 1299 of file effect.cc.
References _sim_debug_data, b, BKE_sim_debug_data_set_enabled(), BLI_ghashutil_strhash_p(), SimDebugElement::category_hash, SimDebugElement::color, copy_v3_v3(), debug_data_insert(), G, G_DEBUG_SIMDATA, hash, SimDebugElement::hash, MEM_callocN(), SimDebugElement::str, str, STRNCPY(), SimDebugElement::type, SimDebugElement::v1, SimDebugElement::v2, v2, and zero_v3().
| void BKE_sim_debug_data_clear | ( | void | ) |
Definition at line 1360 of file effect.cc.
References _sim_debug_data, BLI_ghash_clear(), and debug_element_free().
| void BKE_sim_debug_data_clear_category | ( | const char * | category | ) |
Definition at line 1370 of file effect.cc.
References _sim_debug_data, BLI_ghash_remove(), BLI_ghashIterator_done(), BLI_ghashIterator_getValue(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), BLI_ghashutil_strhash_p(), SimDebugElement::category_hash, and debug_element_free().
Referenced by cloth_continuum_step(), and SIM_cloth_solve().
| void BKE_sim_debug_data_free | ( | void | ) |
Definition at line 1276 of file effect.cc.
References _sim_debug_data, BLI_ghash_free(), debug_element_free(), and MEM_freeN().
Referenced by BKE_sim_debug_data_set_enabled().
| bool BKE_sim_debug_data_get_enabled | ( | void | ) |
Definition at line 1271 of file effect.cc.
References _sim_debug_data.
| unsigned int BKE_sim_debug_data_hash | ( | int | i | ) |
Definition at line 1199 of file effect.cc.
References BLI_ghashutil_uinthash(), and i.
| void BKE_sim_debug_data_remove_element | ( | unsigned int | hash | ) |
Definition at line 1350 of file effect.cc.
References _sim_debug_data, BLI_ghash_remove(), debug_element_free(), hash, and SimDebugElement::hash.
| void BKE_sim_debug_data_set_enabled | ( | bool | enable | ) |
Definition at line 1257 of file effect.cc.
References _sim_debug_data, BKE_sim_debug_data_free(), BLI_ghash_new(), debug_element_compare(), debug_element_hash(), and MEM_callocN().
Referenced by BKE_sim_debug_data_add_element().
| bool closest_point_on_surface | ( | struct SurfaceModifierData * | surmd, |
| const float | co[3], | ||
| float | surface_co[3], | ||
| float | surface_nor[3], | ||
| float | surface_vel[3] ) |
Definition at line 635 of file effect.cc.
References add_v3_v3(), BLI_bvhtree_find_nearest(), SurfaceModifierData_Runtime::bvhtree, BVHTreeNearest::co, copy_v3_v3(), blender::bke::BVHTreeFromMesh::corner_tris, blender::bke::BVHTreeFromMesh::corner_verts, Span< T >::data(), BVHTreeNearest::dist_sq, FLT_MAX, BVHTreeNearest::index, mul_v3_fl(), blender::bke::BVHTreeFromMesh::nearest_callback, BVHTreeNearest::no, SurfaceModifierData::runtime, blender::bke::BVHTreeFromMesh::tree, and SurfaceModifierData_Runtime::vert_velocities.
Referenced by boid_find_ground(), and get_effector_data().
| float effector_falloff | ( | struct EffectorCache * | eff, |
| struct EffectorData * | efd, | ||
| struct EffectedPoint * | point, | ||
| struct EffectorWeights * | weights ) |
Definition at line 586 of file effect.cc.
References EffectorData::distance, dot_v3v3(), fabsf, PartDeflect::falloff, falloff_func_dist(), falloff_func_rad(), PartDeflect::forcefield, len_v3(), madd_v3_v3v3fl(), EffectorData::nor, EffectorCache::pd, PFIELD_FALL_CONE, PFIELD_FALL_SPHERE, PFIELD_FALL_TUBE, PFIELD_Z_NEG, PFIELD_Z_POS, RAD2DEGF, safe_acosf(), EffectorData::vec_to_point2, EffectorWeights::weight, and PartDeflect::zdir.
Referenced by BKE_effectors_apply(), precalc_guides(), and rule_goal_avoid().
| bool get_effector_data | ( | struct EffectorCache * | eff, |
| struct EffectorData * | efd, | ||
| struct EffectedPoint * | point, | ||
| int | real_velocity ) |
Definition at line 671 of file effect.cc.
References add_v3_v3(), add_v3_v3v3(), BKE_object_get_evaluated_mesh(), SurfaceModifierData_Runtime::bvhtree, closest_point_on_surface(), copy_v3_v3(), DEG_get_ctime(), EffectorCache::depsgraph, ParticleSimulationData::depsgraph, EffectorData::distance, ELEM, PartDeflect::f_size, EffectorCache::flag, PartDeflect::forcefield, EffectedPoint::index, EffectorData::index, len_v3(), EffectedPoint::loc, EffectorData::loc, mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), EffectorData::nor, EffectorData::nor2, normalize_v3(), normalize_v3_v3(), EffectorCache::ob, ParticleSimulationData::ob, ParticleSystem::particles, EffectorCache::pd, PE_USE_NORMAL_DATA, PFIELD_HARMONIC, PFIELD_SHAPE_LINE, PFIELD_SHAPE_PLANE, PFIELD_SHAPE_POINTS, PFIELD_SHAPE_SURFACE, PFIELD_VORTEX, project_v3_v3v3(), EffectedPoint::psys, EffectorCache::psys, ParticleSimulationData::psys, psys_get_particle_state(), ret, SurfaceModifierData::runtime, EffectorCache::scene, ParticleSimulationData::scene, PartDeflect::shape, EffectorData::size, ParticleData::size, state, sub_v3_v3v3(), EffectorCache::surmd, EffectorData::vec_to_point, EffectorData::vec_to_point2, EffectedPoint::vel, EffectorData::vel, EffectedPoint::vel_to_frame, and zero_v3().
Referenced by BKE_effectors_apply(), and rule_goal_avoid().
| void pd_point_from_loc | ( | struct Scene * | scene, |
| float * | loc, | ||
| float * | vel, | ||
| int | index, | ||
| struct EffectedPoint * | point ) |
Definition at line 414 of file effect.cc.
References EffectedPoint::ave, EffectedPoint::flag, float, RenderData::frs_sec, EffectedPoint::index, EffectedPoint::loc, EffectedPoint::psys, Scene::r, EffectedPoint::rot, EffectedPoint::size, EffectedPoint::vel, EffectedPoint::vel_to_frame, and EffectedPoint::vel_to_sec.
Referenced by cloth_calc_force(), and dynamic_paint_prepare_effect_cb().
| void pd_point_from_particle | ( | struct ParticleSimulationData * | sim, |
| struct ParticleData * | pa, | ||
| struct ParticleKey * | state, | ||
| struct EffectedPoint * | point ) |
Definition at line 378 of file effect.cc.
References EffectedPoint::ave, EffectedPoint::charge, PartDeflect::f_strength, EffectedPoint::flag, ParticleSettings::flag, PartDeflect::forcefield, EffectedPoint::index, EffectedPoint::loc, ParticleSystem::part, PART_ROT_DYN, ParticleSystem::particles, ParticleSettings::pd, ParticleSettings::pd2, PFIELD_CHARGE, EffectedPoint::psys, ParticleSimulationData::psys, psys_get_timestep(), EffectedPoint::rot, EffectedPoint::size, ParticleData::size, state, EffectedPoint::vel, EffectedPoint::vel_to_frame, and EffectedPoint::vel_to_sec.
Referenced by basic_force_cb(), boid_body(), do_path_effectors(), precalc_guides(), and rule_goal_avoid().
| void pd_point_from_soft | ( | struct Scene * | scene, |
| float * | loc, | ||
| float * | vel, | ||
| int | index, | ||
| struct EffectedPoint * | point ) |
Definition at line 429 of file effect.cc.
References EffectedPoint::ave, EffectedPoint::flag, float, RenderData::frs_sec, EffectedPoint::index, EffectedPoint::loc, PE_WIND_AS_SPEED, EffectedPoint::psys, Scene::r, EffectedPoint::rot, EffectedPoint::size, EffectedPoint::vel, EffectedPoint::vel_to_frame, and EffectedPoint::vel_to_sec.
Referenced by _scan_for_ext_spring_forces(), and _softbody_calc_forces_slice_in_a_thread().
|
extern |
Definition at line 1197 of file effect.cc.
Referenced by BKE_sim_debug_data_add_element(), BKE_sim_debug_data_clear(), BKE_sim_debug_data_clear_category(), BKE_sim_debug_data_free(), BKE_sim_debug_data_get_enabled(), BKE_sim_debug_data_remove_element(), and BKE_sim_debug_data_set_enabled().