Blender V2.61 - r43446
|
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_boid_types.h"
#include "DNA_particle_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "DNA_ipo_types.h"
#include "DNA_listBase.h"
#include "BLI_edgehash.h"
#include "BLI_rand.h"
#include "BLI_jitter.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
#include "BLI_kdopbvh.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
#include "BKE_main.h"
#include "BKE_animsys.h"
#include "BKE_boids.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_collision.h"
#include "BKE_displist.h"
#include "BKE_effect.h"
#include "BKE_particle.h"
#include "BKE_global.h"
#include "BKE_DerivedMesh.h"
#include "BKE_object.h"
#include "BKE_material.h"
#include "BKE_cloth.h"
#include "BKE_depsgraph.h"
#include "BKE_lattice.h"
#include "BKE_pointcache.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_scene.h"
#include "BKE_bvhutils.h"
#include "PIL_time.h"
#include "RE_shader_ext.h"
Go to the source code of this file.
Definition in file particle_system.c.
#define COLLISION_MAX_COLLISIONS 10 |
Definition at line 2705 of file particle_system.c.
Referenced by collision_check().
#define COLLISION_MIN_DISTANCE 0.0001f |
Definition at line 2707 of file particle_system.c.
Referenced by collision_response().
#define COLLISION_MIN_RADIUS 0.001f |
Definition at line 2706 of file particle_system.c.
Referenced by collision_check().
#define COLLISION_ZERO 0.00001f |
Definition at line 2708 of file particle_system.c.
Referenced by collision_newton_rhapson().
#define MIN_TIMESTEP 1.0f / 101.0f |
Definition at line 3661 of file particle_system.c.
Referenced by system_step(), and update_timestep().
#define ONLY_WORKING_WITH_PA_VERTS 0 |
Definition at line 747 of file particle_system.c.
#define PSYS_FLUID_SPRINGS_INITIAL_SIZE 256 |
Definition at line 2217 of file particle_system.c.
Referenced by sph_spring_add(), and sph_spring_delete().
#define PSYS_RND_DIST_SKIP 2 |
Definition at line 744 of file particle_system.c.
Referenced by distribute_threads_exec(), and distribute_threads_exec_cb().
#define SPH_NEIGHBORS 512 |
Definition at line 2308 of file particle_system.c.
Referenced by sph_density_accum_cb().
#define TIMESTEP_EXPANSION_TOLERANCE 1.5f |
Definition at line 3665 of file particle_system.c.
Referenced by update_timestep().
typedef float(* NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor) |
Definition at line 2709 of file particle_system.c.
typedef struct SPHNeighbor SPHNeighbor |
typedef struct SPHRangeData SPHRangeData |
static void alloc_child_particles | ( | ParticleSystem * | psys, |
int | tot | ||
) | [static] |
Definition at line 307 of file particle_system.c.
References ParticleSystem::child, ParticleSettings::childtype, MEM_callocN(), MEM_freeN(), NULL, ParticleSystem::part, and ParticleSystem::totchild.
Referenced by distribute_simple_children(), and distribute_threads_init_data().
static void basic_force_cb | ( | void * | efdata_v, |
ParticleKey * | state, | ||
float * | force, | ||
float * | impulse | ||
) | [static] |
Definition at line 2584 of file particle_system.c.
References BLI_frand(), ParticleSettings::brownfac, ParticleSimulationData::colliders, ParticleSettings::dragfac, EFF_WEIGHT_DO_HAIR, ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleTexture::field, EffectorWeights::flag, len_v3(), madd_v3_v3fl(), mul_v3_fl(), EfData::pa, ParticleSystem::part, PART_HAIR, pd_point_from_particle(), pdDoEffectors(), ParticleSimulationData::psys, EfData::ptex, EfData::sim, ParticleData::size, ParticleSettings::type, and ParticleKey::vel.
Referenced by basic_integrate().
static void basic_integrate | ( | ParticleSimulationData * | sim, |
int | p, | ||
float | dfra, | ||
float | cfra | ||
) | [static] |
Definition at line 2612 of file particle_system.c.
References ParticleKey::ave, basic_force_cb(), CLAMP(), ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, ParticleSettings::dampfac, 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(), NULL, p, 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(), ParticleKey::time, ParticleData::time, ParticleSettings::type, ParticleKey::vel, and zero_v3().
Referenced by dynamics_step().
static void basic_rotate | ( | ParticleSettings * | part, |
ParticleData * | pa, | ||
float | dfra, | ||
float | timestep | ||
) | [static] |
Definition at line 2664 of file particle_system.c.
References angle(), ParticleKey::ave, ParticleSettings::avefac, ParticleSettings::avemode, axis_angle_to_quat(), cross_v3_v3v3(), dot_v3v3(), ParticleSettings::flag, len_v3(), mul_qt_qtqt(), mul_v3_fl(), normalize_qt(), normalize_v3(), PART_AVE_SPIN, PART_ROT_DYN, ParticleData::prev_state, ParticleKey::rot, saacos(), ParticleData::state, and ParticleKey::vel.
Referenced by dynamics_step().
void BKE_psys_collision_neartest_cb | ( | void * | userdata, |
int | index, | ||
const BVHTreeRay * | ray, | ||
BVHTreeRayHit * | hit | ||
) |
Definition at line 3056 of file particle_system.c.
References MVert::co, collision_point_velocity(), collision_sphere_to_edges(), collision_sphere_to_tri(), collision_sphere_to_verts(), ParticleCollision::current, CollisionModifierData::current_v, BVHTreeRayHit::dist, ParticleCollision::hit, BVHTreeRayHit::index, ParticleCollisionElement::index, ParticleCollisionElement::inside, ParticleCollision::md, CollisionModifierData::mfaces, NULL, ParticleCollision::original_ray_length, ParticleCollision::pce, BVHTreeRay::radius, ParticleCollisionElement::tot, ParticleCollisionElement::v, MFace::v1, MFace::v2, MFace::v3, MFace::v4, ParticleCollisionElement::x, and CollisionModifierData::x.
static void cached_step | ( | ParticleSimulationData * | sim, |
float | cfra | ||
) | [static] |
Definition at line 3910 of file particle_system.c.
References ParticleData::alive, ParticleData::dietime, end_latt_deform(), ParticleData::flag, PointCache::flag, ParticleSettings::flag, ParticleSystem::lattice, LOOP_PARTICLES, NULL, 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_lattice(), psys_get_texture(), psys_update_effectors(), PTCACHE_EXTERNAL, ParticleSettings::randsize, reset_particle(), ParticleTexture::size, ParticleSettings::size, ParticleData::size, and ParticleData::time.
Referenced by system_step().
static void collision_check | ( | ParticleSimulationData * | sim, |
int | p, | ||
float | dfra, | ||
float | cfra | ||
) | [static] |
Definition at line 3345 of file particle_system.c.
References ParticleCollision::acc, ParticleData::boid, ParticleCollision::boid, BOID_ALLOW_LAND, ParticleCollision::boid_z, ParticleSettings::boids, ParticleSystem::cfra, ParticleCollision::cfra, ParticleKey::co, ParticleCollision::co1, ParticleCollision::co2, ParticleSimulationData::colliders, collision_detect(), collision_fail(), COLLISION_MAX_COLLISIONS, COLLISION_MIN_RADIUS, collision_response(), copy_v3_v3(), ParticleCollision::f, ParticleSettings::flag, BoidParticle::ground, ParticleCollision::inv_timestep, mul_v3_fl(), ParticleCollision::old_cfra, BoidSettings::options, p, ParticleSystem::part, PART_DIE_ON_COL, PART_PHYS_BOIDS, PART_ROT_DYN, PART_SIZE_DEFL, ParticleSystem::particles, ParticleSettings::phystype, ParticleData::prev_state, ParticleSimulationData::psys, psys_get_timestep(), ParticleCollision::radius, ParticleData::size, ParticleCollision::skip, ParticleData::state, sub_v3_v3v3(), ParticleCollision::total_time, ParticleCollision::ve1, ParticleCollision::ve2, and ParticleKey::vel.
Referenced by dynamics_step().
static int collision_detect | ( | ParticleData * | pa, |
ParticleCollision * | col, | ||
BVHTreeRayHit * | hit, | ||
ListBase * | colliders | ||
) | [static] |
Definition at line 3111 of file particle_system.c.
References BKE_psys_collision_neartest_cb(), BLI_bvhtree_ray_cast(), CollisionModifierData::bvhtree, ParticleCollision::cfra, ParticleCollision::co1, ParticleCollision::co2, ColliderCache::collmd, ParticleCollision::current, BVHTreeRayHit::dist, ParticleCollision::emitter, ParticleCollision::fac1, ParticleCollision::fac2, ListBase::first, BVHTreeRayHit::index, ParticleCollisionElement::inside, len_v3(), ParticleCollision::md, ColliderCache::next, NULL, ColliderCache::ob, ParticleCollision::old_cfra, ParticleCollision::original_ray_length, ParticleCollision::pce, ParticleCollision::radius, ParticleCollision::skip, sub_v3_v3v3(), ParticleData::time, CollisionModifierData::time_x, and CollisionModifierData::time_xnew.
Referenced by collision_check().
static void collision_fail | ( | ParticleData * | pa, |
ParticleCollision * | col | ||
) | [static] |
Definition at line 3324 of file particle_system.c.
References ParticleKey::co, ParticleCollision::co1, collision_point_on_surface(), copy_v3_v3(), ParticleCollision::inv_timestep, mul_v3_fl(), ParticleCollision::pce, ParticleData::state, ParticleCollisionElement::vel, and ParticleKey::vel.
Referenced by collision_check().
static void collision_interpolate_element | ( | ParticleCollisionElement * | pce, |
float | t, | ||
float | fac, | ||
ParticleCollision * | col | ||
) | [static] |
Definition at line 2753 of file particle_system.c.
References ParticleCollision::fac1, ParticleCollision::fac2, 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 float collision_newton_rhapson | ( | ParticleCollision * | col, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
NRDistanceFunc | distance_func | ||
) | [static] |
Definition at line 2861 of file particle_system.c.
References CLAMP(), ParticleCollision::co1, ParticleCollision::co2, collision_interpolate_element(), COLLISION_ZERO, copy_v3_v3(), ParticleCollision::f, 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 float collision_point_distance_with_normal | ( | float | p[3], |
ParticleCollisionElement * | pce, | ||
float | fac, | ||
ParticleCollision * | col, | ||
float * | nor | ||
) | [static] |
Definition at line 2787 of file particle_system.c.
References collision_interpolate_element(), dot_v3v3(), credits_svn_gen::e, madd_v3_v3v3fl(), normalize_v3(), nr_signed_distance_to_plane(), sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by collision_response().
static void collision_point_on_surface | ( | float | p[3], |
ParticleCollisionElement * | pce, | ||
float | fac, | ||
ParticleCollision * | col, | ||
float * | co | ||
) | [static] |
Definition at line 2813 of file particle_system.c.
References collision_interpolate_element(), cross_v3_v3v3(), dot_v3v3(), credits_svn_gen::e, ParticleCollisionElement::inv_nor, madd_v3_v3fl(), madd_v3_v3v3fl(), negate_v3(), normalize_v3(), ParticleCollision::radius, sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::uv, ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by collision_fail().
static void collision_point_velocity | ( | ParticleCollisionElement * | pce | ) | [static] |
Definition at line 2771 of file particle_system.c.
References copy_v3_v3(), madd_v3_v3fl(), sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::uv, ParticleCollisionElement::v, and ParticleCollisionElement::vel.
Referenced by BKE_psys_collision_neartest_cb().
static int collision_response | ( | ParticleData * | pa, |
ParticleCollision * | col, | ||
BVHTreeRayHit * | hit, | ||
int | kill, | ||
int | dynamic_rotation | ||
) | [static] |
Definition at line 3149 of file particle_system.c.
References ParticleCollision::acc, add_v3_v3(), add_v3_v3v3(), ParticleData::alive, ParticleKey::ave, BLI_frand(), ParticleData::boid, ParticleCollision::boid, ParticleCollision::boid_z, ParticleCollision::cfra, CLAMP(), ParticleKey::co, co, ParticleCollision::co1, ParticleCollision::co2, 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, ParticleCollision::f, PartDeflect::flag, ParticleCollision::hit, BVHTreeRayHit::index, interp_qt_qtqt(), interp_v3_v3v3(), ParticleCollision::inv_timestep, madd_v3_v3fl(), madd_v3_v3v3fl(), MAX2, BoidData::mode, mul_v3_fl(), mul_v3_v3fl(), negate_v3_v3(), ParticleCollisionElement::nor, ParticleCollision::old_cfra, ParticleCollision::original_ray_length, PARS_DYING, ParticleCollision::pce, Object::pd, PartDeflect::pdef_damp, PartDeflect::pdef_frict, PartDeflect::pdef_perm, PartDeflect::pdef_rdamp, PartDeflect::pdef_rfrict, PartDeflect::pdef_stickness, PDEFLE_KILL_PART, ParticleCollision::prev, ParticleCollision::prev_index, ParticleData::prev_state, ParticleCollision::radius, ParticleKey::rot, ParticleData::size, ParticleData::state, sub_v3_v3v3(), ParticleCollision::total_time, ParticleCollision::ve1, ParticleCollision::ve2, ParticleCollisionElement::vel, and ParticleKey::vel.
Referenced by collision_check().
static int collision_sphere_to_edges | ( | ParticleCollision * | col, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | t | ||
) | [static] |
Definition at line 2973 of file particle_system.c.
References collision_newton_rhapson(), dot_v3v3(), credits_svn_gen::e, i, ParticleCollisionElement::inside, madd_v3_v3v3fl(), ParticleCollisionElement::nor, normalize_v3(), nr_distance_to_edge(), NULL, ParticleCollisionElement::p, ParticleCollision::pce, sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::uv, ParticleCollisionElement::v, ParticleCollisionElement::x, ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by BKE_psys_collision_neartest_cb().
static int collision_sphere_to_tri | ( | ParticleCollision * | col, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | t | ||
) | [static] |
Definition at line 2930 of file particle_system.c.
References collision_newton_rhapson(), dot_v3v3(), ParticleCollisionElement::inside, ParticleCollisionElement::inv_nor, nr_signed_distance_to_plane(), ParticleCollisionElement::p, ParticleCollision::pce, sub_v3_v3v3(), ParticleCollisionElement::uv, ParticleCollisionElement::x0, ParticleCollisionElement::x1, and ParticleCollisionElement::x2.
Referenced by BKE_psys_collision_neartest_cb().
static int collision_sphere_to_verts | ( | ParticleCollision * | col, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | t | ||
) | [static] |
Definition at line 3020 of file particle_system.c.
References collision_newton_rhapson(), i, ParticleCollisionElement::inside, ParticleCollisionElement::nor, normalize_v3(), nr_distance_to_vert(), NULL, ParticleCollisionElement::p, ParticleCollision::pce, sub_v3_v3v3(), ParticleCollisionElement::tot, ParticleCollisionElement::v, ParticleCollisionElement::x, and ParticleCollisionElement::x0.
Referenced by BKE_psys_collision_neartest_cb().
static int distribute_binary_search | ( | float * | sum, |
int | n, | ||
float | value | ||
) | [static] |
Definition at line 718 of file particle_system.c.
Referenced by distribute_threads_init_data().
static int distribute_compare_orig_index | ( | const void * | p1, |
const void * | p2 | ||
) | [static] |
Definition at line 968 of file particle_system.c.
References COMPARE_ORIG_INDEX.
Referenced by distribute_threads_init_data().
static void distribute_grid | ( | DerivedMesh * | dm, |
ParticleSystem * | psys | ||
) | [static] |
Definition at line 437 of file particle_system.c.
References CD_MFACE, MVert::co, copy_v3_v3(), simple_enum_gen::d, ELEM, ParticleSettings::flag, ParticleData::flag, ParticleSettings::from, ParticleData::fuv, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVertDataArray, ParticleSettings::grid_rand, ParticleSettings::grid_res, ParticleData::hair_index, i, isect_axial_line_tri_v3(), max, MAX2, min, MIN2, NULL, p, PARS_UNEXIST, ParticleSystem::part, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, PART_GRID_HEXAGONAL, PART_GRID_INVERT, ParticleSystem::particles, PSYS_FRAND, size(), sub_v3_v3v3(), MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by distribute_threads_init_data().
static void distribute_invalid | ( | Scene * | scene, |
ParticleSystem * | psys, | ||
int | from | ||
) | [static] |
Definition at line 989 of file particle_system.c.
References ParticleSystem::child, ChildParticle::foffset, ChildParticle::fuv, get_psys_tot_child(), LOOP_PARTICLES, ChildParticle::num, p, ChildParticle::pa, ChildParticle::parent, PART_FROM_CHILD, and PARTICLE_P.
Referenced by distribute_particles(), distribute_particles_on_shape(), and distribute_threads_init_data().
static void distribute_particles | ( | ParticleSimulationData * | sim, |
int | from | ||
) | [static] |
Definition at line 1388 of file particle_system.c.
References distribute_invalid(), distribute_particles_on_dm(), distribute_particles_on_shape(), PARTICLE_PSMD, ParticleSimulationData::psys, and ParticleSimulationData::scene.
Referenced by particle_system_update(), psys_update_path_cache(), system_step(), and update_children().
static void distribute_particles_on_dm | ( | ParticleSimulationData * | sim, |
int | from | ||
) | [static] |
Definition at line 1344 of file particle_system.c.
References BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), ParticleThread::ctx, distribute_threads_exec_cb(), distribute_threads_init_data(), ParticleThreadContext::dm, ParticleSystemModifierData::dm, i, ParticleSimulationData::ob, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_calc_dmcache(), psys_threads_create(), psys_threads_free(), DerivedMesh::release, ParticleSimulationData::scene, threads, and ParticleThread::tot.
Referenced by distribute_particles().
static void distribute_particles_on_shape | ( | ParticleSimulationData * | sim, |
int | UNUSEDfrom | ||
) | [static] |
Definition at line 1381 of file particle_system.c.
References distribute_invalid(), ParticleSimulationData::psys, and ParticleSimulationData::scene.
Referenced by distribute_particles().
static void distribute_simple_children | ( | Scene * | scene, |
Object * | ob, | ||
DerivedMesh * | finaldm, | ||
ParticleSystem * | psys | ||
) | [static] |
Definition at line 408 of file particle_system.c.
References alloc_child_particles(), BLI_frand(), ParticleSystem::child, ChildParticle::fuv, get_psys_child_number(), get_psys_tot_child(), i, len_v3(), length(), NULL, ChildParticle::num, p, ChildParticle::parent, psys_calc_dmcache(), and ParticleSystem::totpart.
Referenced by distribute_threads_init_data().
static void distribute_threads_exec | ( | ParticleThread * | thread, |
ParticleData * | pa, | ||
ChildParticle * | cpa, | ||
int | p | ||
) | [static] |
Definition at line 748 of file particle_system.c.
References add_v3_v3v3(), BLI_frand(), BLI_kdtree_find_n_nearest(), CD_MFACE, CD_MVERT, ParticleThreadContext::cfrom, MVert::co, ParticleThread::ctx, Object::data, KDTreeNearest::dist, ParticleThreadContext::distr, ParticleThreadContext::dm, DMCACHE_ISCHILD, ChildParticle::foffset, ParticleData::foffset, ParticleThreadContext::from, ChildParticle::fuv, ParticleData::fuv, DerivedMesh::getFaceData, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getVertDataArray, i, KDTreeNearest::index, ParticleThreadContext::index, intersect(), isect_line_tri_v3(), ParticleThreadContext::jit, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, mul_v3_fl(), normalize_v3(), NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, p, ChildParticle::pa, ChildParticle::parent, PART_DISTR_JIT, PART_DISTR_RAND, PART_FROM_CHILD, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, pow(), psys_interpolate_face(), psys_particle_on_dm(), PSYS_RND_DIST_SKIP, psys_uv_to_w(), ParticleThread::rng, rng_getFloat(), rng_skip(), ParticleThreadContext::sim, transform_mesh_orco_verts(), ParticleThreadContext::tree, MFace::v1, MFace::v2, MFace::v3, MFace::v4, ChildParticle::w, and simple_enum_gen::w.
Referenced by distribute_threads_exec_cb().
static void* distribute_threads_exec_cb | ( | void * | data | ) | [static] |
Definition at line 934 of file particle_system.c.
References ParticleSystem::child, ParticleThread::ctx, distribute_threads_exec(), ParticleThreadContext::from, NULL, ParticleThread::num, p, PART_FROM_CHILD, ParticleSystem::particles, ParticleSimulationData::psys, PSYS_RND_DIST_SKIP, ParticleThread::rng, rng_skip(), ParticleThreadContext::sim, ParticleThreadContext::skip, ParticleThread::tot, ParticleSystem::totchild, and ParticleSystem::totpart.
Referenced by distribute_particles_on_dm().
static int distribute_threads_init_data | ( | ParticleThread * | threads, |
Scene * | scene, | ||
DerivedMesh * | finaldm, | ||
int | from | ||
) | [static] |
Definition at line 1017 of file particle_system.c.
References alloc_child_particles(), area_quad_v3(), area_tri_v3(), BLI_array_randomize(), BLI_frand(), BLI_kdtree_balance(), BLI_kdtree_insert(), BLI_kdtree_new(), BLI_srandom(), CD_ASSIGN, CD_MFACE, CD_MVERT, CD_ORCO, CD_ORIGINDEX, CDDM_from_mesh(), ParticleThreadContext::cfrom, ParticleSystem::child_seed, ParticleSettings::childtype, MVert::co, co, COMPARE_ORIG_INDEX, copy_v3_v3(), ParticleThread::ctx, Object::data, DerivedMesh::deformedOnly, ParticleThreadContext::distr, ParticleSettings::distr, distribute_binary_search(), distribute_compare_orig_index(), distribute_grid(), distribute_invalid(), distribute_simple_children(), ParticleThreadContext::dm, DM_add_vert_layer(), credits_svn_gen::e, ELEM, ELEM3, ParticleSettings::flag, ParticleData::foffset, ParticleThreadContext::from, ParticleSettings::from, ParticleData::fuv, G, G_DEBUG, get_mesh_orco_verts(), get_psys_tot_child(), DerivedMesh::getFaceData, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVertData, DerivedMesh::getVertDataArray, hammersley_create(), i, ParticleThreadContext::index, init_mv_jit(), ParticleThreadContext::jit, jit, ParticleSettings::jitfac, ParticleThreadContext::jitlevel, ParticleThreadContext::jitoff, ParticleThreadContext::maxweight, MEM_callocN(), MEM_freeN(), min, MIN2, NULL, ParticleData::num, ParticleData::num_dmcache, DerivedMesh::numFaceData, DerivedMesh::numVertData, ParticleSimulationData::ob, p, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_FACES, PART_DISTR_GRID, PART_DISTR_JIT, PART_DISTR_RAND, PART_EDISTR, PART_FROM_CHILD, PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, PART_HAIR, PART_SIMPLIFY_ENABLE, PART_TRAND, ParticleSystem::particles, ParticleSimulationData::psys, psys_cache_vgroup(), psys_particle_on_dm(), psys_render_simplify_distribution(), PSYS_VG_DENSITY, DerivedMesh::release, ParticleThread::rng, rng_new(), ParticleThreadContext::seams, ParticleSystem::seed, ParticleThreadContext::sim, ParticleSettings::simplify_flag, step(), ParticleThread::tot, ParticleSystem::totchild, totelem, ParticleSystem::totpart, ParticleThreadContext::totseam, ParticleThreadContext::tpars, transform_mesh_orco_verts(), ParticleThreadContext::tree, ParticleSettings::type, ParticleSettings::userjit, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm().
static void do_hair_dynamics | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 3467 of file particle_system.c.
References add_v3_v3v3(), CD_CALLOC, CD_MDEFORMVERT, CDDM_get_edges(), CDDM_get_verts(), CDDM_new(), ParticleSystem::clmd, CLOTH_COLLSETTINGS_FLAG_SELF, CLOTH_SIMSETTINGS_FLAG_GOAL, CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS, clothModifier_do(), MVert::co, HairKey::co, ClothModifierData::coll_parms, copy_v3_v3(), ParticleSystemModifierData::dm, DM_add_vert_layer(), DM_get_vert_data_layer(), MDeformVert::dw, ParticleSettings::effector_weights, ClothSimSettings::effector_weights, eModifierType_Cloth, ClothCollSettings::flags, ClothSimSettings::flags, ParticleSettings::from, DerivedMesh::getNumEdges, DerivedMesh::getNumVerts, ClothSimSettings::goalspring, ParticleData::hair, ParticleSystem::hair_in_dm, ParticleData::hair_index, ParticleSystem::hair_out_dm, LOOP_PARTICLES, MEM_callocN(), modifier_new(), mul_m4_v3(), NULL, ParticleSimulationData::ob, ParticleSystem::part, PARTICLE_P, ParticleSystem::particles, ClothModifierData::point_cache, ParticleSystem::pointcache, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_mat_hair_to_object(), DerivedMesh::release, ParticleSimulationData::scene, ClothModifierData::sim_parms, sub_v3_v3v3(), ParticleData::totkey, ParticleSystem::totpart, MDeformVert::totweight, MEdge::v1, MEdge::v2, ClothSimSettings::vgroup_mass, HairKey::weight, and MDeformWeight::weight.
Referenced by hair_step().
static void dynamics_step | ( | ParticleSimulationData * | sim, |
float | cfra | ||
) | [static] |
Definition at line 3705 of file particle_system.c.
References ParticleData::alive, basic_integrate(), basic_rotate(), BLI_findlink(), BLI_srandom(), boid_body(), boid_brain(), boids_precalc_rules(), BoidBrainData::cfra, ParticleSystem::cfra, ParticleSimulationData::colliders, collision_check(), copy_particle_key(), BoidBrainData::dfra, ParticleData::dietime, ELEM, ListBase::first, ParticleData::flag, ParticleSettings::flag, free_collider_cache(), get_collider_cache(), BoidBrainData::goal_ob, LOOP_DYNAMIC_PARTICLES, LOOP_EXISTING_PARTICLES, LOOP_SHOWN_PARTICLES, ParticleTarget::next, NULL, ParticleTarget::ob, ParticleSimulationData::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_TIME_AUTOSF, PART_UNBORN, PARTICLE_P, Object::particlesystem, ParticleSettings::phystype, ParticleSystem::pointcache, ParticleData::prev_state, ParticleTarget::psys, ParticleSimulationData::psys, PSYS_FRAND, psys_get_texture(), psys_get_timestep(), psys_update_effectors(), psys_update_particle_bvhtree(), psys_update_particle_tree(), ParticleSettings::randsize, reset_particle(), ParticleSimulationData::scene, ParticleSystem::seed, BoidBrainData::sim, ParticleTexture::size, ParticleSettings::size, ParticleData::size, sph_integrate(), sph_solver_finalise(), sph_solver_init(), sph_springs_modify(), ParticleData::state, PointCache::step, ParticleSystem::targets, ParticleKey::time, ParticleData::time, ParticleSettings::time_flag, BoidBrainData::timestep, ParticleSettings::type, and update_courant_num().
Referenced by system_step().
static int emit_particles | ( | ParticleSimulationData * | sim, |
PTCacheID * | pid, | ||
float | UNUSEDcfra | ||
) | [static] |
Definition at line 4062 of file particle_system.c.
References ParticleSimulationData::psys, realloc_particles(), tot_particles(), and ParticleSystem::totpart.
Referenced by particle_system_update(), and system_step().
static void fluid_default_settings | ( | ParticleSettings * | part | ) | [static] |
Definition at line 4290 of file particle_system.c.
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.
Referenced by psys_prepare_physics().
static int get_psys_child_number | ( | struct Scene * | scene, |
ParticleSystem * | psys | ||
) | [static] |
Definition at line 287 of file particle_system.c.
References ParticleSettings::child_nbr, ParticleSettings::childtype, get_render_child_particle_number(), ParticleSystem::part, Scene::r, ParticleSettings::ren_child_nbr, and ParticleSystem::renderdata.
Referenced by distribute_simple_children(), and get_psys_tot_child().
static int get_psys_tot_child | ( | struct Scene * | scene, |
ParticleSystem * | psys | ||
) | [static] |
Definition at line 302 of file particle_system.c.
References get_psys_child_number(), and ParticleSystem::totpart.
Referenced by distribute_invalid(), distribute_simple_children(), distribute_threads_init_data(), psys_update_path_cache(), and update_children().
static int hair_needs_recalc | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 4344 of file particle_system.c.
References ParticleSystem::edit, PTCacheEdit::edited, ParticleSettings::flag, ParticleSystem::flag, ParticleSystem::part, PART_HAIR_REGROW, PSYS_EDITED, PSYS_HAIR_DONE, PSYS_RECALC_RESET, and ParticleSystem::recalc.
Referenced by particle_system_update().
static void hair_step | ( | ParticleSimulationData * | sim, |
float | cfra | ||
) | [static] |
Definition at line 3577 of file particle_system.c.
References ParticleSystem::clmd, cloth_free_modifier(), ParticleSystemModifierData::dm, do_hair_dynamics(), ParticleSystem::flag, ParticleData::flag, LOOP_PARTICLES, 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_RECALC_RESET, psys_update_effectors(), psys_update_path_cache(), ParticleSettings::randsize, ParticleSystem::recalc, ParticleSettings::size, ParticleData::size, and ParticleSettings::type.
Referenced by particle_system_update().
static void hammersley_create | ( | float * | out, |
int | n, | ||
int | seed, | ||
float | amount | ||
) | [static] |
Definition at line 627 of file particle_system.c.
References offs, p, rng_free(), rng_getDouble(), and rng_new().
Referenced by distribute_threads_init_data().
static void init_mv_jit | ( | float * | jit, |
int | num, | ||
int | seed2, | ||
float | amount | ||
) | [static] |
Definition at line 650 of file particle_system.c.
References BLI_jitterate1(), BLI_jitterate2(), i, MEM_freeN(), MEM_mallocN(), rng_free(), rng_getFloat(), rng_new(), sqrt(), and sqrtf.
Referenced by distribute_threads_init_data().
static void initialize_all_particles | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 1508 of file particle_system.c.
References ParticleData::boid, initialize_particle(), LOOP_PARTICLES, MEM_callocN(), MEM_freeN(), NULL, p, PARS_UNEXIST, PARTICLE_P, ParticleSystem::particles, ParticleSimulationData::psys, ParticleSystem::totpart, and ParticleSystem::totunexist.
Referenced by particle_system_update(), and system_step().
void initialize_particle | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
int | p | ||
) |
Definition at line 1486 of file particle_system.c.
References ParticleSettings::end, ParticleTexture::exist, ParticleData::flag, ParticleData::hair_index, PAMAP_INIT, PARS_UNEXIST, ParticleSystem::part, PART_FLUID, PART_HAIR, ParticleSimulationData::psys, PSYS_FRAND, psys_get_texture(), ParticleSettings::sta, ParticleTexture::time, ParticleData::time, and ParticleSettings::type.
Referenced by brush_add(), and initialize_all_particles().
static void integrate_particle | ( | ParticleSettings * | part, |
ParticleData * | pa, | ||
float | dtime, | ||
float * | external_acceleration, | ||
void(*)(void *forcedata, ParticleKey *state, float *force, float *impulse) | force_func, | ||
void * | forcedata | ||
) | [static] |
Definition at line 2076 of file particle_system.c.
References add_v3_v3(), add_v3_v3v3(), co, 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, sub_v3_v3v3(), ParticleKey::time, ParticleKey::vel, and zero_v3().
Referenced by basic_integrate(), and sph_integrate().
static float nr_distance_to_edge | ( | float * | p, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | UNUSEDnor | ||
) | [static] |
Definition at line 2737 of file particle_system.c.
References cross_v3_v3v3(), fabsf, len_v3(), sub_v3_v3v3(), ParticleCollisionElement::x0, and ParticleCollisionElement::x1.
Referenced by collision_sphere_to_edges().
static float nr_distance_to_vert | ( | float * | p, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | UNUSEDnor | ||
) | [static] |
Definition at line 2749 of file particle_system.c.
References len_v3v3(), and ParticleCollisionElement::x0.
Referenced by collision_sphere_to_verts().
static float nr_signed_distance_to_plane | ( | float * | p, |
float | radius, | ||
ParticleCollisionElement * | pce, | ||
float * | nor | ||
) | [static] |
Definition at line 2710 of file particle_system.c.
References cross_v3_v3v3(), simple_enum_gen::d, dot_v3v3(), ParticleCollisionElement::inv_nor, negate_v3(), 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().
void particle_system_update | ( | Scene * | scene, |
Object * | ob, | ||
ParticleSystem * | psys | ||
) |
Definition at line 4356 of file particle_system.c.
References Object::adt, ParticleSettings::adt, ADT_RECALC_ANIM, ADT_RECALC_DRIVERS, BKE_animsys_evaluate_animdata(), BKE_curframe(), ParticleSystem::cfra, distribute_particles(), ParticleSystemModifierData::dm, ParticleSystem::edit, emit_particles(), eParticleSystemFlag_Pars, eParticleSystemFlag_psys_updated, ParticleData::flag, ParticleSystem::flag, ParticleSettings::flag, ParticleSystemModifierData::flag, ParticleDrawData::flag, ParticleSystem::free_edit, free_hair(), free_keyed_keys(), ParticleSettings::from, hair_needs_recalc(), hair_step(), ParticleSettings::hair_step, i, Object::id, ParticleSettings::id, ParticleSystem::imat, initialize_all_particles(), invert_m4_m4(), LOOP_EXISTING_PARTICLES, NULL, ParticleSimulationData::ob, Object::obmat, Object::parent, PARS_NO_DISP, ParticleSystem::part, PART_FLUID, PART_HAIR, PART_HAIR_REGROW, PART_PHYS_KEYED, PART_PHYS_NO, PARTICLE_DRAW_DATA_UPDATED, PARTICLE_P, particles_fluid_step(), ParticleSystem::pdd, ParticleSettings::phystype, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_changed_type(), psys_check_enabled(), psys_count_keyed_targets(), PSYS_EDITED, PSYS_FRAND, psys_free_path_cache(), psys_get_current_display_percentage(), psys_get_modifier(), PSYS_HAIR_DONE, psys_prepare_physics(), PSYS_RECALC_RESET, PSYS_RECALC_TYPE, psys_reset(), PSYS_RESET_ALL, psys_update_path_cache(), ParticleSettings::randsize, ParticleSystem::recalc, ParticleSystem::renderdata, reset_particle(), save_hair(), ParticleSimulationData::scene, set_keyed_keys(), ParticleSettings::size, ParticleData::size, system_step(), ParticleSettings::totpart, ParticleSystem::totpart, ParticleSystem::totunexist, ParticleSettings::type, and where_is_object_time().
Referenced by deformVerts(), and object_handle_update().
static int particles_are_dynamic | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 114 of file particle_system.c.
References ELEM3, 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 void particles_fluid_step | ( | ParticleSimulationData * | sim, |
int | UNUSEDcfra | ||
) | [static] |
Definition at line 3955 of file particle_system.c.
References ParticleData::alive, ParticleKey::ave, BLI_join_dirfile(), BLI_path_abs(), BLI_path_frame(), BLI_snprintf(), RenderData::cfra, ParticleKey::co, ParticleData::dietime, ParticleSettings::disp, RenderData::efra, eModifierType_Fluidsim, ParticleSettings::end, FluidsimModifierData::fss, G, ParticleData::lifetime, ParticleSettings::lifetime, MEM_freeN(), modifier_path_relbase(), modifiers_findByType(), NULL, ParticleSimulationData::ob, OB_FLUIDSIM_SURF_PARTICLES_FNAME, p, PARS_ALIVE, ParticleSystem::part, ParticleSystem::particles, ParticleSimulationData::psys, Scene::r, realloc_particles(), ParticleKey::rot, ParticleSimulationData::scene, ParticleData::size, ParticleSettings::sta, ParticleData::state, FluidsimSettings::surfdataPath, ParticleData::time, ParticleSettings::totpart, ParticleSystem::totpart, FluidsimSettings::typeFlags, and ParticleKey::vel.
Referenced by particle_system_update().
void psys_calc_dmcache | ( | Object * | ob, |
DerivedMesh * | dm, | ||
ParticleSystem * | psys | ||
) |
Definition at line 332 of file particle_system.c.
References CD_ORIGINDEX, Object::data, DerivedMesh::deformedOnly, ParticleSettings::from, GET_INT_FROM_POINTER, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVertDataArray, i, LinkNode::link, LOOP_PARTICLES, MEM_callocN(), MEM_freeN(), LinkNode::next, NULL, ParticleSystem::part, PART_FROM_VERT, PARTICLE_P, psys_particle_dm_face_lookup(), SET_INT_IN_POINTER, totelem, Mesh::totface, and Mesh::totvert.
Referenced by distribute_particles_on_dm(), distribute_simple_children(), hair_step(), and psys_render_restore().
static void psys_changed_type | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 4231 of file particle_system.c.
References BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), CLAMP(), ParticleSettings::distr, ParticleSettings::draw_as, ELEM3, ELEM4, ParticleSettings::end, ParticleSystem::flag, free_hair(), ParticleSettings::lifetime, MAX2, ParticleSimulationData::ob, 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, ParticleSimulationData::psys, PSYS_KEYED, psys_reset(), PSYS_RESET_ALL, PTCACHE_CLEAR_ALL, ParticleSettings::ren_as, and ParticleSettings::type.
Referenced by particle_system_update().
void psys_check_boid_data | ( | ParticleSystem * | psys | ) |
Definition at line 4265 of file particle_system.c.
References ParticleData::boid, LOOP_PARTICLES, MEM_callocN(), MEM_freeN(), NULL, 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 void psys_clear_temp_pointcache | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 1996 of file particle_system.c.
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 | ( | ParticleSimulationData * | sim | ) |
Definition at line 1887 of file particle_system.c.
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 draw_new_particle_system(), particle_system_update(), and render_new_particle_system().
void psys_get_birth_coordinates | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
ParticleKey * | state, | ||
float | dtime, | ||
float | cfra | ||
) |
Definition at line 1561 of file particle_system.c.
References ParticleKey::ave, ParticleSettings::avefac, ParticleSettings::avemode, axis_angle_to_quat(), ParticleData::boid, ParticleKey::co, copy_qt_qt(), copy_v3_v3(), cosf, cross_v3_v3v3(), dot_v3v3(), fabsf, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, interp_qt_qtqt(), ParticleTexture::ivel, M_PI, madd_v3_v3fl(), mat3_to_quat_is_ok(), mat4_to_quat(), mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_qtqt(), mul_v3_fl(), mul_v3_v3fl(), negate_v3(), negate_v3_v3(), 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, Object::obmat, p, PAMAP_IVEL, ParticleSystem::part, PART_AVE_RAND, PART_AVE_SPIN, PART_PHYS_BOIDS, PART_ROT_GLOB_X, PART_ROT_GLOB_Y, PART_ROT_GLOB_Z, PART_ROT_NOR, 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(), ParticleSettings::randfac, ParticleSettings::randphasefac, ParticleSettings::randrotfac, ParticleKey::rot, rot, ParticleSettings::rotmode, sinf, ParticleData::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().
static int psys_get_current_display_percentage | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 125 of file particle_system.c.
References ParticleSettings::child_nbr, ParticleSettings::childtype, ParticleSettings::disp, PointCache::flag, ParticleSystem::part, particles_are_dynamic(), ParticleSystem::pointcache, PTCACHE_BAKING, and ParticleSystem::renderdata.
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 2001 of file particle_system.c.
References RenderData::efra, ParticleSettings::end, ParticleSettings::lifetime, MAX2, MIN2, ParticleSystem::part, Scene::r, and ParticleSettings::sta.
Referenced by BKE_ptcache_bake(), and system_step().
ParticleSystem* psys_get_target_system | ( | Object * | ob, |
ParticleTarget * | pt | ||
) | [read] |
Definition at line 1867 of file particle_system.c.
References BLI_findlink(), ParticleTarget::flag, NULL, ParticleTarget::ob, Object::particlesystem, ParticleTarget::psys, and PTARGET_VALID.
Referenced by psys_count_keyed_targets(), rule_avoid_collision(), rule_fight(), rule_separate(), and sph_solver_init().
void psys_make_temp_pointcache | ( | Object * | ob, |
ParticleSystem * | psys | ||
) |
Definition at line 1984 of file particle_system.c.
References BKE_ptcache_disk_to_mem(), BKE_ptcache_id_from_particles(), ListBase::first, PointCache::flag, PointCache::mem_cache, NULL, ParticleSystem::pointcache, and PTCACHE_DISK_CACHE.
Referenced by draw_new_particle_system(), and render_new_particle_system().
static void psys_prepare_physics | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 4308 of file particle_system.c.
References BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), BLI_addtail(), boid_default_settings(), boid_new_rule(), boid_new_state(), BOIDRULE_CURRENT, ParticleSettings::boids, BOIDSTATE_CURRENT, eBoidRuleType_Flock, eBoidRuleType_Separate, ELEM, ListBase::first, BoidState::flag, ParticleSystem::flag, ParticleSettings::fluid, fluid_default_settings(), free_keyed_keys(), MEM_callocN(), NULL, 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, PTCACHE_CLEAR_ALL, BoidState::rules, state, and BoidSettings::states.
Referenced by particle_system_update().
void psys_reset | ( | ParticleSystem * | psys, |
int | mode | ||
) |
Definition at line 147 of file particle_system.c.
References ParticleSystem::alloc_fluidsprings, BKE_ptcache_invalidate(), ParticleSystem::child, ParticleSystem::edit, ELEM, ParticleSystem::flag, ParticleSystem::fluid_springs, ParticleSystem::free_edit, LOOP_PARTICLES, MEM_freeN(), NULL, 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().
ParticleThread* psys_threads_create | ( | ParticleSimulationData * | sim | ) |
Definition at line 1410 of file particle_system.c.
References BLI_system_thread_count(), ParticleThread::ctx, ParticleSystemModifierData::dm, ParticleThreadContext::dm, give_current_material(), i, ParticleThreadContext::ma, MEM_callocN(), RenderData::mode, ParticleThread::num, ParticleSimulationData::ob, ParticleSettings::omat, ParticleSystem::part, ParticleSimulationData::psmd, ParticleSimulationData::psys, Scene::r, R_FIXED_THREADS, ParticleSimulationData::scene, ParticleThreadContext::sim, RenderData::threads, threads, and ParticleThread::tot.
Referenced by distribute_particles_on_dm(), and psys_cache_child_paths().
void psys_threads_free | ( | ParticleThread * | threads | ) |
Definition at line 1439 of file particle_system.c.
References BLI_kdtree_free(), ParticleThread::ctx, end_latt_deform(), i, ParticleThreadContext::index, ParticleThreadContext::jit, ParticleThreadContext::jitoff, ParticleSystem::lattice, MEM_freeN(), NULL, ParticleSimulationData::psys, rng_free(), ParticleThreadContext::seams, ParticleThreadContext::sim, ParticleThreadContext::skip, ParticleThread::tot, ParticleThreadContext::tree, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, ParticleThreadContext::vg_roughe, and ParticleThreadContext::weight.
Referenced by distribute_particles_on_dm(), and psys_cache_child_paths().
static void psys_update_effectors | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 2069 of file particle_system.c.
References ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleSimulationData::ob, ParticleSystem::part, pdEndEffectors(), pdInitEffectors(), precalc_guides(), ParticleSimulationData::psys, and ParticleSimulationData::scene.
Referenced by cached_step(), dynamics_step(), and hair_step().
static void psys_update_particle_bvhtree | ( | ParticleSystem * | psys, |
float | cfra | ||
) | [static] |
Definition at line 2012 of file particle_system.c.
References BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), ParticleSystem::bvhtree, ParticleSystem::bvhtree_frame, LOOP_SHOWN_PARTICLES, p, PARS_ALIVE, and PARTICLE_P.
Referenced by dynamics_step().
void psys_update_particle_tree | ( | ParticleSystem * | psys, |
float | cfra | ||
) |
Definition at line 2040 of file particle_system.c.
References BLI_kdtree_balance(), BLI_kdtree_free(), BLI_kdtree_insert(), BLI_kdtree_new(), LOOP_SHOWN_PARTICLES, NULL, p, PARS_ALIVE, PARTICLE_P, ParticleSystem::totpart, ParticleSystem::tree, and ParticleSystem::tree_frame.
Referenced by dynamics_step(), and precalculate_effector().
static void psys_update_path_cache | ( | ParticleSimulationData * | sim, |
float | cfra | ||
) | [static] |
Definition at line 3402 of file particle_system.c.
References ParticleSettings::childtype, distribute_particles(), ParticleSettings::draw_as, ELEM, ParticleEditSettings::flag, PointCache::flag, ParticleSystem::flag, get_psys_tot_child(), Object::mode, NULL, 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_HAIR_DONE, PSYS_HAIR_DYNAMICS, psys_in_edit_mode(), PSYS_KEYED, PSYS_RECALC_CHILD, PSYS_RECALC_RESET, PSYS_VG_DENSITY, PTCACHE_BAKED, PTCACHE_BAKING, realloc_particles(), ParticleSystem::recalc, ParticleSettings::ren_as, ParticleSystem::renderdata, ParticleSimulationData::scene, Scene::toolsettings, ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, and ParticleSystem::vgroup.
Referenced by hair_step(), particle_system_update(), and system_step().
static void psys_uv_to_w | ( | float | u, |
float | v, | ||
int | quad, | ||
float * | w | ||
) | [static] |
Definition at line 688 of file particle_system.c.
References co, and interp_weights_poly_v3().
Referenced by distribute_threads_exec().
static void realloc_particles | ( | ParticleSimulationData * | sim, |
int | new_totpart | ||
) | [static] |
Definition at line 197 of file particle_system.c.
References ParticleData::boid, ParticleSystem::child, ParticleSettings::distr, ParticleSystem::edit, ParticleSystem::free_edit, ParticleSettings::from, ParticleSettings::grid_res, ParticleData::keys, LOOP_PARTICLES, MEM_callocN(), MEM_freeN(), MIN2, NULL, p, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_VERT, PART_PHYS_BOIDS, PARTICLE_P, ParticleSystem::particles, ParticleSettings::phystype, ParticleSimulationData::psys, psys_free_pdd(), ParticleSystem::totchild, ParticleSystem::totpart, and ParticleSettings::totpart.
Referenced by emit_particles(), particles_fluid_step(), and psys_update_path_cache().
static void reset_all_particles | ( | ParticleSimulationData * | sim, |
float | dtime, | ||
float | cfra, | ||
int | from | ||
) | [static] |
Definition at line 1856 of file particle_system.c.
References p, ParticleSystem::particles, ParticleSimulationData::psys, reset_particle(), and ParticleSystem::totpart.
Referenced by system_step().
void reset_particle | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
float | dtime, | ||
float | cfra | ||
) |
Definition at line 1787 of file particle_system.c.
References BoidData::acc, Object::adt, ADT_RECALC_ANIM, ParticleData::alive, BKE_animsys_evaluate_animdata(), ParticleData::boid, ParticleSettings::boids, ParticleSystem::cfra, BoidParticle::data, ParticleData::dietime, eBoidMode_InAir, ListBase::first, PointCache::flag, PhysicsSettings::flag, PhysicsSettings::gravity, BoidParticle::gravity, BoidSettings::health, BoidData::health, Object::id, ParticleTexture::life, ParticleSettings::lifetime, ParticleData::lifetime, PointCache::mem_cache, MIN2, BoidData::mode, ParticleSimulationData::ob, p, PAMAP_LIFE, Object::parent, 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_coordinates(), psys_get_dietime_from_cache(), psys_get_texture(), PTCACHE_BAKED, ParticleSettings::randlife, ParticleSimulationData::scene, ParticleData::state, BoidData::state_id, BoidSettings::states, ParticleKey::time, ParticleData::time, ParticleSettings::type, and where_is_object_time().
Referenced by brush_add(), cached_step(), dynamics_step(), particle_system_update(), and reset_all_particles().
static void save_hair | ( | ParticleSimulationData * | sim, |
float | UNUSEDcfra | ||
) | [static] |
Definition at line 3614 of file particle_system.c.
References ParticleKey::co, HairKey::co, copy_v3_v3(), ParticleSystemModifierData::dm, ParticleData::hair, ParticleSettings::hair_step, Object::imat, invert_m4_m4(), ParticleSystem::lattice, LOOP_PARTICLES, MEM_callocN(), mul_m4_v3(), NULL, ParticleSimulationData::ob, Object::obmat, ParticleSystem::part, PARTICLE_P, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_get_lattice(), psys_vec_rot_to_face(), MakeCursor::root, ParticleData::state, sub_v3_v3(), ParticleKey::time, HairKey::time, ParticleData::totkey, ParticleSystem::totpart, and HairKey::weight.
Referenced by particle_system_update().
static void set_keyed_keys | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 1910 of file particle_system.c.
References BLI_findlink(), copy_particle_key(), ParticleTarget::duration, ListBase::first, ParticleTarget::flag, ParticleSystem::flag, free_keyed_keys(), LOOP_PARTICLES, MEM_callocN(), ParticleTarget::next, ParticleTarget::ob, ParticleSimulationData::ob, p, PARTICLE_P, ParticleSystem::particles, Object::particlesystem, ParticleTarget::psys, ParticleSimulationData::psys, psys_get_particle_state(), PSYS_KEYED, PSYS_KEYED_TIMING, PTARGET_VALID, ParticleSimulationData::scene, ParticleSystem::targets, ParticleTarget::time, ParticleKey::time, ParticleData::totkey, ParticleSystem::totkeyed, and ParticleSystem::totpart.
Referenced by particle_system_update().
static void sph_density_accum_cb | ( | void * | userdata, |
int | index, | ||
float | squared_dist | ||
) | [static] |
Definition at line 2345 of file particle_system.c.
References SPHRangeData::density, SPHRangeData::h, SPHNeighbor::index, SPHRangeData::massfac, SPHRangeData::near_density, SPHRangeData::neighbors, SPHRangeData::npsys, SPHRangeData::pa, ParticleSystem::particles, SPHNeighbor::psys, ParticleData::size, SPH_NEIGHBORS, sqrtf, SPHRangeData::tot_neighbors, and SPHRangeData::use_size.
Referenced by sph_solver_init().
static void sph_force_cb | ( | void * | sphdata_v, |
ParticleKey * | state, | ||
float * | force, | ||
float * | UNUSEDimpulse | ||
) | [static] |
Definition at line 2403 of file particle_system.c.
References BLI_bvhtree_range_query(), BLI_edgehash_lookup(), SPHFluidSettings::buoyancy, ParticleKey::co, co, copy_v3_v3(), ParticleSpring::delete_flag, SPHRangeData::density, SPHData::density_cb, dot_v3v3(), SPHData::eh, ParticleSettings::flag, SPHFluidSettings::flag, ParticleSettings::fluid, GET_INT_FROM_POINTER, SPHData::gravity, SPHRangeData::h, i, SPHNeighbor::index, madd_v3_v3fl(), madd_v3_v3v3fl(), ParticleSettings::mass, SPHData::mass, SPHRangeData::massfac, SPHRangeData::near_density, SPHRangeData::neighbors, normalize_v3(), SPHRangeData::npsys, NULL, SPHRangeData::pa, SPHData::pa, ParticleSystem::part, PART_SIZEMASS, PART_TIME_AUTOSF, ParticleSpring::particle_index, ParticleSystem::particles, SPHData::pass, ParticleData::prev_state, SPHNeighbor::psys, SPHData::psys, SPHFluidSettings::radius, SPHFluidSettings::rest_density, ParticleSpring::rest_length, SPHFluidSettings::rest_length, ParticleData::size, SPH_CURRENT_REST_LENGTH, SPH_FAC_DENSITY, SPH_FAC_RADIUS, SPH_FAC_REPULSION, SPH_FAC_REST_LENGTH, SPH_FAC_VISCOSITY, sph_particle_courant(), sph_spring_add(), SPH_VISCOELASTIC_SPRINGS, SPHFluidSettings::spring_frames, SPHFluidSettings::spring_k, SPHFluidSettings::stiffness_k, SPHFluidSettings::stiffness_knear, sub_v3_v3v3(), ParticleData::time, ParticleKey::time, SPHRangeData::tot_neighbors, SPHRangeData::use_size, ParticleKey::vel, SPHFluidSettings::viscosity_beta, and SPHFluidSettings::viscosity_omega.
Referenced by sph_solver_init().
static void sph_integrate | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
float | dfra, | ||
SPHData * | sphdata | ||
) | [static] |
Definition at line 2553 of file particle_system.c.
References copy_particle_key(), ParticleSettings::flag, SPHData::force_cb, integrate_particle(), SPHData::mass, ParticleSettings::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().
static void sph_particle_courant | ( | SPHData * | sphdata, |
SPHRangeData * | pfr | ||
) | [static] |
Definition at line 2380 of file particle_system.c.
References add_v3_v3(), ParticleKey::co, SPHData::element_size, SPHData::flow, ParticleSettings::fluid, i, SPHNeighbor::index, len_v3(), MAXFLOAT, 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, VECCOPY, and ParticleKey::vel.
Referenced by sph_force_cb().
static void sph_solver_finalise | ( | SPHData * | sphdata | ) | [static] |
Definition at line 2547 of file particle_system.c.
References BLI_edgehash_free(), SPHData::eh, and NULL.
Referenced by dynamics_step().
static void sph_solver_init | ( | ParticleSimulationData * | sim, |
SPHData * | sphdata | ||
) | [static] |
Definition at line 2524 of file particle_system.c.
References SPHData::density_cb, SPHData::eh, ListBase::first, SPHData::force_cb, PhysicsSettings::gravity, SPHData::gravity, i, SPHData::mass, ParticleTarget::next, NULL, ParticleSimulationData::ob, SPHData::pa, Scene::physics_settings, ParticleSimulationData::psys, SPHData::psys, psys_get_target_system(), psys_uses_gravity(), ParticleSimulationData::scene, sph_density_accum_cb(), sph_force_cb(), sph_springhash_build(), and ParticleSystem::targets.
Referenced by dynamics_step().
static ParticleSpring* sph_spring_add | ( | ParticleSystem * | psys, |
ParticleSpring * | spring | ||
) | [static] |
Definition at line 2218 of file particle_system.c.
References ParticleSystem::alloc_fluidsprings, ParticleSystem::fluid_springs, MEM_callocN(), MEM_reallocN(), NULL, PSYS_FLUID_SPRINGS_INITIAL_SIZE, and ParticleSystem::tot_fluidsprings.
Referenced by sph_force_cb().
static void sph_spring_delete | ( | ParticleSystem * | psys, |
int | j | ||
) | [static] |
Definition at line 2236 of file particle_system.c.
References ParticleSystem::alloc_fluidsprings, ParticleSystem::fluid_springs, MEM_reallocN(), PSYS_FLUID_SPRINGS_INITIAL_SIZE, and ParticleSystem::tot_fluidsprings.
Referenced by sph_springs_modify().
static EdgeHash* sph_springhash_build | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 2294 of file particle_system.c.
References BLI_edgehash_insert(), BLI_edgehash_new(), ParticleSystem::fluid_springs, i, NULL, ParticleSpring::particle_index, and SET_INT_IN_POINTER.
Referenced by sph_solver_init().
static void sph_springs_modify | ( | ParticleSystem * | psys, |
float | dtime | ||
) | [static] |
Definition at line 2248 of file particle_system.c.
References ParticleKey::co, simple_enum_gen::d, 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 void system_step | ( | ParticleSimulationData * | sim, |
float | cfra | ||
) | [static] |
Definition at line 4080 of file particle_system.c.
References ParticleSystem::alloc_fluidsprings, BKE_ptcache_get_continue_physics(), 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(), end_latt_deform(), PointCache::endframe, eParticleSystemFlag_Pars, ParticleData::flag, ParticleSystemModifierData::flag, PointCache::flag, ParticleSystem::fluid_springs, ParticleSettings::from, initialize_all_particles(), PointCache::last_exact, ParticleSystem::lattice, LOOP_PARTICLES, MEM_freeN(), MIN_TIMESTEP, NULL, 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_RECALC_RESET, psys_reset(), PSYS_RESET_CACHE_MISS, 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, ParticleSettings::subframes, ParticleSettings::time_flag, ParticleSystem::tot_fluidsprings, ParticleSystem::totpart, ParticleSettings::type, update_children(), and update_timestep().
Referenced by particle_system_update().
static int tot_particles | ( | ParticleSystem * | psys, |
PTCacheID * | pid | ||
) | [static] |
Definition at line 137 of file particle_system.c.
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 void update_children | ( | ParticleSimulationData * | sim | ) | [static] |
Definition at line 3894 of file particle_system.c.
References ParticleSettings::childtype, distribute_particles(), ParticleSystem::flag, get_psys_tot_child(), ParticleSystem::part, PART_FROM_CHILD, PART_HAIR, ParticleSimulationData::psys, psys_free_children(), PSYS_HAIR_DONE, ParticleSimulationData::scene, ParticleSystem::totchild, and ParticleSettings::type.
Referenced by system_step().
void update_courant_num | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
float | dtime, | ||
SPHData * | sphdata | ||
) |
Definition at line 3671 of file particle_system.c.
References ParticleSimulationData::courant_num, SPHData::element_size, SPHData::flow, len_v3(), ParticleData::prev_state, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by dynamics_step().
float update_timestep | ( | ParticleSystem * | psys, |
ParticleSimulationData * | sim, | ||
float | t_frac | ||
) |
Definition at line 3683 of file particle_system.c.
References CLAMP(), ParticleSimulationData::courant_num, ParticleSettings::courant_target, ParticleSystem::dt_frac, MIN_TIMESTEP, ParticleSystem::part, and TIMESTEP_EXPANSION_TOLERANCE.
Referenced by system_step().
int* COMPARE_ORIG_INDEX = NULL [static] |
Definition at line 967 of file particle_system.c.
Referenced by distribute_compare_orig_index(), and distribute_threads_init_data().