|
Blender V4.3
|
#include "BLI_utildefines.h"Go to the source code of this file.
Classes | |
| struct | EffectedPoint |
| struct | GuideEffectorData |
| struct | EffectorData |
| struct | EffectorCache |
| struct | EffectorRelation |
| struct | SimDebugElement |
| struct | SimDebugData |
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 } |
Functions | |
| struct EffectorWeights * | BKE_effector_add_weights (struct Collection *collection) |
| struct PartDeflect * | BKE_partdeflect_new (int type) |
| struct PartDeflect * | BKE_partdeflect_copy (const struct PartDeflect *pd_src) |
| void | BKE_partdeflect_free (struct PartDeflect *pd) |
| struct ListBase * | BKE_effector_relations_create (struct Depsgraph *depsgraph, const struct Scene *scene, struct ViewLayer *view_layer, struct Collection *collection) |
| void | BKE_effector_relations_free (struct ListBase *lb) |
| struct ListBase * | BKE_effectors_create (struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation) |
| void | BKE_effectors_apply (struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse) |
| void | BKE_effectors_free (struct ListBase *lb) |
| void | pd_point_from_particle (struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point) |
| void | pd_point_from_loc (struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point) |
| void | pd_point_from_soft (struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point) |
| float | effector_falloff (struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights) |
| bool | closest_point_on_surface (struct SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]) |
| bool | get_effector_data (struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity) |
| unsigned int | BKE_sim_debug_data_hash (int i) |
| unsigned int | BKE_sim_debug_data_hash_combine (unsigned int kx, unsigned int ky) |
| void | BKE_sim_debug_data_set_enabled (bool enable) |
| bool | BKE_sim_debug_data_get_enabled (void) |
| void | BKE_sim_debug_data_free (void) |
| 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) |
| void | BKE_sim_debug_data_remove_element (unsigned int hash) |
| void | BKE_sim_debug_data_clear (void) |
| void | BKE_sim_debug_data_clear_category (const char *category) |
Variables | |
| SimDebugData * | _sim_debug_data |
| #define _VA_SIM_DEBUG_HASH1 | ( | a | ) | (BKE_sim_debug_data_hash(a)) |
Definition at line 184 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH2 | ( | a, | |
| b ) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b))) |
Definition at line 185 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH3 | ( | a, | |
| b, | |||
| c ) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH2(b, c))) |
Definition at line 187 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH4 | ( | a, | |
| b, | |||
| c, | |||
| d ) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH3(b, c, d))) |
Definition at line 189 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH5 | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e ) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH4(b, c, d, e))) |
Definition at line 191 of file BKE_effect.h.
| #define _VA_SIM_DEBUG_HASH6 | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f ) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH5(b, c, d, e, f))) |
Definition at line 193 of file BKE_effect.h.
Definition at line 195 of file BKE_effect.h.
Definition at line 198 of file BKE_effect.h.
Definition at line 251 of file BKE_effect.h.
Referenced by cloth_continuum_step(), and SIM_hair_volume_solve_divergence().
Definition at line 244 of file BKE_effect.h.
Referenced by cloth_calc_spring_force(), cloth_continuum_step(), and SIM_hair_volume_solve_divergence().
Definition at line 258 of file BKE_effect.h.
Referenced by cloth_calc_spring_force().
Definition at line 270 of file BKE_effect.h.
Definition at line 264 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 | ( | ... | ) | BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__)) |
Definition at line 276 of file BKE_effect.h.
| #define PE_USE_NORMAL_DATA 4 |
Definition at line 172 of file BKE_effect.h.
Referenced by get_effector_data(), and precalculate_effector().
| #define PE_VELOCITY_TO_IMPULSE 1 |
Definition at line 175 of file BKE_effect.h.
Referenced by BKE_effectors_apply().
| #define PE_WIND_AS_SPEED 1 |
Definition at line 171 of file BKE_effect.h.
Referenced by BKE_effectors_apply(), and pd_point_from_soft().
| #define SIM_DEBUG_HASH | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__) |
Definition at line 202 of file BKE_effect.h.
| typedef struct EffectedPoint EffectedPoint |
| typedef struct EffectorCache EffectorCache |
| typedef struct EffectorData EffectorData |
| typedef struct EffectorRelation EffectorRelation |
| typedef enum eSimDebugElement_Type eSimDebugElement_Type |
| 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 215 of file BKE_effect.h.
| struct EffectorWeights * BKE_effector_add_weights | ( | struct Collection * | collection | ) |
Definition at line 57 of file effect.cc.
References EffectorWeights::global_gravity, EffectorWeights::group, 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.
Referenced by blender::deg::build_effector_relations().
| void BKE_effector_relations_free | ( | struct ListBase * | lb | ) |
Definition at line 242 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 1110 of file effect.cc.
References add_v3_v3(), add_v3_v3v3(), do_physical_effector(), do_texture_effector(), eff_calc_visibility(), effector_falloff(), EffectorData::falloff, get_effector_data(), get_effector_tot(), LISTBASE_FOREACH, madd_v3_v3fl(), PE_VELOCITY_TO_IMPULSE, PE_WIND_AS_SPEED, PFIELD_TEXTURE, 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 309 of file effect.cc.
References add_effector_evaluation(), BKE_object_get_evaluated_mesh(), BLI_findstring(), DEG_get_effector_relations(), DEG_get_evaluated_id(), DEG_get_evaluated_scene(), depsgraph, EffectorWeights::group, is_effector_relevant(), LISTBASE_FOREACH, offsetof, ParticleSystem::part, PART_SELF_EFFECT, Object::particlesystem, Object::pd, 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 364 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 1304 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 1366 of file effect.cc.
References _sim_debug_data, BLI_ghash_clear(), debug_element_free(), and SimDebugData::gh.
| void BKE_sim_debug_data_clear_category | ( | const char * | category | ) |
Definition at line 1376 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, debug_element_free(), SimDebugData::gh, and int.
Referenced by cloth_continuum_step(), and SIM_cloth_solve().
| void BKE_sim_debug_data_free | ( | void | ) |
Definition at line 1281 of file effect.cc.
References _sim_debug_data, BLI_ghash_free(), debug_element_free(), SimDebugData::gh, and MEM_freeN().
Referenced by BKE_sim_debug_data_set_enabled().
| bool BKE_sim_debug_data_get_enabled | ( | void | ) |
Definition at line 1276 of file effect.cc.
References _sim_debug_data.
Definition at line 1203 of file effect.cc.
References BLI_ghashutil_uinthash().
| void BKE_sim_debug_data_remove_element | ( | unsigned int | hash | ) |
Definition at line 1356 of file effect.cc.
References _sim_debug_data, BLI_ghash_remove(), debug_element_free(), SimDebugData::gh, hash, and SimDebugElement::hash.
| void BKE_sim_debug_data_set_enabled | ( | bool | enable | ) |
Definition at line 1261 of file effect.cc.
References _sim_debug_data, BKE_sim_debug_data_free(), BLI_ghash_new(), debug_element_compare(), debug_element_hash(), SimDebugData::gh, 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 638 of file effect.cc.
References add_v3_v3(), BLI_bvhtree_find_nearest(), SurfaceModifierData_Runtime::bvhtree, copy_v3_v3(), BVHTreeFromMesh::corner_tris, BVHTreeFromMesh::corner_verts, blender::Span< T >::data(), FLT_MAX, BVHTreeNearest::index, mul_v3_fl(), BVHTreeFromMesh::nearest_callback, SurfaceModifierData::runtime, 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 589 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 674 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, EffectorData::index, len_v3(), 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(), 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, EffectorData::vel, 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 417 of file effect.cc.
References float.
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 381 of file effect.cc.
References ParticleSettings::flag, ParticleSystem::part, PART_ROT_DYN, ParticleSystem::particles, PFIELD_CHARGE, ParticleSimulationData::psys, psys_get_timestep(), ParticleData::size, and state.
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 432 of file effect.cc.
References float, and PE_WIND_AS_SPEED.
Referenced by _scan_for_ext_spring_forces(), and _softbody_calc_forces_slice_in_a_thread().
|
extern |
Definition at line 1201 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().