Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

particle_system.c File Reference

#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.

Classes

struct  SPHNeighbor
struct  SPHRangeData
struct  SPHData
struct  EfData

Defines

#define PSYS_RND_DIST_SKIP   2
#define ONLY_WORKING_WITH_PA_VERTS   0
#define PSYS_FLUID_SPRINGS_INITIAL_SIZE   256
#define SPH_NEIGHBORS   512
#define COLLISION_MAX_COLLISIONS   10
#define COLLISION_MIN_RADIUS   0.001f
#define COLLISION_MIN_DISTANCE   0.0001f
#define COLLISION_ZERO   0.00001f
#define MIN_TIMESTEP   1.0f / 101.0f
#define TIMESTEP_EXPANSION_TOLERANCE   1.5f

Typedefs

typedef struct SPHNeighbor SPHNeighbor
typedef struct SPHRangeData SPHRangeData
typedef struct SPHData SPHData
typedef struct EfData EfData
typedef float(* NRDistanceFunc )(float *p, float radius, ParticleCollisionElement *pce, float *nor)

Functions

static int particles_are_dynamic (ParticleSystem *psys)
static int psys_get_current_display_percentage (ParticleSystem *psys)
static int tot_particles (ParticleSystem *psys, PTCacheID *pid)
void psys_reset (ParticleSystem *psys, int mode)
static void realloc_particles (ParticleSimulationData *sim, int new_totpart)
static int get_psys_child_number (struct Scene *scene, ParticleSystem *psys)
static int get_psys_tot_child (struct Scene *scene, ParticleSystem *psys)
static void alloc_child_particles (ParticleSystem *psys, int tot)
void psys_calc_dmcache (Object *ob, DerivedMesh *dm, ParticleSystem *psys)
static void distribute_simple_children (Scene *scene, Object *ob, DerivedMesh *finaldm, ParticleSystem *psys)
static void distribute_grid (DerivedMesh *dm, ParticleSystem *psys)
static void hammersley_create (float *out, int n, int seed, float amount)
static void init_mv_jit (float *jit, int num, int seed2, float amount)
static void psys_uv_to_w (float u, float v, int quad, float *w)
static int distribute_binary_search (float *sum, int n, float value)
static void distribute_threads_exec (ParticleThread *thread, ParticleData *pa, ChildParticle *cpa, int p)
static void * distribute_threads_exec_cb (void *data)
static int distribute_compare_orig_index (const void *p1, const void *p2)
static void distribute_invalid (Scene *scene, ParticleSystem *psys, int from)
static int distribute_threads_init_data (ParticleThread *threads, Scene *scene, DerivedMesh *finaldm, int from)
static void distribute_particles_on_dm (ParticleSimulationData *sim, int from)
static void distribute_particles_on_shape (ParticleSimulationData *sim, int UNUSED(from))
static void distribute_particles (ParticleSimulationData *sim, int from)
ParticleThreadpsys_threads_create (ParticleSimulationData *sim)
void psys_threads_free (ParticleThread *threads)
void initialize_particle (ParticleSimulationData *sim, ParticleData *pa, int p)
static void initialize_all_particles (ParticleSimulationData *sim)
void psys_get_birth_coordinates (ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra)
void reset_particle (ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
static void reset_all_particles (ParticleSimulationData *sim, float dtime, float cfra, int from)
ParticleSystempsys_get_target_system (Object *ob, ParticleTarget *pt)
void psys_count_keyed_targets (ParticleSimulationData *sim)
static void set_keyed_keys (ParticleSimulationData *sim)
void psys_make_temp_pointcache (Object *ob, ParticleSystem *psys)
static void psys_clear_temp_pointcache (ParticleSystem *psys)
void psys_get_pointcache_start_end (Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
static void psys_update_particle_bvhtree (ParticleSystem *psys, float cfra)
void psys_update_particle_tree (ParticleSystem *psys, float cfra)
static void psys_update_effectors (ParticleSimulationData *sim)
static void integrate_particle (ParticleSettings *part, ParticleData *pa, float dtime, float *external_acceleration, void(*force_func)(void *forcedata, ParticleKey *state, float *force, float *impulse), void *forcedata)
static ParticleSpringsph_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 EdgeHashsph_springhash_build (ParticleSystem *psys)
static void sph_density_accum_cb (void *userdata, int index, 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 *UNUSED(impulse))
static void sph_solver_init (ParticleSimulationData *sim, SPHData *sphdata)
static void sph_solver_finalise (SPHData *sphdata)
static void sph_integrate (ParticleSimulationData *sim, ParticleData *pa, float dfra, SPHData *sphdata)
static void basic_force_cb (void *efdata_v, ParticleKey *state, float *force, float *impulse)
static void basic_integrate (ParticleSimulationData *sim, int p, float dfra, float cfra)
static void basic_rotate (ParticleSettings *part, ParticleData *pa, float dfra, float timestep)
static float nr_signed_distance_to_plane (float *p, float radius, ParticleCollisionElement *pce, float *nor)
static float nr_distance_to_edge (float *p, float radius, ParticleCollisionElement *pce, float *UNUSED(nor))
static float nr_distance_to_vert (float *p, float radius, ParticleCollisionElement *pce, float *UNUSED(nor))
static void collision_interpolate_element (ParticleCollisionElement *pce, float t, float fac, ParticleCollision *col)
static void collision_point_velocity (ParticleCollisionElement *pce)
static float collision_point_distance_with_normal (float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *nor)
static void collision_point_on_surface (float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *co)
static float collision_newton_rhapson (ParticleCollision *col, float radius, ParticleCollisionElement *pce, NRDistanceFunc distance_func)
static int collision_sphere_to_tri (ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
static int collision_sphere_to_edges (ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
static int collision_sphere_to_verts (ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
void BKE_psys_collision_neartest_cb (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static int collision_detect (ParticleData *pa, ParticleCollision *col, BVHTreeRayHit *hit, ListBase *colliders)
static int collision_response (ParticleData *pa, ParticleCollision *col, BVHTreeRayHit *hit, int kill, int dynamic_rotation)
static void collision_fail (ParticleData *pa, ParticleCollision *col)
static void collision_check (ParticleSimulationData *sim, int p, float dfra, float cfra)
static void psys_update_path_cache (ParticleSimulationData *sim, float cfra)
static void do_hair_dynamics (ParticleSimulationData *sim)
static void hair_step (ParticleSimulationData *sim, float cfra)
static void save_hair (ParticleSimulationData *sim, float UNUSED(cfra))
void update_courant_num (ParticleSimulationData *sim, ParticleData *pa, float dtime, SPHData *sphdata)
float update_timestep (ParticleSystem *psys, ParticleSimulationData *sim, float t_frac)
static void dynamics_step (ParticleSimulationData *sim, float cfra)
static void update_children (ParticleSimulationData *sim)
static void cached_step (ParticleSimulationData *sim, float cfra)
static void particles_fluid_step (ParticleSimulationData *sim, int UNUSED(cfra))
static int emit_particles (ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
static void system_step (ParticleSimulationData *sim, float cfra)
static void psys_changed_type (ParticleSimulationData *sim)
void psys_check_boid_data (ParticleSystem *psys)
static void fluid_default_settings (ParticleSettings *part)
static void psys_prepare_physics (ParticleSimulationData *sim)
static int hair_needs_recalc (ParticleSystem *psys)
void particle_system_update (Scene *scene, Object *ob, ParticleSystem *psys)

Variables

static int * COMPARE_ORIG_INDEX = NULL

Detailed Description

Definition in file particle_system.c.


Define Documentation

#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 Documentation

typedef struct EfData EfData
typedef float(* NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor)

Definition at line 2709 of file particle_system.c.

typedef struct SPHData SPHData
typedef struct SPHNeighbor SPHNeighbor
typedef struct SPHRangeData SPHRangeData

Function Documentation

static void alloc_child_particles ( ParticleSystem psys,
int  tot 
) [static]
static void basic_force_cb ( void *  efdata_v,
ParticleKey state,
float *  force,
float *  impulse 
) [static]
static void basic_integrate ( ParticleSimulationData sim,
int  p,
float  dfra,
float  cfra 
) [static]
static void basic_rotate ( ParticleSettings part,
ParticleData pa,
float  dfra,
float  timestep 
) [static]
void BKE_psys_collision_neartest_cb ( void *  userdata,
int  index,
const BVHTreeRay ray,
BVHTreeRayHit hit 
)
static void cached_step ( ParticleSimulationData sim,
float  cfra 
) [static]
static void collision_check ( ParticleSimulationData sim,
int  p,
float  dfra,
float  cfra 
) [static]
static int collision_detect ( ParticleData pa,
ParticleCollision col,
BVHTreeRayHit hit,
ListBase colliders 
) [static]
static void collision_fail ( ParticleData pa,
ParticleCollision col 
) [static]
static void collision_interpolate_element ( ParticleCollisionElement pce,
float  t,
float  fac,
ParticleCollision col 
) [static]
static float collision_newton_rhapson ( ParticleCollision col,
float  radius,
ParticleCollisionElement pce,
NRDistanceFunc  distance_func 
) [static]
static float collision_point_distance_with_normal ( float  p[3],
ParticleCollisionElement pce,
float  fac,
ParticleCollision col,
float *  nor 
) [static]
static void collision_point_on_surface ( float  p[3],
ParticleCollisionElement pce,
float  fac,
ParticleCollision col,
float *  co 
) [static]
static void collision_point_velocity ( ParticleCollisionElement pce) [static]
static int collision_response ( ParticleData pa,
ParticleCollision col,
BVHTreeRayHit hit,
int  kill,
int  dynamic_rotation 
) [static]
static int collision_sphere_to_edges ( ParticleCollision col,
float  radius,
ParticleCollisionElement pce,
float *  t 
) [static]
static int collision_sphere_to_tri ( ParticleCollision col,
float  radius,
ParticleCollisionElement pce,
float *  t 
) [static]
static int collision_sphere_to_verts ( ParticleCollision col,
float  radius,
ParticleCollisionElement pce,
float *  t 
) [static]
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]
static void distribute_invalid ( Scene scene,
ParticleSystem psys,
int  from 
) [static]
static void distribute_particles ( ParticleSimulationData sim,
int  from 
) [static]
static void distribute_particles_on_dm ( ParticleSimulationData sim,
int  from 
) [static]
static void distribute_particles_on_shape ( ParticleSimulationData sim,
int   UNUSEDfrom 
) [static]
static void distribute_simple_children ( Scene scene,
Object ob,
DerivedMesh finaldm,
ParticleSystem psys 
) [static]
static void distribute_threads_exec ( ParticleThread thread,
ParticleData pa,
ChildParticle cpa,
int  p 
) [static]
static void* distribute_threads_exec_cb ( void *  data) [static]
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]
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]
static void fluid_default_settings ( ParticleSettings part) [static]
static int get_psys_child_number ( struct Scene scene,
ParticleSystem psys 
) [static]
static int get_psys_tot_child ( struct Scene scene,
ParticleSystem psys 
) [static]
static int hair_needs_recalc ( ParticleSystem psys) [static]
static void hair_step ( ParticleSimulationData sim,
float  cfra 
) [static]
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]
static void initialize_all_particles ( ParticleSimulationData sim) [static]
void initialize_particle ( ParticleSimulationData sim,
ParticleData pa,
int  p 
)
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]
static float nr_distance_to_edge ( float *  p,
float  radius,
ParticleCollisionElement pce,
float *  UNUSEDnor 
) [static]
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]
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]
static void particles_fluid_step ( ParticleSimulationData sim,
int   UNUSEDcfra 
) [static]
void psys_calc_dmcache ( Object ob,
DerivedMesh dm,
ParticleSystem psys 
)
static void psys_changed_type ( ParticleSimulationData sim) [static]
void psys_check_boid_data ( ParticleSystem psys)
static void psys_clear_temp_pointcache ( ParticleSystem psys) [static]
void psys_count_keyed_targets ( ParticleSimulationData sim)
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]
void psys_get_pointcache_start_end ( Scene scene,
ParticleSystem psys,
int *  sfra,
int *  efra 
)
ParticleSystem* psys_get_target_system ( Object ob,
ParticleTarget pt 
) [read]
void psys_make_temp_pointcache ( Object ob,
ParticleSystem psys 
)
static void psys_prepare_physics ( ParticleSimulationData sim) [static]
void psys_reset ( ParticleSystem psys,
int  mode 
)
ParticleThread* psys_threads_create ( ParticleSimulationData sim)
void psys_threads_free ( ParticleThread threads)
static void psys_update_effectors ( ParticleSimulationData sim) [static]
static void psys_update_particle_bvhtree ( ParticleSystem psys,
float  cfra 
) [static]
void psys_update_particle_tree ( ParticleSystem psys,
float  cfra 
)
static void psys_update_path_cache ( ParticleSimulationData sim,
float  cfra 
) [static]
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]
static void reset_all_particles ( ParticleSimulationData sim,
float  dtime,
float  cfra,
int  from 
) [static]
void reset_particle ( ParticleSimulationData sim,
ParticleData pa,
float  dtime,
float  cfra 
)
static void save_hair ( ParticleSimulationData sim,
float   UNUSEDcfra 
) [static]
static void set_keyed_keys ( ParticleSimulationData sim) [static]
static void sph_density_accum_cb ( void *  userdata,
int  index,
float  squared_dist 
) [static]
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]
static void sph_particle_courant ( SPHData sphdata,
SPHRangeData pfr 
) [static]
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]
static ParticleSpring* sph_spring_add ( ParticleSystem psys,
ParticleSpring spring 
) [static]
static void sph_spring_delete ( ParticleSystem psys,
int  j 
) [static]
static EdgeHash* sph_springhash_build ( ParticleSystem psys) [static]
static void sph_springs_modify ( ParticleSystem psys,
float  dtime 
) [static]
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]
static void update_children ( ParticleSimulationData sim) [static]
void update_courant_num ( ParticleSimulationData sim,
ParticleData pa,
float  dtime,
SPHData sphdata 
)
float update_timestep ( ParticleSystem psys,
ParticleSimulationData sim,
float  t_frac 
)

Variable Documentation

int* COMPARE_ORIG_INDEX = NULL [static]