|
Blender V4.5
|
#include <algorithm>#include <cmath>#include <cstddef>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_boid_types.h"#include "DNA_cloth_types.h"#include "DNA_listBase.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_modifier_types.h"#include "DNA_object_force_types.h"#include "DNA_object_types.h"#include "DNA_particle_types.h"#include "DNA_scene_types.h"#include "DNA_texture_types.h"#include "BLI_kdopbvh.hh"#include "BLI_kdtree.h"#include "BLI_linklist.h"#include "BLI_listbase.h"#include "BLI_math_base_safe.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_rand.h"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "BKE_animsys.h"#include "BKE_boids.h"#include "BKE_collision.h"#include "BKE_colortools.hh"#include "BKE_customdata.hh"#include "BKE_effect.h"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_mesh_legacy_convert.hh"#include "BKE_particle.h"#include "BKE_cloth.hh"#include "BKE_material.hh"#include "BKE_mesh.hh"#include "BKE_modifier.hh"#include "BKE_object.hh"#include "BKE_pointcache.h"#include "BKE_scene.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"Go to the source code of this file.
Classes | |
| struct | SPHNeighbor |
| struct | SPHRangeData |
| struct | EfData |
| struct | DynamicStepSolverTaskData |
| struct | ParticleSystemIDLoopForModifier |
Macros | |
| #define | ZERO_F43 |
| #define | COLLISION_MIN_RADIUS 0.001f |
| #define | COLLISION_MIN_DISTANCE 0.0001f |
| #define | COLLISION_ZERO 0.00001f |
| #define | COLLISION_INIT_STEP 0.00008f |
Typedefs | |
| using | NRDistanceFunc |
Variables | |
| static ThreadRWMutex | psys_bvhtree_rwlock = BLI_RWLOCK_INITIALIZER |
| static const float | MIN_TIMESTEP = 1.0f / 101.0f |
| static const float | TIMESTEP_EXPANSION_FACTOR = 0.1f |
| static const float | TIMESTEP_EXPANSION_TOLERANCE = 1.5f |
SPH fluid physics | |
In theory, there could be unlimited implementation of SPH simulators This code uses in some parts adapted algorithms from the pseudo code as outlined in the Research paper: Titled: Particle-based Viscoelastic Fluid Simulation. Authors: Simon Clavet, Philippe Beaudoin and Pierre Poulin Website: http://www.iro.umontreal.ca/labs/infographie/papers/Clavet-2005-PVFS/ Presented at SIGGRAPH, (2005) | |
| #define | PSYS_FLUID_SPRINGS_INITIAL_SIZE 256 |
| #define | SPH_NEIGHBORS 512 |
| static ParticleSpring * | sph_spring_add (ParticleSystem *psys, ParticleSpring *spring) |
| static void | sph_spring_delete (ParticleSystem *psys, int j) |
| static void | sph_springs_modify (ParticleSystem *psys, float dtime) |
| static blender::Map< blender::OrderedEdge, int > | sph_springhash_build (ParticleSystem *psys) |
| static void | sph_evaluate_func (BVHTree *tree, ParticleSystem **psys, const float co[3], SPHRangeData *pfr, float interaction_radius, BVHTree_RangeQuery callback) |
| static void | sph_density_accum_cb (void *userdata, int index, const float co[3], float squared_dist) |
| static void | sph_particle_courant (SPHData *sphdata, SPHRangeData *pfr) |
| static void | sph_force_cb (void *sphdata_v, ParticleKey *state, float *force, float *) |
| static void | sphclassical_density_accum_cb (void *userdata, int index, const float co[3], float) |
| static void | sphclassical_neighbor_accum_cb (void *userdata, int index, const float co[3], float) |
| static void | sphclassical_force_cb (void *sphdata_v, ParticleKey *state, float *force, float *) |
| static void | sphclassical_calc_dens (ParticleData *pa, float, SPHData *sphdata) |
| void | psys_sph_init (ParticleSimulationData *sim, SPHData *sphdata) |
| static void | psys_sph_flush_springs (SPHData *sphdata) |
| void | psys_sph_finalize (SPHData *sphdata) |
| void | psys_sph_density (BVHTree *tree, SPHData *sphdata, float co[3], float vars[2]) |
| static void | sph_integrate (ParticleSimulationData *sim, ParticleData *pa, float dfra, SPHData *sphdata) |
| #define COLLISION_INIT_STEP 0.00008f |
Definition at line 2384 of file particle_system.cc.
Referenced by collision_newton_rhapson().
| #define COLLISION_MIN_DISTANCE 0.0001f |
Definition at line 2382 of file particle_system.cc.
Referenced by collision_response().
| #define COLLISION_MIN_RADIUS 0.001f |
Definition at line 2381 of file particle_system.cc.
Referenced by collision_check().
| #define COLLISION_ZERO 0.00001f |
Definition at line 2383 of file particle_system.cc.
Referenced by collision_newton_rhapson().
| #define PSYS_FLUID_SPRINGS_INITIAL_SIZE 256 |
Definition at line 1558 of file particle_system.cc.
Referenced by sph_spring_add(), and sph_spring_delete().
| #define SPH_NEIGHBORS 512 |
Definition at line 1661 of file particle_system.cc.
Referenced by sph_density_accum_cb(), and sphclassical_neighbor_accum_cb().
| #define ZERO_F43 |
Referenced by integrate_particle().
| using NRDistanceFunc |
Definition at line 2385 of file particle_system.cc.
|
static |
Definition at line 2223 of file particle_system.cc.
References EffectedPoint::ave, ParticleKey::ave, BKE_effectors_apply(), BLI_rng_get_float(), ParticleSettings::brownfac, ParticleSimulationData::colliders, copy_v3_v3(), ParticleSettings::dragfac, EFF_WEIGHT_DO_HAIR, ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleTexture::field, EffectorWeights::flag, ParticleSettings::flag, len_v3(), madd_v3_v3fl(), mul_v3_fl(), EfData::pa, ParticleSystem::part, PART_HAIR, PART_ROT_DYN, pd_point_from_particle(), ParticleSimulationData::psys, EfData::ptex, ParticleSimulationData::rng, EfData::sim, ParticleData::size, ParticleData::state, state, and ParticleSettings::type.
Referenced by basic_integrate().
|
static |
Definition at line 2264 of file particle_system.cc.
References ParticleKey::ave, basic_force_cb(), CLAMP, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, ParticleSettings::dampfac, ParticleSimulationData::depsgraph, do_guides(), EFF_WEIGHT_DO_HAIR, ParticleSettings::effector_weights, ParticleSystem::effectors, EffectorWeights::flag, EffectorWeights::global_gravity, ParticleTexture::gravity, PhysicsSettings::gravity, integrate_particle(), ParticleData::lifetime, madd_v3_v3fl(), mul_v3_fl(), EfData::pa, PAMAP_PHYSICS, ParticleSystem::part, PART_HAIR, ParticleSystem::particles, Scene::physics_settings, ParticleData::prev_state, ParticleSimulationData::psys, psys_get_texture(), psys_get_timestep(), psys_uses_gravity(), EfData::ptex, ParticleSimulationData::scene, EfData::sim, ParticleData::state, sub_v3_v3v3(), ParticleData::time, ParticleKey::time, ParticleSettings::type, ParticleKey::vel, and zero_v3().
Referenced by dynamics_step(), dynamics_step_sph_classical_basic_integrate_task_cb_ex(), and dynamics_step_sph_ddr_task_cb_ex().
|
static |
Definition at line 2320 of file particle_system.cc.
References angle(), ParticleKey::ave, ParticleSettings::avefac, ParticleSettings::avemode, axis_angle_to_quat(), cross_v3_v3v3(), dot_v3v3(), ELEM, ParticleSettings::flag, get_angular_velocity_vector(), len_v3(), mul_qt_qtqt(), mul_v3_fl(), normalize_qt(), normalize_v3(), PART_AVE_HORIZONTAL, PART_AVE_VELOCITY, PART_AVE_VERTICAL, PART_ROT_DYN, PART_ROTATIONS, ParticleData::prev_state, ParticleKey::rot, safe_acosf(), ParticleData::state, unit_qt(), ParticleKey::vel, and zero_v3().
Referenced by dynamics_step(), dynamics_step_sph_classical_integrate_task_cb_ex(), and dynamics_step_sph_ddr_task_cb_ex().
| void BKE_particle_settings_eval_reset | ( | Depsgraph * | depsgraph, |
| ParticleSettings * | particle_settings ) |
Definition at line 5067 of file particle_system.cc.
References DEG_debug_print_eval(), depsgraph, ParticleSettings::id, ID_RECALC_PSYS_RESET, ID::name, and ID::recalc.
| void BKE_particle_system_eval_init | ( | Depsgraph * | depsgraph, |
| Object * | object ) |
Definition at line 5073 of file particle_system.cc.
References DEG_debug_print_eval(), depsgraph, ListBase::first, Object::id, ID_RECALC_PSYS_ALL, ID::name, ParticleSystem::next, and Object::particlesystem.
Referenced by blender::deg::DepsgraphNodeBuilder::build_particle_systems().
| void BKE_particlesettings_fluid_default_settings | ( | ParticleSettings * | part | ) |
Definition at line 4701 of file particle_system.cc.
References SPHFluidSettings::buoyancy, SPHFluidSettings::flag, ParticleSettings::fluid, SPHFluidSettings::plasticity_constant, SPHFluidSettings::radius, SPHFluidSettings::rest_density, SPHFluidSettings::rest_length, SPH_FAC_DENSITY, SPH_FAC_RADIUS, SPH_FAC_REPULSION, SPH_FAC_REST_LENGTH, SPH_FAC_VISCOSITY, SPHFluidSettings::spring_k, SPHFluidSettings::stiffness_k, SPHFluidSettings::stiffness_knear, SPHFluidSettings::viscosity_beta, SPHFluidSettings::viscosity_omega, and SPHFluidSettings::yield_ratio.
| void BKE_particlesystem_id_loop | ( | ParticleSystem * | psys, |
| ParticleSystemIDFunc | func, | ||
| void * | userdata ) |
Definition at line 5008 of file particle_system.cc.
References BKE_lib_query_foreachid_process_flags_get(), BKE_modifier_get_info(), ParticleData::boid, ParticleSystem::clmd, data, ModifierTypeInfo::foreach_ID_link, BoidParticle::ground, IDWALK_CB_NEVER_NULL, IDWALK_CB_NOP, IDWALK_CB_USER, IDWALK_NO_ORIG_POINTERS_ACCESS, LISTBASE_FOREACH, ClothModifierData::modifier, ParticleSystem::parent, ParticleSystem::part, PART_PHYS_BOIDS, ParticleSystem::particles, particlesystem_modifiersForeachIDLink(), ParticleSettings::phystype, ParticleSystem::target_ob, ParticleSystem::targets, and ModifierData::type.
Referenced by object_foreach_id().
| void BKE_particlesystem_reset_all | ( | struct Object * | object | ) |
Reset all particle systems in the given object.
Definition at line 5051 of file particle_system.cc.
References eModifierType_ParticleSystem, ListBase::first, ID_RECALC_PSYS_RESET, Object::modifiers, ModifierData::next, ParticleSystemModifierData::psys, and ParticleSystem::recalc.
Referenced by blender::ed::sculpt_paint::dyntopo::disable(), and blender::ed::object::editmode_exit_ex().
| void BKE_psys_collision_neartest_cb | ( | void * | userdata, |
| int | index, | ||
| const BVHTreeRay * | ray, | ||
| BVHTreeRayHit * | hit ) |
Definition at line 2778 of file particle_system.cc.
References col, collision_point_velocity(), collision_sphere_to_edges(), collision_sphere_to_tri(), collision_sphere_to_verts(), BVHTreeRayHit::dist, BVHTreeRayHit::index, ParticleCollisionElement::index, ParticleCollisionElement::inside, BVHTreeRay::radius, ParticleCollisionElement::tot, ParticleCollisionElement::v, v, ParticleCollisionElement::x, and x.
|
static |
Definition at line 1305 of file particle_system.cc.
References BLI_bvhtree_balance().
Referenced by psys_update_particle_bvhtree().
|
static |
Definition at line 4102 of file particle_system.cc.
References ParticleData::alive, ParticleData::dietime, ParticleData::flag, ParticleSettings::flag, PointCache::flag, LOOP_PARTICLES, PAMAP_SIZE, PARS_ALIVE, PARS_DEAD, PARS_NO_DISP, PARS_UNBORN, ParticleSystem::part, PART_UNBORN, PARTICLE_P, ParticleSystem::pointcache, ParticleSimulationData::psys, psys_frand(), psys_get_current_display_percentage(), psys_get_texture(), psys_sim_data_free(), psys_sim_data_init(), psys_update_effectors(), PTCACHE_EXTERNAL, ParticleSettings::randsize, reset_particle(), ParticleData::size, ParticleSettings::size, ParticleTexture::size, and ParticleData::time.
Referenced by system_step().
|
static |
Definition at line 3106 of file particle_system.cc.
References ParticleData::boid, BOID_ALLOW_LAND, ParticleSettings::boids, ParticleSystem::cfra, ParticleKey::co, col, ParticleSimulationData::colliders, collision_detect(), collision_fail(), COLLISION_MIN_RADIUS, collision_response(), copy_v3_v3(), ParticleSettings::flag, BoidParticle::ground, mul_v3_fl(), BoidSettings::options, ParticleSystem::part, PART_DIE_ON_COL, PART_PHYS_BOIDS, PART_ROT_DYN, PART_SIZE_DEFL, PARTICLE_COLLISION_MAX_COLLISIONS, ParticleSystem::particles, ParticleSettings::phystype, ParticleData::prev_state, ParticleSimulationData::psys, psys_get_timestep(), ParticleData::size, ParticleData::state, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by dynamics_step(), dynamics_step_sph_classical_integrate_task_cb_ex(), and dynamics_step_sph_ddr_task_cb_ex().
|
static |
Definition at line 2818 of file particle_system.cc.
References BKE_psys_collision_neartest_cb(), BLI_bvhtree_ray_cast_ex(), BLI_listbase_is_empty(), BVH_RAYCAST_DEFAULT, BVH_RAYCAST_WATERTIGHT, col, BVHTreeRayHit::dist, i, BVHTreeRayHit::index, LISTBASE_FOREACH, normalize_v3(), sub_v3_v3v3(), and ParticleData::time.
Referenced by collision_check().
|
static |
Definition at line 3086 of file particle_system.cc.
References ParticleKey::co, col, collision_point_on_surface(), copy_v3_v3(), mul_v3_fl(), ParticleData::state, and ParticleKey::vel.
Referenced by collision_check().
|
static |
| t | is the current time for newton rhapson. |
| fac | is the starting factor for current collision iteration. |
| col | The particle collision, col->fac's are factors for the particle sub-frame step start and end during collision modifier step. |
Definition at line 2449 of file particle_system.cc.
References col, madd_v3_v3v3fl(), mul(), ParticleCollisionElement::tot, ParticleCollisionElement::v, ParticleCollisionElement::x, ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by collision_newton_rhapson(), collision_point_distance_with_normal(), and collision_point_on_surface().
|
static |
Definition at line 2557 of file particle_system.cc.
References CLAMP, col, COLLISION_INIT_STEP, collision_interpolate_element(), COLLISION_ZERO, copy_v3_v3(), ParticleCollisionElement::inside, interp_v3_v3v3(), ParticleCollisionElement::inv_nor, ParticleCollisionElement::nor, nr_signed_distance_to_plane(), and ParticleCollisionElement::p.
Referenced by collision_sphere_to_edges(), collision_sphere_to_tri(), and collision_sphere_to_verts().
|
static |
Definition at line 2484 of file particle_system.cc.
References col, collision_interpolate_element(), dot_v3v3(), e, madd_v3_v3v3fl(), nor, normalize_v3(), nr_signed_distance_to_plane(), sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by collision_response().
|
static |
Definition at line 2510 of file particle_system.cc.
References col, collision_interpolate_element(), cross_v3_v3v3(), dot_v3v3(), e, ParticleCollisionElement::inv_nor, madd_v3_v3fl(), madd_v3_v3v3fl(), negate_v3(), nor, normalize_v3(), sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::uv, ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by collision_fail().
|
static |
Definition at line 2468 of file particle_system.cc.
References copy_v3_v3(), madd_v3_v3fl(), sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::uv, ParticleCollisionElement::v, v, and ParticleCollisionElement::vel.
Referenced by BKE_psys_collision_neartest_cb().
|
static |
Definition at line 2882 of file particle_system.cc.
References add_v3_v3(), add_v3_v3v3(), ParticleData::alive, ParticleKey::ave, BLI_rng_get_float(), ParticleData::boid, CLAMP, ParticleKey::co, col, COLLISION_MIN_DISTANCE, collision_point_distance_with_normal(), copy_v3_v3(), cross_v3_v3v3(), BoidParticle::data, ParticleData::dietime, BVHTreeRayHit::dist, distance(), dot(), dot_v3v3(), eBoidMode_OnLand, PartDeflect::flag, interp_qt_qtqt(), interp_v3_v3v3(), madd_v3_v3fl(), madd_v3_v3v3fl(), BoidData::mode, mul_v3_fl(), mul_v3_v3fl(), negate_v3_v3(), nor, ParticleCollisionElement::nor, PARS_DYING, PartDeflect::pdef_damp, PartDeflect::pdef_frict, PartDeflect::pdef_perm, PartDeflect::pdef_rdamp, PartDeflect::pdef_rfrict, PartDeflect::pdef_stickness, PDEFLE_KILL_PART, ParticleData::prev_state, ParticleSimulationData::rng, ParticleKey::rot, ParticleData::size, ParticleData::state, sub_v3_v3v3(), ParticleCollisionElement::vel, ParticleKey::vel, and x.
Referenced by collision_check().
|
static |
Definition at line 2698 of file particle_system.cc.
References col, collision_newton_rhapson(), dot_v3v3(), e, i, ParticleCollisionElement::inside, madd_v3_v3v3fl(), normalize_v3(), nr_distance_to_edge(), ParticleCollisionElement::p, result, sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::v, ParticleCollisionElement::x, ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by BKE_psys_collision_neartest_cb().
|
static |
Definition at line 2652 of file particle_system.cc.
References col, collision_newton_rhapson(), dot_v3v3(), ParticleCollisionElement::inside, ParticleCollisionElement::inv_nor, nr_signed_distance_to_plane(), ParticleCollisionElement::p, result, sub_v3_v3v3(), v, ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by BKE_psys_collision_neartest_cb().
|
static |
Definition at line 2745 of file particle_system.cc.
References col, collision_newton_rhapson(), i, ParticleCollisionElement::inside, normalize_v3(), nr_distance_to_vert(), ParticleCollisionElement::p, result, sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::v, ParticleCollisionElement::x, and ParticleCollisionElement::x0.
Referenced by BKE_psys_collision_neartest_cb().
|
static |
Definition at line 3440 of file particle_system.cc.
References BKE_id_copy_ex(), BKE_id_free(), BKE_modifier_new(), ParticleSystem::clmd, CLOTH_COLLSETTINGS_FLAG_SELF, CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS, clothModifier_do(), ClothModifierData::coll_parms, ParticleSimulationData::depsgraph, Mesh::edges_num, ClothSimSettings::effector_weights, ParticleSettings::effector_weights, eModifierType_Cloth, ParticleData::flag, ClothCollSettings::flags, ClothSimSettings::flags, ClothSimSettings::goalspring, hair_create_input_mesh(), ParticleSystem::hair_in_mesh, ParticleSystem::hair_out_mesh, ClothModifierData::hairdata, Mesh::id, LIB_ID_COPY_LOCALIZE, LOOP_PARTICLES, MEM_freeN(), ParticleSimulationData::ob, PARS_UNEXIST, ParticleSystem::part, PARTICLE_P, ClothModifierData::point_cache, ParticleSystem::pointcache, ParticleSimulationData::psys, ParticleSimulationData::scene, ClothModifierData::sim_parms, ParticleData::totkey, and Mesh::verts_num.
Referenced by hair_step().
|
static |
Definition at line 3821 of file particle_system.cc.
References ParticleData::alive, basic_integrate(), basic_rotate(), BKE_collider_cache_create(), BKE_collider_cache_free(), BLI_findlink(), BLI_parallel_range_settings_defaults(), BLI_rng_free(), BLI_rng_new_srandom(), BLI_spin_end(), BLI_spin_init(), BLI_task_parallel_range(), boid_body(), boid_brain(), boids_precalc_rules(), BoidBrainData::cfra, DynamicStepSolverTaskData::cfra, ParticleSystem::cfra, ParticleSimulationData::colliders, collision_check(), ParticleSettings::collision_group, copy_particle_key(), ParticleSimulationData::depsgraph, BoidBrainData::dfra, ParticleData::dietime, DynamicStepSolverTaskData::dtime, dynamics_step_sph_classical_basic_integrate_task_cb_ex(), dynamics_step_sph_classical_calc_density_task_cb_ex(), dynamics_step_sph_classical_integrate_task_cb_ex(), dynamics_step_sph_ddr_task_cb_ex(), dynamics_step_sphdata_reduce(), ELEM, ListBase::first, ParticleData::flag, ParticleSettings::flag, ParticleSettings::fluid, TaskParallelSettings::func_reduce, BoidBrainData::goal_ob, LOOP_DYNAMIC_PARTICLES, LOOP_EXISTING_PARTICLES, LOOP_SHOWN_PARTICLES, ParticleTarget::next, ParticleSimulationData::ob, ParticleTarget::ob, PAMAP_SIZE, PARS_ALIVE, PARS_DEAD, PARS_DYING, PARS_NO_DISP, PARS_UNBORN, PARS_UNEXIST, BoidBrainData::part, ParticleSystem::part, PART_HAIR, PART_PHYS_BOIDS, PART_PHYS_FLUID, PART_PHYS_NEWTON, PART_PHYS_NO, PART_UNBORN, PARTICLE_P, Object::particlesystem, ParticleSettings::phystype, ParticleSystem::pointcache, ParticleData::prev_state, ParticleSimulationData::psys, ParticleTarget::psys, psys_frand(), psys_get_target_system(), psys_get_texture(), psys_get_timestep(), psys_sph_finalize(), psys_sph_init(), psys_update_effectors(), psys_update_particle_bvhtree(), psys_update_particle_tree(), ParticleSettings::randsize, reset_particle(), BoidBrainData::rng, ParticleSimulationData::rng, ParticleSystem::seed, BoidBrainData::sim, DynamicStepSolverTaskData::sim, ParticleData::size, ParticleSettings::size, ParticleTexture::size, SPHFluidSettings::solver, SPH_SOLVER_DDR, sph_springs_modify(), DynamicStepSolverTaskData::spin, ParticleData::state, PointCache::step, ParticleSystem::targets, ParticleData::time, ParticleKey::time, BoidBrainData::timestep, DynamicStepSolverTaskData::timestep, ParticleSystem::totpart, ParticleSettings::type, TaskParallelSettings::use_threading, TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by system_step().
|
static |
Definition at line 3753 of file particle_system.cc.
References basic_integrate(), data, ParticleSystem::particles, ParticleSimulationData::psys, ParticleData::state, and ParticleKey::time.
Referenced by dynamics_step().
|
static |
Definition at line 3769 of file particle_system.cc.
References data, ParticleSystem::particles, ParticleSimulationData::psys, sphclassical_calc_dens(), ParticleData::state, and ParticleKey::time.
Referenced by dynamics_step().
|
static |
Definition at line 3787 of file particle_system.cc.
References basic_rotate(), ParticleSimulationData::colliders, collision_check(), data, ParticleSystem::part, PART_TIME_AUTOSF, ParticleSystem::particles, ParticleSimulationData::psys, sph_integrate(), ParticleData::state, ParticleKey::time, ParticleSettings::time_flag, and update_courant_num().
Referenced by dynamics_step().
|
static |
Definition at line 3717 of file particle_system.cc.
References basic_integrate(), basic_rotate(), ParticleSimulationData::colliders, collision_check(), data, ParticleSystem::part, PART_TIME_AUTOSF, ParticleSystem::particles, ParticleSimulationData::psys, sph_integrate(), ParticleData::state, ParticleKey::time, ParticleSettings::time_flag, and update_courant_num().
Referenced by dynamics_step().
|
static |
Definition at line 3700 of file particle_system.cc.
References BLI_buffer_append_array, BLI_buffer_at, BLI_buffer_field_free, BLI_Buffer::count, and SPHData::new_springs.
Referenced by dynamics_step().
|
static |
Definition at line 4453 of file particle_system.cc.
References ParticleSimulationData::psys, realloc_particles(), tot_particles(), and ParticleSystem::totpart.
Referenced by particle_system_update(), and system_step().
Definition at line 1038 of file particle_system.cc.
References BKE_object_where_is_calc_time(), depsgraph, evaluate_emitter_anim(), and Object::parent.
Referenced by evaluate_emitter_anim(), particle_system_update(), and reset_particle().
|
static |
Definition at line 606 of file particle_system.cc.
References ParticleData::boid, LOOP_PARTICLES, MEM_calloc_arrayN(), MEM_freeN(), PARS_UNEXIST, PARTICLE_P, ParticleSystem::particles, ParticleSimulationData::psys, ParticleSystem::totpart, and ParticleSystem::totunexist.
Referenced by particle_system_update(), and system_step().
|
static |
Definition at line 662 of file particle_system.cc.
References copy_v3_v3(), cross_v3_v3v3(), PART_AVE_GLOBAL_X, PART_AVE_GLOBAL_Y, PART_AVE_GLOBAL_Z, PART_AVE_HORIZONTAL, PART_AVE_VELOCITY, PART_AVE_VERTICAL, and state.
Referenced by basic_rotate(), and psys_get_birth_coords().
|
static |
Definition at line 3640 of file particle_system.cc.
References ParticleSettings::subframes.
Referenced by system_step(), and update_timestep().
|
static |
Definition at line 3310 of file particle_system.cc.
References add_v3_v3v3(), ParticleSettings::bending_random, ClothHairData::bending_stiffness, BKE_mesh_new_nomain(), ParticleSystem::clmd, HairKey::co, copy_m3_m4(), copy_v3_v3(), ParticleData::flag, ParticleSettings::from, ParticleData::hair, ParticleData::hair_index, hair_set_pinning(), ClothModifierData::hairdata, len_v3v3(), length(), ClothHairData::loc, LOOP_PARTICLES, MEM_malloc_arrayN(), ParticleSystemModifierData::mesh_final, mul_m4_m4m4(), mul_m4_v3(), normalize_m4(), ParticleSimulationData::ob, PARS_UNEXIST, ParticleSystem::part, PARTICLE_P, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_frand(), psys_hair_use_simulation(), psys_mat_hair_to_object(), ClothHairData::radius, ClothHairData::rot, ClothModifierData::sim_parms, ParticleSettings::size, sub_v3_v3(), ParticleData::totkey, ClothSimSettings::vgroup_mass, and HairKey::weight.
Referenced by do_hair_dynamics().
|
static |
Definition at line 4744 of file particle_system.cc.
References ParticleSystem::edit, PTCacheEdit::edited, ParticleSettings::flag, ParticleSystem::flag, ID_RECALC_PSYS_RESET, ParticleSystem::part, PART_HAIR_REGROW, PSYS_EDITED, PSYS_HAIR_DONE, and ParticleSystem::recalc.
Referenced by particle_system_update().
|
static |
Definition at line 3296 of file particle_system.cc.
References MDeformVert::dw, MEM_callocN(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by hair_create_input_mesh().
|
static |
Definition at line 3516 of file particle_system.cc.
References ParticleSystem::clmd, cloth_free_modifier(), do_hair_dynamics(), ParticleData::flag, ParticleSystem::flag, ID_RECALC_PSYS_RESET, LOOP_PARTICLES, ParticleSystemModifierData::mesh_final, ParticleSystemModifierData::mesh_original, ParticleSimulationData::ob, PARS_NO_DISP, ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_calc_dmcache(), psys_frand(), psys_get_current_display_percentage(), PSYS_HAIR_DYNAMICS, PSYS_HAIR_UPDATED, psys_update_effectors(), psys_update_path_cache(), ParticleSettings::randsize, ParticleSystem::recalc, ParticleData::size, ParticleSettings::size, and ParticleSettings::type.
Referenced by particle_system_update().
| void init_particle | ( | struct ParticleSimulationData * | sim, |
| struct ParticleData * | pa ) |
Set particle parameters that don't change during particle's life.
Definition at line 567 of file particle_system.cc.
References ParticleSettings::end, ParticleData::flag, ParticleData::hair_index, PARS_UNEXIST, ParticleSystem::part, ParticleSystem::particles, ParticleSimulationData::psys, ParticleSettings::sta, ParticleData::time, and ParticleSystem::totpart.
Referenced by brush_add(), and initialize_all_particles().
|
static |
Definition at line 543 of file particle_system.cc.
References ParticleSettings::end, ParticleTexture::exist, ParticleData::flag, PAMAP_INIT, PARS_UNEXIST, ParticleSystem::part, PART_EMITTER, PART_HAIR, ParticleSimulationData::psys, psys_frand(), psys_get_texture(), ParticleSettings::sta, ParticleData::time, ParticleTexture::time, and ParticleSettings::type.
Referenced by reset_particle().
|
static |
Definition at line 581 of file particle_system.cc.
References ParticleSettings::distr, ELEM, ParticleSettings::from, init_particle(), LOOP_PARTICLES, PARS_UNEXIST, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_CHILD, PART_FROM_VERT, PARTICLE_P, and ParticleSimulationData::psys.
Referenced by particle_system_update(), and system_step().
|
static |
Definition at line 1396 of file particle_system.cc.
References add_v3_v3(), add_v3_v3v3(), ParticleKey::co, copy_particle_key(), copy_v3_v3(), ParticleSettings::flag, i, ParticleSettings::integrator, madd_v3_v3fl(), madd_v3_v3v3fl(), ParticleSettings::mass, mul_v3_fl(), mul_v3_v3fl(), PART_INT_EULER, PART_INT_MIDPOINT, PART_INT_RK4, PART_INT_VERLET, PART_SIZEMASS, ParticleData::prev_state, ParticleData::size, ParticleData::state, state, steps, sub_v3_v3v3(), ParticleKey::time, ParticleKey::vel, ZERO_F43, and zero_v3().
Referenced by basic_integrate(), and sph_integrate().
|
static |
Definition at line 2421 of file particle_system.cc.
References cross_v3_v3v3(), fabsf, len_v3(), sub_v3_v3v3(), v2, ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by collision_sphere_to_edges().
|
static |
Definition at line 2436 of file particle_system.cc.
References len_v3v3(), and ParticleCollisionElement::x0.
Referenced by collision_sphere_to_verts().
|
static |
Definition at line 2389 of file particle_system.cc.
References cross_v3_v3v3(), dot_v3v3(), ParticleCollisionElement::inv_nor, negate_v3(), nor, normalize_v3(), sub_v3_v3v3(), ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by collision_newton_rhapson(), collision_point_distance_with_normal(), and collision_sphere_to_tri().
|
static |
Definition at line 4763 of file particle_system.cc.
References BKE_libblock_free_data(), BKE_libblock_free_datablock(), BLI_assert, ParticleSettings::id, MEM_freeN(), and ID::py_instance.
Referenced by particle_system_update().
|
static |
Definition at line 4756 of file particle_system.cc.
References BKE_id_copy_ex(), ParticleSettings::id, and LIB_ID_COPY_LOCALIZE.
Referenced by particle_system_update().
| void particle_system_update | ( | struct Depsgraph * | depsgraph, |
| struct Scene * | scene, | ||
| struct Object * | ob, | ||
| struct ParticleSystem * | psys, | ||
| bool | use_render_params ) |
Main particle update call, checks that things are ok on the large scale and then advances in to actual particle calculations depending on particle type.
Definition at line 4771 of file particle_system.cc.
References ParticleSettings::adt, ADT_RECALC_ANIM, BKE_animsys_eval_context_construct(), BKE_animsys_evaluate_animdata(), BKE_mesh_tessface_ensure(), BKE_particle_batch_cache_dirty_tag(), BKE_PARTICLE_BATCH_DIRTY_ALL, ParticleSystem::cfra, DEG_get_ctime(), DEG_is_active(), depsgraph, ParticleSimulationData::depsgraph, distribute_particles(), ParticleSystem::edit, emit_particles(), eParticleSystemFlag_Pars, eParticleSystemFlag_psys_updated, evaluate_emitter_anim(), ParticleData::flag, ParticleDrawData::flag, ParticleSettings::flag, ParticleSystem::flag, ParticleSystemModifierData::flag, PTCacheEdit::flags, ParticleSystem::free_edit, free_hair(), free_keyed_keys(), free_unexisting_particles(), ParticleSettings::from, hair_needs_recalc(), hair_step(), ParticleSettings::hair_step, i, ParticleSettings::id, ID_RECALC_PSYS_RESET, ParticleSystem::imat, initialize_all_particles(), invert_m4_m4(), LOOP_EXISTING_PARTICLES, ParticleSystemModifierData::mesh_final, ParticleSimulationData::ob, PAMAP_SIZE, PARS_NO_DISP, ParticleSystem::part, PART_FROM_VERT, PART_HAIR, PART_HAIR_REGROW, PART_PHYS_KEYED, PART_PHYS_NO, PARTICLE_DRAW_DATA_UPDATED, PARTICLE_P, particle_settings_free_local(), particle_settings_localize(), particles_fluid_step(), particles_has_bubble(), particles_has_flip(), particles_has_foam(), particles_has_spray(), particles_has_tracer(), ParticleSystem::pdd, ParticleSettings::phystype, ParticleSimulationData::psmd, PTCacheEdit::psmd_eval, ParticleSimulationData::psys, PTCacheEdit::psys, psys_check_enabled(), psys_count_keyed_targets(), PSYS_EDITED, PTCacheEdit::psys_eval, psys_frand(), psys_free_path_cache(), psys_get_current_display_percentage(), psys_get_modifier(), psys_get_texture(), PSYS_HAIR_DONE, PSYS_OB_ANIM_RESTORE, psys_orig_get(), psys_prepare_physics(), psys_reset(), PSYS_RESET_ALL, PSYS_SHARED_CACHES, psys_update_path_cache(), PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL, ParticleSettings::randsize, ParticleSystem::recalc, reset_particle(), save_hair(), ParticleSimulationData::scene, set_keyed_keys(), ParticleData::size, ParticleSettings::size, ParticleTexture::size, system_step(), ParticleSettings::totpart, ParticleSystem::totpart, ParticleSystem::totunexist, and ParticleSettings::type.
Referenced by BKE_object_handle_data_update(), and deform_verts().
|
static |
Definition at line 79 of file particle_system.cc.
References ELEM, ParticleSystem::flag, PointCache::flag, ParticleSystem::part, PART_HAIR, PART_PHYS_BOIDS, PART_PHYS_FLUID, PART_PHYS_NEWTON, ParticleSettings::phystype, ParticleSystem::pointcache, PSYS_HAIR_DYNAMICS, PTCACHE_BAKED, and ParticleSettings::type.
Referenced by psys_get_current_display_percentage().
|
static |
Definition at line 4176 of file particle_system.cc.
References add_v3_v3(), add_v3_v3v3(), ParticleData::alive, ParticleKey::ave, BKE_modifiers_findby_type(), BLI_rng_free(), BLI_rng_get_double(), BLI_rng_new_srandom(), BLI_snprintf(), FluidDomainSettings::cell_size, ParticleKey::co, copy_v3_v3(), ParticleData::dietime, ParticleSettings::disp, FluidModifierData::domain, FluidDomainSettings::dx, RenderData::efra, eModifierType_Fluid, ParticleSettings::end, fabsf, FluidDomainSettings::fluid, FLUID_DOMAIN_PARTICLE_BUBBLE, FLUID_DOMAIN_PARTICLE_FLIP, FLUID_DOMAIN_PARTICLE_FOAM, FLUID_DOMAIN_PARTICLE_SPRAY, FLUID_DOMAIN_PARTICLE_TRACER, ParticleData::lifetime, ParticleSettings::lifetime, madd_v3fl_v3fl_v3fl_v3i(), manta_get_res_x(), manta_get_res_y(), manta_get_res_z(), manta_liquid_get_flip_particle_flag_at(), manta_liquid_get_flip_particle_position_x_at(), manta_liquid_get_flip_particle_position_y_at(), manta_liquid_get_flip_particle_position_z_at(), manta_liquid_get_flip_particle_velocity_x_at(), manta_liquid_get_flip_particle_velocity_y_at(), manta_liquid_get_flip_particle_velocity_z_at(), manta_liquid_get_num_flip_particles(), manta_liquid_get_num_snd_particles(), manta_liquid_get_particle_res_x(), manta_liquid_get_particle_res_y(), manta_liquid_get_particle_res_z(), manta_liquid_get_particle_upres(), manta_liquid_get_snd_particle_flag_at(), manta_liquid_get_snd_particle_position_x_at(), manta_liquid_get_snd_particle_position_y_at(), manta_liquid_get_snd_particle_position_z_at(), manta_liquid_get_snd_particle_velocity_x_at(), manta_liquid_get_snd_particle_velocity_y_at(), manta_liquid_get_snd_particle_velocity_z_at(), max, MEM_freeN(), min, mul_m4_v3(), mul_v3_fl(), mul_v3_v3(), ParticleSimulationData::ob, FluidDomainSettings::p0, FluidDomainSettings::p1, PARS_ALIVE, ParticleSystem::part, PART_FLUID_FLIP, FluidDomainSettings::particle_type, PARTICLE_TYPE_BUBBLE, PARTICLE_TYPE_DELETE, PARTICLE_TYPE_FOAM, PARTICLE_TYPE_SPRAY, PARTICLE_TYPE_TRACER, ParticleSystem::particles, particles_has_bubble(), particles_has_flip(), particles_has_foam(), particles_has_spray(), particles_has_tracer(), printf, ParticleSimulationData::psys, psys_frand(), Scene::r, ParticleSettings::randsize, realloc_particles(), FluidDomainSettings::res_max, FluidDomainSettings::res_min, ParticleSimulationData::rng, ParticleKey::rot, Object::scale, ParticleSimulationData::scene, ParticleSystem::seed, ParticleData::size, ParticleSettings::size, size(), ParticleSettings::sta, ParticleData::state, sub_v3_v3(), sub_v3_v3v3(), ParticleData::time, ParticleSettings::totpart, ParticleSystem::totpart, ParticleSettings::type, unit_qt(), UNUSED_VARS, ParticleKey::vel, and zero_v3().
Referenced by particle_system_update().
|
static |
Definition at line 4166 of file particle_system.cc.
References ELEM, PART_FLUID_BUBBLE, PART_FLUID_FOAMBUBBLE, and PART_FLUID_SPRAYFOAMBUBBLE.
Referenced by particle_system_update(), and particles_fluid_step().
|
static |
Definition at line 4151 of file particle_system.cc.
References PART_FLUID_FLIP.
Referenced by particle_system_update(), and particles_fluid_step().
|
static |
Definition at line 4171 of file particle_system.cc.
References ELEM, PART_FLUID_FOAM, PART_FLUID_SPRAYFOAM, and PART_FLUID_SPRAYFOAMBUBBLE.
Referenced by particle_system_update(), and particles_fluid_step().
|
static |
Definition at line 4161 of file particle_system.cc.
References ELEM, PART_FLUID_SPRAY, PART_FLUID_SPRAYFOAM, and PART_FLUID_SPRAYFOAMBUBBLE.
Referenced by particle_system_update(), and particles_fluid_step().
|
static |
Definition at line 4156 of file particle_system.cc.
References PART_FLUID_TRACER.
Referenced by particle_system_update(), and particles_fluid_step().
|
static |
Definition at line 4999 of file particle_system.cc.
References data.
Referenced by BKE_particlesystem_id_loop().
| void psys_calc_dmcache | ( | Object * | ob, |
| Mesh * | mesh_final, | ||
| Mesh * | mesh_original, | ||
| ParticleSystem * | psys ) |
Definition at line 304 of file particle_system.cc.
References CD_ORIGINDEX, CustomData_get_layer(), Object::data, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, Mesh::face_data, Mesh::fdata_legacy, ParticleSettings::from, i, LinkNode::link, LOOP_PARTICLES, MEM_calloc_arrayN(), MEM_freeN(), LinkNode::next, ORIGINDEX_NONE, ParticleSystem::part, PART_FROM_VERT, PARTICLE_P, POINTER_AS_INT, POINTER_FROM_INT, psys_particle_dm_face_lookup(), Mesh::runtime, Mesh::totface_legacy, ParticleSettings::use_modifier_stack, Mesh::vert_data, and Mesh::verts_num.
Referenced by distribute_particles_on_dm(), distribute_simple_children(), and hair_step().
| void psys_changed_type | ( | struct Object * | ob, |
| struct ParticleSystem * | psys ) |
System type has changed so set sensible defaults and clear non applicable flags.
Definition at line 4633 of file particle_system.cc.
References BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), CLAMP, ParticleSettings::distr, ParticleSettings::draw_as, ELEM, ParticleSettings::end, ParticleSystem::flag, free_hair(), ParticleSettings::lifetime, ParticleSystem::part, PART_DISTR_GRID, PART_DISTR_JIT, PART_DRAW_GR, PART_DRAW_NOT, PART_DRAW_OB, PART_DRAW_PATH, PART_DRAW_REND, PART_HAIR, PART_PHYS_KEYED, ParticleSettings::path_end, ParticleSettings::path_start, ParticleSettings::phystype, PSYS_KEYED, psys_reset(), PSYS_RESET_ALL, PTCACHE_CLEAR_ALL, ParticleSettings::ren_as, and ParticleSettings::type.
Referenced by blender::ed::curves::convert_to_particle_system::try_convert_single_object().
| void psys_check_boid_data | ( | ParticleSystem * | psys | ) |
Definition at line 4671 of file particle_system.cc.
References ParticleData::boid, LOOP_PARTICLES, MEM_calloc_arrayN(), MEM_freeN(), ParticleSystem::part, PART_PHYS_BOIDS, PARTICLE_P, ParticleSystem::particles, ParticleSettings::phystype, and ParticleSystem::totpart.
Referenced by new_particle_settings_exec(), and psys_prepare_physics().
|
static |
Definition at line 1288 of file particle_system.cc.
References BKE_ptcache_free_mem(), PointCache::flag, PointCache::mem_cache, ParticleSystem::pointcache, and PTCACHE_DISK_CACHE.
Referenced by system_step().
| void psys_count_keyed_targets | ( | struct ParticleSimulationData * | sim | ) |
Counts valid keyed targets.
Definition at line 1169 of file particle_system.cc.
References ParticleTarget::duration, ListBase::first, ParticleSystem::flag, ParticleSettings::keyed_loops, ParticleTarget::next, ParticleSimulationData::ob, ParticleSystem::part, ParticleSimulationData::psys, psys_get_target_system(), PSYS_KEYED_TIMING, ParticleSystem::targets, and ParticleSystem::totkeyed.
Referenced by particle_system_update().
| void psys_get_birth_coords | ( | ParticleSimulationData * | sim, |
| ParticleData * | pa, | ||
| ParticleKey * | state, | ||
| float | dtime, | ||
| float | cfra ) |
Definition at line 698 of file particle_system.cc.
References ParticleSettings::avefac, ParticleSettings::avemode, axis_angle_to_quat(), BLI_assert, ParticleData::boid, copy_qt_qt(), copy_v3_v3(), cosf, cross_v3_v3v3(), dot_v3v3(), fabsf, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, get_angular_velocity_vector(), interp_qt_qtqt(), invert_qt_qt_normalized(), ParticleTexture::ivel, M_PI, madd_v3_v3fl(), mat3_to_quat(), mat3_to_quat_legacy(), mat4_to_quat(), mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_qtqt(), mul_qt_v3(), mul_v3_fl(), mul_v3_v3fl(), negate_v3(), negate_v3_v3(), nor, normalize_qt(), normalize_v3(), normalize_v3_v3(), ParticleSettings::normfac, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, OB_POSX, OB_POSZ, ParticleSettings::ob_vel, ParticleSettings::obfac, PAMAP_IVEL, ParticleSystem::part, PART_AVE_RAND, PART_PHYS_BOIDS, PART_ROT_GLOB_X, PART_ROT_GLOB_Y, PART_ROT_GLOB_Z, PART_ROT_NOR, PART_ROT_NOR_TAN, PART_ROT_OB_X, PART_ROT_OB_Y, PART_ROT_OB_Z, PART_ROT_VEL, ParticleSettings::partfac, ParticleSystem::particles, ParticleSettings::phasefac, ParticleSettings::phystype, ParticleData::prev_state, project_v3_v3v3(), ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_frand(), psys_get_texture(), psys_particle_on_emitter(), psys_particle_value_from_verts(), ParticleSettings::randfac, ParticleSettings::randphasefac, ParticleSettings::randrotfac, rot, ParticleSettings::rotmode, sinf, ParticleData::state, state, sub_v3_v3(), sub_v3_v3v3(), ParticleSettings::tanfac, ParticleSettings::tanphase, unit_qt(), vec_to_quat(), ParticleKey::vel, and zero_v3().
Referenced by explodeMesh(), and reset_particle().
| int psys_get_child_number | ( | Scene * | scene, |
| ParticleSystem * | psys, | ||
| const bool | use_render_params ) |
Definition at line 277 of file particle_system.cc.
References ParticleSettings::child_percent, ParticleSettings::child_render_percent, ParticleSettings::childtype, get_render_child_particle_number(), ParticleSystem::part, and Scene::r.
Referenced by distribute_simple_children(), and psys_get_tot_child().
| float psys_get_current_display_percentage | ( | ParticleSystem * | psys, |
| const bool | use_render_params ) |
Definition at line 92 of file particle_system.cc.
References ParticleSettings::child_percent, ParticleSettings::childtype, ParticleSettings::disp, PointCache::flag, ParticleSystem::part, particles_are_dynamic(), ParticleSystem::pointcache, and PTCACHE_BAKING.
Referenced by cached_step(), hair_step(), particle_system_update(), and system_step().
| void psys_get_pointcache_start_end | ( | Scene * | scene, |
| ParticleSystem * | psys, | ||
| int * | sfra, | ||
| int * | efra ) |
Definition at line 1294 of file particle_system.cc.
References RenderData::efra, ParticleSettings::end, ParticleSettings::lifetime, max_ii(), min_ii(), ParticleSystem::part, RenderData::pefra, Scene::r, and ParticleSettings::sta.
Referenced by BKE_ptcache_bake(), and system_step().
| ParticleSystem * psys_get_target_system | ( | Object * | ob, |
| ParticleTarget * | pt ) |
Definition at line 1144 of file particle_system.cc.
References BLI_findlink(), ELEM, ParticleTarget::flag, ParticleTarget::ob, Object::particlesystem, ParticleTarget::psys, and PTARGET_VALID.
Referenced by dynamics_step(), psys_count_keyed_targets(), psys_sph_init(), rule_avoid_collision(), rule_fight(), and rule_separate().
| int psys_get_tot_child | ( | Scene * | scene, |
| ParticleSystem * | psys, | ||
| const bool | use_render_params ) |
Definition at line 295 of file particle_system.cc.
References psys_get_child_number(), and ParticleSystem::totpart.
Referenced by distribute_invalid(), distribute_simple_children(), psys_thread_context_init_distribute(), psys_update_path_cache(), and update_children().
|
static |
Definition at line 3269 of file particle_system.cc.
References HairKey::co, ParticleData::hair, len_v3v3(), length(), and ParticleData::totkey.
Referenced by hair_create_input_mesh().
| void psys_make_temp_pointcache | ( | Object * | ob, |
| ParticleSystem * | psys ) |
Definition at line 1276 of file particle_system.cc.
References BKE_ptcache_disk_to_mem(), BKE_ptcache_id_from_particles(), BLI_listbase_is_empty(), PointCache::flag, PointCache::mem_cache, ParticleSystem::pointcache, and PTCACHE_DISK_CACHE.
|
static |
Definition at line 4720 of file particle_system.cc.
References BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), BLI_assert, ParticleSettings::boids, ELEM, ParticleSystem::flag, ParticleSettings::fluid, free_keyed_keys(), ParticleSimulationData::ob, ParticleSystem::part, PART_PHYS_BOIDS, PART_PHYS_FLUID, PART_PHYS_KEYED, PART_PHYS_NO, ParticleSettings::phystype, ParticleSimulationData::psys, psys_check_boid_data(), PSYS_KEYED, and PTCACHE_CLEAR_ALL.
Referenced by particle_system_update().
| void psys_reset | ( | ParticleSystem * | psys, |
| int | mode ) |
Definition at line 119 of file particle_system.cc.
References ParticleSystem::alloc_fluidsprings, BKE_ptcache_invalidate(), ParticleSystem::child, ParticleSystem::edit, ELEM, ParticleSystem::flag, ParticleSystem::fluid_springs, ParticleSystem::free_edit, LOOP_PARTICLES, MEM_SAFE_FREE, PARS_NO_DISP, PARTICLE_P, ParticleSystem::pointcache, PSYS_EDITED, psys_free_particles(), psys_free_path_cache(), PSYS_HAIR_DONE, PSYS_KEYED, PSYS_RESET_ALL, PSYS_RESET_CACHE_MISS, PSYS_RESET_DEPSGRAPH, ParticleSystem::tot_fluidsprings, tot_particles(), ParticleSystem::totchild, ParticleSystem::totkeyed, and ParticleSystem::totpart.
Referenced by BKE_ptcache_id_reset(), clear_edited_exec(), particle_system_update(), psys_changed_type(), and system_step().
Sample the density field at a point in space.
Definition at line 2165 of file particle_system.cc.
References SPHRangeData::data, SPHData::density_cb, SPHFluidSettings::flag, ParticleSettings::fluid, SPHRangeData::h, SPHData::hfac, SPHData::mass, SPHRangeData::mass, ParticleSystem::part, SPHData::psys, SPHFluidSettings::radius, ParticleSettings::size, sph_evaluate_func(), SPH_FAC_RADIUS, and tree.
| void psys_sph_finalize | ( | SPHData * | sphdata | ) |
Definition at line 2160 of file particle_system.cc.
References psys_sph_flush_springs().
Referenced by dynamics_step().
|
static |
Definition at line 2150 of file particle_system.cc.
References BLI_buffer_at, BLI_buffer_field_free, BLI_Buffer::count, i, SPHData::new_springs, SPHData::psys, and sph_spring_add().
Referenced by psys_sph_finalize().
| void psys_sph_init | ( | ParticleSimulationData * | sim, |
| SPHData * | sphdata ) |
Definition at line 2109 of file particle_system.cc.
References BLI_buffer_field_init, SPHData::density_cb, SPHData::eh, ListBase::first, ParticleSettings::fluid, SPHData::force_cb, PhysicsSettings::gravity, SPHData::gravity, SPHData::hfac, i, SPHData::mass, SPHData::new_springs, ParticleTarget::next, ParticleSimulationData::ob, SPHData::pa, ParticleSystem::part, Scene::physics_settings, ParticleSimulationData::psys, SPHData::psys, psys_get_target_system(), psys_uses_gravity(), ParticleSimulationData::scene, SPHFluidSettings::solver, sph_density_accum_cb(), sph_force_cb(), SPH_SOLVER_DDR, sph_springhash_build(), sphclassical_density_accum_cb(), sphclassical_force_cb(), and ParticleSystem::targets.
Referenced by dynamics_step().
| blender::Vector< ParticleTask > psys_tasks_create | ( | ParticleThreadContext * | ctx, |
| int | startpart, | ||
| int | endpart ) |
Definition at line 445 of file particle_system.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::begin(), BLI_assert, BLI_system_thread_count(), blender::Vector< T, InlineBufferCapacity, Allocator >::end(), i, and min_ii().
Referenced by distribute_particles_on_dm(), and psys_cache_child_paths().
| void psys_tasks_free | ( | blender::Vector< ParticleTask > & | tasks | ) |
Definition at line 471 of file particle_system.cc.
References BLI_rng_free(), and blender::Vector< T, InlineBufferCapacity, Allocator >::clear().
Referenced by distribute_particles_on_dm(), and psys_cache_child_paths().
| void psys_thread_context_free | ( | ParticleThreadContext * | ctx | ) |
Definition at line 486 of file particle_system.cc.
References BKE_curvemapping_free(), ParticleThreadContext::clumpcurve, ParticleThreadContext::index, ParticleThreadContext::jit, ParticleThreadContext::jitoff, MEM_freeN(), psys_sim_data_free(), ParticleThreadContext::roughcurve, ParticleThreadContext::seams, ParticleThreadContext::sim, ParticleThreadContext::tree, ParticleThreadContext::twistcurve, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, ParticleThreadContext::vg_roughe, ParticleThreadContext::vg_twist, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm(), and psys_cache_child_paths().
| void psys_thread_context_init | ( | struct ParticleThreadContext * | ctx, |
| struct ParticleSimulationData * | sim ) |
Threaded child particle distribution and path caching.
Definition at line 437 of file particle_system.cc.
References BKE_object_material_get(), ParticleThreadContext::ma, ParticleThreadContext::mesh, ParticleSystemModifierData::mesh_final, ParticleSimulationData::ob, ParticleSettings::omat, ParticleSystem::part, ParticleSimulationData::psmd, ParticleSimulationData::psys, and ParticleThreadContext::sim.
Referenced by psys_thread_context_init_distribute(), and psys_thread_context_init_path().
| void psys_unique_name | ( | Object * | object, |
| ParticleSystem * | psys, | ||
| const char * | defname ) |
Definition at line 165 of file particle_system.cc.
References BLI_uniquename(), ParticleSystem::name, offsetof, and Object::particlesystem.
|
static |
Definition at line 1387 of file particle_system.cc.
References BKE_effectors_create(), BKE_effectors_free(), ParticleSimulationData::depsgraph, ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleSettings::flag, ParticleSimulationData::ob, ParticleSystem::part, PART_ROT_DYN, precalc_guides(), and ParticleSimulationData::psys.
Referenced by cached_step(), dynamics_step(), and hair_step().
|
static |
Definition at line 1314 of file particle_system.cc.
References BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), BLI_rw_mutex_lock(), BLI_rw_mutex_unlock(), BLI_task_isolate(), ParticleSystem::bvhtree, bvhtree_balance_isolated(), ParticleSystem::bvhtree_frame, LOOP_SHOWN_PARTICLES, PARS_ALIVE, PARTICLE_P, psys_bvhtree_rwlock, THREAD_LOCK_READ, and THREAD_LOCK_WRITE.
Referenced by dynamics_step().
| void psys_update_particle_tree | ( | ParticleSystem * | psys, |
| float | cfra ) |
Definition at line 1356 of file particle_system.cc.
References LOOP_SHOWN_PARTICLES, PARS_ALIVE, PARTICLE_P, ParticleSystem::tree, and ParticleSystem::tree_frame.
Referenced by dynamics_step(), and precalculate_effector().
|
static |
Check if path cache or children need updating and do it if needed.
Definition at line 3176 of file particle_system.cc.
References ParticleSettings::childtype, DAG_EVAL_RENDER, DEG_get_mode(), ParticleSimulationData::depsgraph, distribute_particles(), ParticleSettings::draw_as, ELEM, ParticleEditSettings::flag, ParticleSystem::flag, PointCache::flag, ID_RECALC_PSYS_CHILD, ID_RECALC_PSYS_RESET, Object::mode, ParticleSimulationData::ob, OB_MODE_WEIGHT_PAINT, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_FACES, PART_DRAW_GR, PART_DRAW_OB, PART_DRAW_PATH, PART_DRAW_REND, PART_FROM_CHILD, PART_HAIR, ToolSettings::particle, ParticleSystem::pathcache, PE_DRAW_PART, ParticleSystem::pointcache, ParticleSimulationData::psys, psys_cache_child_paths(), psys_cache_paths(), psys_find_parents(), psys_free_children(), psys_free_path_cache(), psys_get_tot_child(), psys_get_tot_child(), PSYS_HAIR_DONE, PSYS_HAIR_DYNAMICS, psys_in_edit_mode(), PSYS_KEYED, PSYS_VG_DENSITY, PTCACHE_BAKED, PTCACHE_BAKING, realloc_particles(), ParticleSystem::recalc, ParticleSettings::ren_as, ParticleSimulationData::scene, Scene::toolsettings, ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, and ParticleSystem::vgroup.
Referenced by hair_step(), particle_system_update(), and system_step().
|
static |
Definition at line 175 of file particle_system.cc.
References ParticleData::boid, ParticleSystem::child, ParticleSettings::distr, ParticleSystem::edit, ParticleSystem::free_edit, ParticleSettings::from, ParticleSettings::grid_res, ParticleData::keys, LOOP_PARTICLES, MEM_calloc_arrayN(), MEM_freeN(), ParticleSystem::part, PART_DISTR_GRID, PART_FROM_VERT, PART_PHYS_BOIDS, PARTICLE_P, ParticleSystem::particles, ParticleSettings::phystype, ParticleSimulationData::psys, psys_free_pdd(), ParticleSystem::totchild, ParticleSettings::totpart, and ParticleSystem::totpart.
Referenced by emit_particles(), particles_fluid_step(), and psys_update_path_cache().
|
static |
Definition at line 1130 of file particle_system.cc.
References ParticleSystem::particles, ParticleSimulationData::psys, reset_particle(), and ParticleSystem::totpart.
Referenced by system_step().
| void reset_particle | ( | struct ParticleSimulationData * | sim, |
| struct ParticleData * | pa, | ||
| float | dtime, | ||
| float | cfra ) |
Sets particle to the emitter surface with initial velocity & rotation.
Definition at line 1047 of file particle_system.cc.
References BoidData::acc, ParticleData::alive, ParticleData::boid, ParticleSettings::boids, ParticleSystem::cfra, BoidParticle::data, ParticleSimulationData::depsgraph, ParticleData::dietime, eBoidMode_InAir, evaluate_emitter_anim(), ListBase::first, ParticleSystem::flag, PhysicsSettings::flag, PointCache::flag, BoidParticle::gravity, PhysicsSettings::gravity, BoidData::health, BoidSettings::health, init_particle_texture(), ParticleTexture::life, ParticleData::lifetime, ParticleSettings::lifetime, PointCache::mem_cache, BoidData::mode, ParticleSimulationData::ob, PAMAP_LIFE, PARS_ALIVE, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_HAIR, PART_PHYS_BOIDS, ParticleSystem::particles, PHYS_GLOBAL_GRAVITY, Scene::physics_settings, ParticleSettings::phystype, ParticleSystem::pointcache, ParticleSimulationData::psys, psys_frand(), psys_get_birth_coords(), psys_get_dietime_from_cache(), psys_get_texture(), PSYS_OB_ANIM_RESTORE, PTCACHE_BAKED, ParticleSettings::randlife, ParticleSimulationData::scene, ParticleData::state, BoidData::state_id, BoidSettings::states, ParticleData::time, ParticleKey::time, and ParticleSettings::type.
Referenced by brush_add(), cached_step(), dynamics_step(), particle_system_update(), and reset_all_particles().
|
static |
Definition at line 3559 of file particle_system.cc.
References HairKey::co, ParticleKey::co, copy_v3_v3(), ParticleData::hair, ParticleSettings::hair_step, invert_m4_m4(), LOOP_PARTICLES, MEM_calloc_arrayN(), ParticleSystemModifierData::mesh_final, mul_m4_v3(), ParticleSimulationData::ob, ParticleSystem::part, PARTICLE_P, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_sim_data_free(), psys_sim_data_init(), psys_vec_rot_to_face(), Object::runtime, ParticleData::state, sub_v3_v3(), HairKey::time, ParticleKey::time, ParticleData::totkey, ParticleSystem::totpart, HairKey::weight, and zero_v3().
Referenced by particle_system_update().
|
static |
Definition at line 1193 of file particle_system.cc.
References BLI_findlink(), copy_particle_key(), ParticleSimulationData::depsgraph, ParticleTarget::duration, ListBase::first, ParticleSystem::flag, ParticleTarget::flag, free_keyed_keys(), LOOP_PARTICLES, MEM_calloc_arrayN(), ParticleTarget::next, ParticleSimulationData::ob, ParticleTarget::ob, PARTICLE_P, ParticleSystem::particles, Object::particlesystem, ParticleSimulationData::psys, ParticleTarget::psys, psys_get_particle_state(), PSYS_KEYED, PSYS_KEYED_TIMING, PTARGET_VALID, ParticleSimulationData::scene, ParticleSystem::targets, ParticleKey::time, ParticleTarget::time, ParticleData::totkey, ParticleSystem::totkeyed, and ParticleSystem::totpart.
Referenced by particle_system_update().
|
static |
Definition at line 1710 of file particle_system.cc.
References SPHRangeData::data, SPHRangeData::h, SPHNeighbor::index, SPHRangeData::massfac, SPHRangeData::neighbors, SPHRangeData::npsys, SPHRangeData::pa, ParticleSystem::particles, SPHNeighbor::psys, ParticleData::size, SPH_NEIGHBORS, sqrtf, SPHRangeData::tot_neighbors, UNUSED_VARS, and SPHRangeData::use_size.
Referenced by psys_sph_init(), and sph_force_cb().
|
static |
Definition at line 1682 of file particle_system.cc.
References BLI_bvhtree_range_query(), BLI_rw_mutex_lock(), BLI_rw_mutex_unlock(), ParticleSettings::flag, i, ParticleSettings::mass, SPHRangeData::mass, SPHRangeData::massfac, SPHRangeData::npsys, ParticleSystem::part, PART_SIZEMASS, psys_bvhtree_rwlock, THREAD_LOCK_READ, SPHRangeData::tot_neighbors, tree, and SPHRangeData::use_size.
Referenced by psys_sph_density(), sph_force_cb(), sphclassical_calc_dens(), and sphclassical_force_cb().
|
static |
Definition at line 1777 of file particle_system.cc.
References BLI_buffer_append, SPHFluidSettings::buoyancy, ParticleKey::co, copy_v3_v3(), data, SPHRangeData::data, ParticleSpring::delete_flag, dot_v3v3(), SPHData::eh, ParticleSettings::flag, SPHFluidSettings::flag, ParticleSettings::fluid, ParticleSystem::fluid_springs, SPHData::gravity, SPHRangeData::h, SPHData::hfac, i, SPHNeighbor::index, madd_v3_v3fl(), madd_v3_v3v3fl(), ParticleSettings::mass, SPHData::mass, SPHRangeData::mass, SPHRangeData::neighbors, SPHData::new_springs, normalize_v3(), SPHData::pa, SPHRangeData::pa, ParticleSystem::part, PART_SIZEMASS, PART_TIME_AUTOSF, ParticleSpring::particle_index, ParticleSystem::particles, SPHData::pass, ParticleData::prev_state, SPHData::psys, SPHNeighbor::psys, SPHFluidSettings::radius, SPHFluidSettings::rest_density, ParticleSpring::rest_length, SPHFluidSettings::rest_length, ParticleData::size, SPH_CURRENT_REST_LENGTH, sph_density_accum_cb(), sph_evaluate_func(), SPH_FAC_DENSITY, SPH_FAC_RADIUS, SPH_FAC_REPULSION, SPH_FAC_REST_LENGTH, SPH_FAC_VISCOSITY, sph_particle_courant(), SPH_VISCOELASTIC_SPRINGS, SPHFluidSettings::spring_frames, SPHFluidSettings::spring_k, state, SPHFluidSettings::stiffness_k, SPHFluidSettings::stiffness_knear, sub_v3_v3v3(), ParticleData::time, ParticleKey::time, ParticleSettings::time_flag, SPHRangeData::tot_neighbors, ParticleKey::vel, SPHFluidSettings::viscosity_beta, and SPHFluidSettings::viscosity_omega.
Referenced by psys_sph_init().
|
static |
Definition at line 2186 of file particle_system.cc.
References copy_particle_key(), ParticleSettings::flag, SPHData::force_cb, integrate_particle(), ParticleSettings::mass, SPHData::mass, mul_v3_fl(), SPHData::pa, ParticleSystem::part, PART_SIZEMASS, SPHData::pass, ParticleData::prev_state, ParticleSimulationData::psys, psys_get_timestep(), ParticleData::size, ParticleData::state, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by dynamics_step_sph_classical_integrate_task_cb_ex(), and dynamics_step_sph_ddr_task_cb_ex().
|
static |
Definition at line 1751 of file particle_system.cc.
References add_v3_v3(), ParticleKey::co, copy_v3_v3(), SPHData::element_size, SPHData::flow, FLT_MAX, ParticleSettings::fluid, i, SPHNeighbor::index, len_v3(), mul_v3_v3fl(), SPHRangeData::neighbors, SPHRangeData::pa, ParticleSystem::part, ParticleSystem::particles, ParticleData::prev_state, SPHData::psys, SPHNeighbor::psys, SPHFluidSettings::radius, sub_v3_v3v3(), SPHRangeData::tot_neighbors, ParticleKey::vel, and zero_v3().
Referenced by sph_force_cb(), and sphclassical_force_cb().
|
static |
Definition at line 1559 of file particle_system.cc.
References ParticleSystem::alloc_fluidsprings, ParticleSystem::fluid_springs, MEM_calloc_arrayN(), MEM_reallocN, PSYS_FLUID_SPRINGS_INITIAL_SIZE, and ParticleSystem::tot_fluidsprings.
Referenced by psys_sph_flush_springs().
|
static |
Definition at line 1579 of file particle_system.cc.
References ParticleSystem::alloc_fluidsprings, ParticleSystem::fluid_springs, MEM_reallocN, PSYS_FLUID_SPRINGS_INITIAL_SIZE, and ParticleSystem::tot_fluidsprings.
Referenced by sph_springs_modify().
|
static |
Definition at line 1646 of file particle_system.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), ParticleSystem::fluid_springs, i, ParticleSpring::particle_index, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), and ParticleSystem::tot_fluidsprings.
Referenced by psys_sph_init().
|
static |
Definition at line 1595 of file particle_system.cc.
References ParticleKey::co, ParticleSpring::delete_flag, SPHFluidSettings::flag, ParticleSettings::fluid, ParticleSystem::fluid_springs, i, normalize_v3(), ParticleSystem::part, ParticleSpring::particle_index, ParticleSystem::particles, SPHFluidSettings::plasticity_constant, ParticleData::prev_state, ParticleSpring::rest_length, ParticleData::size, sph_spring_delete(), SPH_VISCOELASTIC_SPRINGS, SPHFluidSettings::spring_k, sub_v3_v3v3(), ParticleSystem::tot_fluidsprings, and SPHFluidSettings::yield_ratio.
Referenced by dynamics_step().
|
static |
Definition at line 2087 of file particle_system.cc.
References ParticleKey::co, data, SPHRangeData::data, SPHFluidSettings::flag, ParticleSettings::fluid, SPHRangeData::h, SPHData::hfac, SPHData::mass, SPHRangeData::mass, max_ff(), min_ff(), SPHRangeData::pa, ParticleSystem::part, SPHData::psys, SPHFluidSettings::radius, SPHFluidSettings::rest_density, ParticleSettings::size, sph_evaluate_func(), SPH_FAC_RADIUS, sphclassical_density_accum_cb(), ParticleData::sphdensity, and ParticleData::state.
Referenced by dynamics_step_sph_classical_calc_density_task_cb_ex().
|
static |
Definition at line 1912 of file particle_system.cc.
References ParticleKey::co, SPHRangeData::data, SPHRangeData::h, len_v3(), M_PI, ParticleSettings::mass, SPHRangeData::npsys, SPHRangeData::pa, ParticleSystem::part, ParticleSystem::particles, pow3f(), pow4f(), ParticleData::size, ParticleData::sphdensity, ParticleData::state, sub_v3_v3v3(), and SPHRangeData::use_size.
Referenced by psys_sph_init(), and sphclassical_calc_dens().
|
static |
Definition at line 1976 of file particle_system.cc.
References SPHFluidSettings::buoyancy, ParticleKey::co, dot_v3v3(), ParticleSettings::flag, SPHFluidSettings::flag, ParticleSettings::fluid, SPHData::gravity, SPHRangeData::h, SPHData::hfac, i, SPHNeighbor::index, M_PI, madd_v3_v3fl(), madd_v3_v3v3fl(), SPHData::mass, SPHRangeData::neighbors, normalize_v3(), SPHData::pa, SPHRangeData::pa, ParticleSystem::part, PART_SIZEMASS, PART_TIME_AUTOSF, ParticleSystem::particles, SPHData::pass, pow2f(), pow3f(), pow4f(), pow7f(), ParticleData::prev_state, SPHData::psys, SPHNeighbor::psys, SPHFluidSettings::radius, SPHFluidSettings::rest_density, ParticleData::size, sph_evaluate_func(), SPH_FAC_DENSITY, SPH_FAC_RADIUS, sph_particle_courant(), sphclassical_neighbor_accum_cb(), ParticleData::sphdensity, state, SPHFluidSettings::stiffness_k, sub_v3_v3v3(), ParticleSettings::time_flag, SPHRangeData::tot_neighbors, ParticleKey::vel, and SPHFluidSettings::viscosity_omega.
Referenced by psys_sph_init().
|
static |
Definition at line 1948 of file particle_system.cc.
References ParticleKey::co, SPHRangeData::h, SPHNeighbor::index, len_v3(), SPHRangeData::neighbors, SPHRangeData::npsys, ParticleSystem::particles, SPHNeighbor::psys, SPH_NEIGHBORS, ParticleData::state, sub_v3_v3v3(), and SPHRangeData::tot_neighbors.
Referenced by sphclassical_force_cb().
|
static |
Definition at line 3673 of file particle_system.cc.
References ParticleSystem::dt_frac, and TIMESTEP_EXPANSION_TOLERANCE.
Referenced by system_step().
|
static |
Calculates the next state for all particles of the system. In particles code most 'cfra - ending' are frames, 'time - ending' are 'cfra * timestep' (seconds).
Definition at line 4476 of file particle_system.cc.
References ParticleSystem::alloc_fluidsprings, BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), BKE_ptcache_id_reset(), BKE_ptcache_id_time(), BKE_ptcache_invalidate(), BKE_ptcache_read(), BKE_ptcache_validate(), BKE_ptcache_write(), cached_step(), ParticleSystem::cfra, CLAMP, ParticleSimulationData::courant_num, distribute_particles(), ParticleSystem::dt_frac, dynamics_step(), ELEM, emit_particles(), PointCache::endframe, eParticleSystemFlag_Pars, ParticleData::flag, ParticleSystemModifierData::flag, PointCache::flag, ParticleSystem::fluid_springs, free_unexisting_particles(), ParticleSettings::from, get_base_time_step(), ID_RECALC_PSYS_RESET, initialize_all_particles(), PointCache::last_exact, LOOP_PARTICLES, MEM_SAFE_FREE, MIN_TIMESTEP, ParticleSimulationData::ob, PARS_NO_DISP, ParticleSystem::part, PART_HAIR, PART_TIME_AUTOSF, PARTICLE_P, ParticleSystem::pointcache, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_clear_temp_pointcache(), psys_frand(), psys_get_current_display_percentage(), psys_get_pointcache_start_end(), psys_reset(), PSYS_RESET_CACHE_MISS, psys_sim_data_free(), psys_update_path_cache(), PTCACHE_BAKED, PTCACHE_BAKING, PTCACHE_CLEAR_AFTER, PTCACHE_OUTDATED, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED, PTCACHE_READ_OLD, PTCACHE_REDO_NEEDED, PTCACHE_RESET_OUTDATED, ParticleSystem::recalc, reset_all_particles(), ParticleSimulationData::scene, PointCache::simframe, ParticleSettings::sta, PointCache::startframe, sync_timestep(), ParticleSettings::time_flag, ParticleSystem::tot_fluidsprings, ParticleSystem::totpart, ParticleSettings::type, update_children(), and update_timestep().
Referenced by particle_system_update().
|
static |
Definition at line 107 of file particle_system.cc.
References PTCacheID::cache, ParticleSettings::distr, PointCache::flag, ParticleSettings::from, ParticleSettings::grid_res, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_VERT, ParticleSystem::pointcache, PTCACHE_EXTERNAL, ParticleSettings::totpart, PointCache::totpoint, and ParticleSystem::totunexist.
Referenced by emit_particles(), and psys_reset().
|
static |
Definition at line 4083 of file particle_system.cc.
References ParticleSettings::childtype, distribute_particles(), ParticleSystem::flag, ParticleSystem::part, PART_FROM_CHILD, PART_HAIR, ParticleSimulationData::psys, psys_free_children(), psys_get_tot_child(), PSYS_HAIR_DONE, ParticleSimulationData::scene, ParticleSystem::totchild, and ParticleSettings::type.
Referenced by system_step().
|
static |
Calculate the speed of the particle relative to the local scale of the simulation. This should be called once per particle during a simulation step, after the velocity has been updated. element_size defines the scale of the simulation, and is typically the distance to neighboring particles.
Definition at line 3626 of file particle_system.cc.
References BLI_spin_lock(), BLI_spin_unlock(), ParticleSimulationData::courant_num, SPHData::element_size, SPHData::flow, len_v3(), ParticleData::prev_state, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by dynamics_step_sph_classical_integrate_task_cb_ex(), and dynamics_step_sph_ddr_task_cb_ex().
|
static |
Definition at line 3645 of file particle_system.cc.
References ParticleSimulationData::courant_num, ParticleSettings::courant_target, ParticleSystem::dt_frac, get_base_time_step(), interpf(), MIN_TIMESTEP, ParticleSystem::part, and TIMESTEP_EXPANSION_FACTOR.
Referenced by system_step().
|
static |
Code for an adaptive time step based on the Courant-Friedrichs-Lewy condition.
Definition at line 3612 of file particle_system.cc.
Referenced by system_step(), and update_timestep().
|
static |
Definition at line 73 of file particle_system.cc.
Referenced by psys_update_particle_bvhtree(), and sph_evaluate_func().
|
static |
Tolerance of 1.5 means the last sub-frame neither favors growing nor shrinking (e.g if it were 1.3, the last sub-frame would tend to be too small).
Definition at line 3617 of file particle_system.cc.
Referenced by update_timestep().
|
static |
Definition at line 3618 of file particle_system.cc.
Referenced by sync_timestep().