Blender
V3.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 } |
Variables | |
SimDebugData * | _sim_debug_data |
#define _VA_SIM_DEBUG_HASH1 | ( | a | ) | (BKE_sim_debug_data_hash(a)) |
Definition at line 178 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 179 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 181 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 183 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 185 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 187 of file BKE_effect.h.
Definition at line 189 of file BKE_effect.h.
Definition at line 192 of file BKE_effect.h.
Definition at line 245 of file BKE_effect.h.
Definition at line 238 of file BKE_effect.h.
Definition at line 252 of file BKE_effect.h.
Definition at line 264 of file BKE_effect.h.
Definition at line 258 of file BKE_effect.h.
#define BKE_sim_debug_data_remove | ( | ... | ) | BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__)) |
Definition at line 270 of file BKE_effect.h.
#define PE_USE_NORMAL_DATA 4 |
Definition at line 166 of file BKE_effect.h.
#define PE_VELOCITY_TO_IMPULSE 1 |
Definition at line 169 of file BKE_effect.h.
#define PE_WIND_AS_SPEED 1 |
Definition at line 165 of file BKE_effect.h.
#define SIM_DEBUG_HASH | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__) |
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 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 209 of file BKE_effect.h.
struct EffectorWeights* BKE_effector_add_weights | ( | struct Collection * | collection | ) |
Definition at line 58 of file effect.c.
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(), dynamicPaint_createNewSurface(), initData(), object_blend_read_data(), particle_settings_blend_read_data(), particle_settings_blend_read_lib(), particle_settings_init(), sbNew(), and scene_blend_read_data().
struct ListBase* BKE_effector_relations_create | ( | struct Depsgraph * | depsgraph, |
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.
Definition at line 209 of file effect.c.
References add_effector_relation(), BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BKE_collection_or_layer_objects(), DAG_EVAL_RENDER, DEG_get_mode(), depsgraph, Base::flag, PartDeflect::forcefield, LISTBASE_FOREACH, MEM_callocN, Base::next, NULL, Base::object, Object::particlesystem, Object::pd, ParticleSettings::pd, ParticleSettings::pd2, and psys_check_enabled().
Referenced by blender::deg::build_effector_relations().
Definition at line 247 of file effect.c.
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 1114 of file effect.c.
References add_v3_v3(), add_v3_v3v3(), do_physical_effector(), do_texture_effector(), eff_calc_visibility(), effector_falloff(), PartDeflect::f_wind_factor, EffectorData::falloff, ListBase::first, EffectorCache::flag, PartDeflect::forcefield, get_effector_data(), get_effector_tot(), madd_v3_v3fl(), EffectorCache::next, EffectorCache::pd, PE_VELOCITY_TO_IMPULSE, PE_WIND_AS_SPEED, PFIELD_TEXTURE, point, 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 314 of file effect.c.
References add_effector_evaluation(), BKE_object_get_evaluated_mesh(), BLI_findstring(), DEG_get_effector_relations(), DEG_get_evaluated_id(), DEG_get_evaluated_scene(), depsgraph, ParticleSettings::flag, EffectorWeights::group, if(), is_effector_relevant(), LISTBASE_FOREACH, NULL, ParticleSystem::part, PART_SELF_EFFECT, Object::particlesystem, Object::pd, ParticleSettings::pd, ParticleSettings::pd2, PFIELD_SHAPE_POINTS, scene, and PartDeflect::shape.
Referenced by do_step_cloth(), dynamicPaint_prepareEffectStep(), psys_update_effectors(), sb_sfesf_threads_run(), and softbody_calc_forces().
Definition at line 369 of file effect.c.
References BLI_freelistN(), 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 | ) |
Definition at line 110 of file effect.c.
References BLI_rng_copy(), MEM_dupallocN, NULL, and PartDeflect::rng.
Referenced by particle_settings_copy_data().
void BKE_partdeflect_free | ( | struct PartDeflect * | pd | ) |
Definition at line 122 of file effect.c.
References BLI_rng_free(), MEM_freeN, and PartDeflect::rng.
Referenced by object_free_data(), and particle_settings_free_data().
struct PartDeflect* BKE_partdeflect_new | ( | int | type | ) |
Definition at line 71 of file effect.c.
References 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, PIL_check_seconds_timer(), PartDeflect::seed, PartDeflect::shape, and type.
Referenced by ED_object_modifier_add(), effector_add_exec(), forcefield_toggle_exec(), 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 1307 of file effect.c.
References _sim_debug_data, usdtokens::b(), BKE_sim_debug_data_set_enabled(), BLI_ghashutil_strhash_p(), BLI_strncpy(), SimDebugElement::category_hash, SimDebugElement::color, copy_v3_v3(), debug_data_insert(), usdtokens::g(), G, G_DEBUG_SIMDATA, SimDebugElement::hash, hash, MEM_callocN, r, str, SimDebugElement::str, SimDebugElement::type, type, SimDebugElement::v1, v1, SimDebugElement::v2, v2, and zero_v3().
Definition at line 1368 of file effect.c.
References _sim_debug_data, BLI_ghash_clear(), debug_element_free(), SimDebugData::gh, and NULL.
void BKE_sim_debug_data_clear_category | ( | const char * | category | ) |
Definition at line 1378 of file effect.c.
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 NULL.
Referenced by cloth_continuum_step(), and SIM_cloth_solve().
Definition at line 1285 of file effect.c.
References _sim_debug_data, BLI_ghash_free(), debug_element_free(), SimDebugData::gh, MEM_freeN, and NULL.
Referenced by BKE_sim_debug_data_set_enabled().
Definition at line 1280 of file effect.c.
References _sim_debug_data, and NULL.
unsigned int BKE_sim_debug_data_hash | ( | int | i | ) |
Definition at line 1208 of file effect.c.
References BLI_ghashutil_uinthash().
unsigned int BKE_sim_debug_data_hash_combine | ( | unsigned int | kx, |
unsigned int | ky | ||
) |
Definition at line 1213 of file effect.c.
References Freestyle::a, usdtokens::b(), Freestyle::c, and rot.
void BKE_sim_debug_data_remove_element | ( | unsigned int | hash | ) |
Definition at line 1358 of file effect.c.
References _sim_debug_data, BLI_ghash_remove(), debug_element_free(), SimDebugData::gh, SimDebugElement::hash, hash, and NULL.
Definition at line 1266 of file effect.c.
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 640 of file effect.c.
References add_v3_v3(), BLI_bvhtree_find_nearest(), SurfaceModifierData::bvhtree, BVHTreeNearest::co, MVert::co, copy_v3_v3(), BVHTreeNearest::dist_sq, BVHTreeNearest::index, BVHTreeFromMesh::loop, BVHTreeFromMesh::looptri, mul_v3_fl(), BVHTreeFromMesh::nearest_callback, BVHTreeNearest::no, BVHTreeFromMesh::tree, MLoopTri::tri, MLoop::v, and SurfaceModifierData::v.
Referenced by boid_find_ground(), and get_effector_data().
float effector_falloff | ( | struct EffectorCache * | eff, |
struct EffectorData * | efd, | ||
struct EffectedPoint * | point, | ||
struct EffectorWeights * | weights | ||
) |
Referenced by 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 676 of file effect.c.
References add_v3_v3(), add_v3_v3v3(), BKE_mesh_vertex_normals_ensure(), BKE_object_get_evaluated_mesh(), SurfaceModifierData::bvhtree, closest_point_on_surface(), MVert::co, copy_v3_v3(), DEG_get_ctime(), EffectorCache::depsgraph, ParticleSimulationData::depsgraph, EffectorData::distance, ELEM, PartDeflect::f_size, EffectorCache::flag, float(), PartDeflect::forcefield, Particle::index, EffectorData::index, len_v3(), EffectorData::loc, mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), Mesh::mvert, EffectorData::nor, EffectorData::nor2, normalize_v3(), normalize_v3_v3(), NULL, EffectorCache::ob, ParticleSimulationData::ob, Object::obmat, ParticleSystem::particles, EffectorCache::pd, PE_USE_NORMAL_DATA, PFIELD_HARMONIC, PFIELD_SHAPE_LINE, PFIELD_SHAPE_PLANE, PFIELD_SHAPE_POINTS, PFIELD_SHAPE_SURFACE, PFIELD_VORTEX, point, project_v3_v3v3(), EffectorCache::psys, ParticleSimulationData::psys, psys_get_particle_state(), ret, 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 419 of file effect.c.
References float(), RenderData::frs_sec, Particle::index, NULL, point, Scene::r, scene, and Particle::size.
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 383 of file effect.c.
References PartDeflect::f_strength, ParticleSettings::flag, PartDeflect::forcefield, Particle::index, NULL, ParticleSystem::part, PART_ROT_DYN, ParticleSystem::particles, ParticleSettings::pd, ParticleSettings::pd2, PFIELD_CHARGE, point, ParticleSimulationData::psys, psys_get_timestep(), Particle::size, 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 434 of file effect.c.
References float(), RenderData::frs_sec, Particle::index, NULL, PE_WIND_AS_SPEED, point, Scene::r, scene, and Particle::size.
Referenced by _scan_for_ext_spring_forces(), and _softbody_calc_forces_slice_in_a_thread().
|
extern |
Definition at line 1206 of file effect.c.
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().