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

particle.c File Reference

#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_particle_types.h"
#include "DNA_smoke_types.h"
#include "DNA_scene_types.h"
#include "DNA_dynamicpaint_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_kdtree.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
#include "BLI_linklist.h"
#include "BLI_bpath.h"
#include "BKE_anim.h"
#include "BKE_animsys.h"
#include "BKE_boids.h"
#include "BKE_cloth.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_group.h"
#include "BKE_main.h"
#include "BKE_lattice.h"
#include "BKE_displist.h"
#include "BKE_particle.h"
#include "BKE_object.h"
#include "BKE_material.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_depsgraph.h"
#include "BKE_modifier.h"
#include "BKE_mesh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "BKE_deform.h"
#include "RE_render_ext.h"

Go to the source code of this file.

Classes

struct  ParticleRenderElem
struct  ParticleRenderData
struct  ParticleInterpolationData

Defines

#define PATH_CACHE_BUF_SIZE   1024
#define SET_PARTICLE_TEXTURE(type, pvalue, texfac)   if((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue)   if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue)   if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }

Typedefs

typedef struct ParticleRenderElem ParticleRenderElem
typedef struct ParticleRenderData ParticleRenderData
typedef struct
ParticleInterpolationData 
ParticleInterpolationData

Functions

static void get_child_modifier_parameters (ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex)
static void do_child_modifiers (ParticleSimulationData *sim, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, float mat[4][4], ParticleKey *state, float t)
int count_particles (ParticleSystem *psys)
int count_particles_mod (ParticleSystem *psys, int totgr, int cur)
static ParticleCacheKey ** psys_alloc_path_cache_buffers (ListBase *bufs, int tot, int steps)
static void psys_free_path_cache_buffers (ParticleCacheKey **cache, ListBase *bufs)
ParticleSystempsys_get_current (Object *ob)
short psys_get_current_num (Object *ob)
void psys_set_current_num (Object *ob, int index)
Objectpsys_find_object (Scene *scene, ParticleSystem *psys)
Objectpsys_get_lattice (ParticleSimulationData *sim)
void psys_disable_all (Object *ob)
void psys_enable_all (Object *ob)
int psys_in_edit_mode (Scene *scene, ParticleSystem *psys)
static void psys_create_frand (ParticleSystem *psys)
int psys_check_enabled (Object *ob, ParticleSystem *psys)
int psys_check_edited (ParticleSystem *psys)
void psys_check_group_weights (ParticleSettings *part)
int psys_uses_gravity (ParticleSimulationData *sim)
static void fluid_free_settings (SPHFluidSettings *fluid)
void psys_free_settings (ParticleSettings *part)
void free_hair (Object *UNUSED(ob), ParticleSystem *psys, int dynamics)
void free_keyed_keys (ParticleSystem *psys)
static void free_child_path_cache (ParticleSystem *psys)
void psys_free_path_cache (ParticleSystem *psys, PTCacheEdit *edit)
void psys_free_children (ParticleSystem *psys)
void psys_free_particles (ParticleSystem *psys)
void psys_free_pdd (ParticleSystem *psys)
void psys_free (Object *ob, ParticleSystem *psys)
static float psys_render_viewport_falloff (double rate, float dist, float width)
static float psys_render_projected_area (ParticleSystem *psys, const float center[3], float area, double vprate, float *viewport)
void psys_render_set (Object *ob, ParticleSystem *psys, float viewmat[][4], float winmat[][4], int winx, int winy, int timeoffset)
void psys_render_restore (Object *ob, ParticleSystem *psys)
int psys_render_simplify_distribution (ParticleThreadContext *ctx, int tot)
int psys_render_simplify_params (ParticleSystem *psys, ChildParticle *cpa, float *params)
static float interpolate_particle_value (float v1, float v2, float v3, float v4, const float w[4], int four)
void psys_interpolate_particle (short type, ParticleKey keys[4], float dt, ParticleKey *result, int velocity)
static void get_pointcache_keys_for_time (Object *UNUSED(ob), PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2)
static int get_pointcache_times_for_particle (PointCache *cache, int index, float *start, float *end)
float psys_get_dietime_from_cache (PointCache *cache, int index)
static void init_particle_interpolation (Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind)
static void edit_to_particle (ParticleKey *key, PTCacheEditKey *ekey)
static void hair_to_particle (ParticleKey *key, HairKey *hkey)
static void mvert_to_particle (ParticleKey *key, MVert *mvert, HairKey *hkey)
static void do_particle_interpolation (ParticleSystem *psys, int p, ParticleData *pa, float t, ParticleInterpolationData *pind, ParticleKey *result)
void psys_interpolate_face (MVert *mvert, MFace *mface, MTFace *tface, float(*orcodata)[3], float *w, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
void psys_interpolate_uvs (const MTFace *tface, int quad, const float w[4], float uvco[2])
void psys_interpolate_mcol (const MCol *mcol, int quad, const float w[4], MCol *mc)
static float psys_interpolate_value_from_verts (DerivedMesh *dm, short from, int index, const float fw[4], const float *values)
static void psys_w_to_origspace (const float w[4], float uv[2])
static void psys_origspace_to_w (OrigSpaceFace *osface, int quad, const float w[4], float neww[4])
int psys_particle_dm_face_lookup (Object *ob, DerivedMesh *dm, int index, const float fw[4], struct LinkNode *node)
static int psys_map_index_on_dm (DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float UNUSED(foffset), int *mapindex, float mapfw[4])
void psys_particle_on_dm (DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3], float ornor[3])
float psys_particle_value_from_verts (DerivedMesh *dm, short from, ParticleData *pa, float *values)
ParticleSystemModifierDatapsys_get_modifier (Object *ob, ParticleSystem *psys)
static void psys_particle_on_shape (int UNUSED(distr), int UNUSED(index), float *UNUSED(fuv), float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
void psys_particle_on_emitter (ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
static void do_kink (ParticleKey *state, ParticleKey *par, float *par_rot, float time, float freq, float shape, float amplitude, float flat, short type, short axis, float obmat[][4], int smooth_start)
static float do_clump (ParticleKey *state, ParticleKey *par, float time, float clumpfac, float clumppow, float pa_clump)
void precalc_guides (ParticleSimulationData *sim, ListBase *effectors)
int do_guides (ListBase *effectors, ParticleKey *state, int index, float time)
static void do_rough (float *loc, float mat[4][4], float t, float fac, float size, float thres, ParticleKey *state)
static void do_rough_end (float *loc, float mat[4][4], float t, float fac, float shape, ParticleKey *state)
static void do_path_effectors (ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec)
static int check_path_length (int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec)
static void offset_child (ChildParticle *cpa, ParticleKey *par, float *par_rot, ParticleKey *child, float flat, float radius)
float * psys_cache_vgroup (DerivedMesh *dm, ParticleSystem *psys, int vgroup)
void psys_find_parents (ParticleSimulationData *sim)
static void get_strand_normal (Material *ma, float *surfnor, float surfdist, float *nor)
static int psys_threads_init_path (ParticleThread *threads, Scene *scene, float cfra, int editupdate)
static void psys_thread_create_path (ParticleThread *thread, struct ChildParticle *cpa, ParticleCacheKey *child_keys, int i)
static void * exec_child_path_cache (void *data)
void psys_cache_child_paths (ParticleSimulationData *sim, float cfra, int editupdate)
static void cache_key_incremental_rotation (ParticleCacheKey *key0, ParticleCacheKey *key1, ParticleCacheKey *key2, float *prev_tangent, int i)
void psys_cache_paths (ParticleSimulationData *sim, float cfra)
void psys_cache_edit_paths (Scene *scene, Object *ob, PTCacheEdit *edit, float cfra)
void copy_particle_key (ParticleKey *to, ParticleKey *from, int time)
void psys_get_from_key (ParticleKey *key, float *loc, float *vel, float *rot, float *time)
static void triatomat (float *v1, float *v2, float *v3, float(*uv)[2], float mat[][4])
static void psys_face_mat (Object *ob, DerivedMesh *dm, ParticleData *pa, float mat[][4], int orco)
void psys_mat_hair_to_object (Object *UNUSED(ob), DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
void psys_mat_hair_to_orco (Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
void psys_vec_rot_to_face (DerivedMesh *dm, ParticleData *pa, float *vec)
void psys_mat_hair_to_global (Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
ModifierDataobject_add_particle_system (Scene *scene, Object *ob, const char *name)
void object_remove_particle_system (Scene *scene, Object *ob)
static void default_particle_settings (ParticleSettings *part)
ParticleSettingspsys_new_settings (const char *name, Main *main)
ParticleSettingspsys_copy_settings (ParticleSettings *part)
static void expand_local_particlesettings (ParticleSettings *part)
void make_local_particlesettings (ParticleSettings *part)
static int get_particle_uv (DerivedMesh *dm, ParticleData *pa, int face_index, const float fuv[4], char *name, float *texco)
static void get_cpa_texture (DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
void psys_get_texture (ParticleSimulationData *sim, ParticleData *pa, ParticleTexture *ptex, int event, float cfra)
float psys_get_timestep (ParticleSimulationData *sim)
float psys_get_child_time (ParticleSystem *psys, ChildParticle *cpa, float cfra, float *birthtime, float *dietime)
float psys_get_child_size (ParticleSystem *psys, ChildParticle *cpa, float UNUSED(cfra), float *UNUSED(pa_time))
void psys_get_particle_on_path (ParticleSimulationData *sim, int p, ParticleKey *state, int vel)
int psys_get_particle_state (ParticleSimulationData *sim, int p, ParticleKey *state, int always)
void psys_get_dupli_texture (ParticleSystem *psys, ParticleSettings *part, ParticleSystemModifierData *psmd, ParticleData *pa, ChildParticle *cpa, float *uv, float *orco)
void psys_get_dupli_path_transform (ParticleSimulationData *sim, ParticleData *pa, ChildParticle *cpa, ParticleCacheKey *cache, float mat[][4], float *scale)
void psys_make_billboard (ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3])
void psys_apply_hair_lattice (Scene *scene, Object *ob, ParticleSystem *psys)

Detailed Description

Definition in file particle.c.


Define Documentation

#define CLAMP_PARTICLE_TEXTURE_POS (   type,
  pvalue 
)    if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }

Definition at line 3708 of file particle.c.

Referenced by get_cpa_texture(), and psys_get_texture().

#define CLAMP_PARTICLE_TEXTURE_POSNEG (   type,
  pvalue 
)    if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }

Definition at line 3709 of file particle.c.

Referenced by psys_get_texture().

#define PATH_CACHE_BUF_SIZE   1024

Definition at line 122 of file particle.c.

Referenced by psys_alloc_path_cache_buffers().

#define SET_PARTICLE_TEXTURE (   type,
  pvalue,
  texfac 
)    if((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}

Definition at line 3707 of file particle.c.

Referenced by get_cpa_texture(), and psys_get_texture().


Typedef Documentation


Function Documentation

static void cache_key_incremental_rotation ( ParticleCacheKey key0,
ParticleCacheKey key1,
ParticleCacheKey key2,
float *  prev_tangent,
int  i 
) [static]
static int check_path_length ( int  k,
ParticleCacheKey keys,
ParticleCacheKey state,
float  max_length,
float *  cur_length,
float  length,
float *  dvec 
) [static]
void copy_particle_key ( ParticleKey to,
ParticleKey from,
int  time 
)
int count_particles ( ParticleSystem psys)
int count_particles_mod ( ParticleSystem psys,
int  totgr,
int  cur 
)
static void default_particle_settings ( ParticleSettings part) [static]

Definition at line 3478 of file particle.c.

References ParticleSettings::adapt_angle, ParticleSettings::adapt_pix, ParticleSettings::avemode, ParticleSettings::bb_align, ParticleSettings::bb_size, ParticleSettings::bb_split_offset, ParticleSettings::bb_uv_split, BKE_add_effector_weights(), ParticleSettings::child_nbr, ParticleSettings::childflat, ParticleSettings::childrad, ParticleSettings::childsize, ParticleSettings::clength, ParticleSettings::clength_thres, ParticleSettings::clumppow, ParticleSettings::color_vec_max, ParticleSettings::courant_target, ParticleSettings::disp, ParticleSettings::distr, ParticleSettings::draw, ParticleSettings::draw_as, ParticleSettings::draw_col, ParticleSettings::draw_line, ParticleSettings::draw_step, ParticleSettings::effector_weights, ParticleSettings::end, ParticleSettings::flag, ParticleSettings::from, ParticleSettings::grid_res, ParticleSettings::hair_step, ParticleSettings::integrator, ParticleSettings::jitfac, ParticleSettings::keyed_loops, ParticleSettings::keys_step, ParticleSettings::kink_amp, ParticleSettings::kink_amp_clump, ParticleSettings::kink_axis, ParticleSettings::kink_freq, ParticleSettings::lifetime, ParticleSettings::mass, ParticleSettings::normfac, NULL, PART_AVE_SPIN, PART_BB_OFF_LINEAR, PART_BB_VIEW, PART_DISTR_JIT, PART_DRAW_COL_MAT, PART_DRAW_EMITTER, PART_DRAW_HALO, PART_DRAW_REND, PART_EDISTR, PART_EMITTER, PART_EVENT_DEATH, PART_FROM_FACE, PART_HIDE_ADVANCED_HAIR, PART_INT_MIDPOINT, PART_PHYS_NEWTON, PART_ROT_VEL, PART_TRAND, ParticleSettings::path_end, ParticleSettings::path_start, ParticleSettings::phystype, ParticleSettings::reactevent, ParticleSettings::ren_as, ParticleSettings::ren_child_nbr, ParticleSettings::ren_step, ParticleSettings::rotmode, ParticleSettings::rough1_size, ParticleSettings::rough2_size, ParticleSettings::rough_end_shape, ParticleSettings::simplify_rate, ParticleSettings::simplify_refsize, ParticleSettings::simplify_transition, ParticleSettings::simplify_viewport, ParticleSettings::size, ParticleSettings::sta, ParticleSettings::timetweak, ParticleSettings::totpart, and ParticleSettings::type.

Referenced by psys_new_settings().

static void do_child_modifiers ( ParticleSimulationData sim,
ParticleTexture ptex,
ParticleKey par,
float *  par_rot,
ChildParticle cpa,
float *  orco,
float  mat[4][4],
ParticleKey state,
float  t 
) [static]
static float do_clump ( ParticleKey state,
ParticleKey par,
float  time,
float  clumpfac,
float  clumppow,
float  pa_clump 
) [static]

Definition at line 2032 of file particle.c.

References ParticleKey::co, interp_v3_v3v3(), and pow().

Referenced by do_child_modifiers(), and do_guides().

int do_guides ( ListBase effectors,
ParticleKey state,
int  index,
float  time 
)
static void do_kink ( ParticleKey state,
ParticleKey par,
float *  par_rot,
float  time,
float  freq,
float  shape,
float  amplitude,
float  flat,
short  type,
short  axis,
float  obmat[][4],
int  smooth_start 
) [static]
static void do_particle_interpolation ( ParticleSystem psys,
int  p,
ParticleData pa,
float  t,
ParticleInterpolationData pind,
ParticleKey result 
) [static]
static void do_path_effectors ( ParticleSimulationData sim,
int  i,
ParticleCacheKey ca,
int  k,
int  steps,
float *  UNUSEDrootco,
float  effector,
float   UNUSEDdfra,
float   UNUSEDcfra,
float *  length,
float *  vec 
) [static]
static void do_rough ( float *  loc,
float  mat[4][4],
float  t,
float  fac,
float  size,
float  thres,
ParticleKey state 
) [static]

Definition at line 2194 of file particle.c.

References BLI_gTurbulence(), ParticleKey::co, copy_v3_v3(), fabs(), madd_v3_v3fl(), and mul_v3_fl().

Referenced by do_child_modifiers().

static void do_rough_end ( float *  loc,
float  mat[4][4],
float  t,
float  fac,
float  shape,
ParticleKey state 
) [static]

Definition at line 2212 of file particle.c.

References ParticleKey::co, copy_v2_v2(), madd_v3_v3fl(), mul_v2_fl(), and pow().

Referenced by do_child_modifiers().

static void edit_to_particle ( ParticleKey key,
PTCacheEditKey ekey 
) [static]
static void* exec_child_path_cache ( void *  data) [static]
static void expand_local_particlesettings ( ParticleSettings part) [static]
static void fluid_free_settings ( SPHFluidSettings fluid) [static]

Definition at line 362 of file particle.c.

References MEM_freeN().

Referenced by psys_free_settings().

static void free_child_path_cache ( ParticleSystem psys) [static]
void free_hair ( Object UNUSEDob,
ParticleSystem psys,
int  dynamics 
)
void free_keyed_keys ( ParticleSystem psys)
static void get_child_modifier_parameters ( ParticleSettings part,
ParticleThreadContext ctx,
ChildParticle cpa,
short  cpa_from,
int  cpa_num,
float *  cpa_fuv,
float *  orco,
ParticleTexture ptex 
) [static]
static void get_cpa_texture ( DerivedMesh dm,
ParticleSystem psys,
ParticleSettings part,
ParticleData par,
int  child_index,
int  face_index,
const float  fw[4],
float *  orco,
ParticleTexture ptex,
int  event,
float  cfra 
) [static]
static int get_particle_uv ( DerivedMesh dm,
ParticleData pa,
int  face_index,
const float  fuv[4],
char *  name,
float *  texco 
) [static]
static void get_pointcache_keys_for_time ( Object UNUSEDob,
PointCache cache,
PTCacheMem **  cur,
int  index,
float  t,
ParticleKey key1,
ParticleKey key2 
) [static]
static int get_pointcache_times_for_particle ( PointCache cache,
int  index,
float *  start,
float *  end 
) [static]
static void get_strand_normal ( Material ma,
float *  surfnor,
float  surfdist,
float *  nor 
) [static]
static void hair_to_particle ( ParticleKey key,
HairKey hkey 
) [static]
static void init_particle_interpolation ( Object ob,
ParticleSystem psys,
ParticleData pa,
ParticleInterpolationData pind 
) [static]
static float interpolate_particle_value ( float  v1,
float  v2,
float  v3,
float  v4,
const float  w[4],
int  four 
) [static]

Definition at line 1005 of file particle.c.

References CLAMP().

Referenced by psys_interpolate_value_from_verts().

void make_local_particlesettings ( ParticleSettings part)
static void mvert_to_particle ( ParticleKey key,
MVert mvert,
HairKey hkey 
) [static]

Definition at line 1200 of file particle.c.

References MVert::co, ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.

Referenced by do_particle_interpolation().

ModifierData* object_add_particle_system ( Scene scene,
Object ob,
const char *  name 
) [read]
void object_remove_particle_system ( Scene scene,
Object ob 
)
static void offset_child ( ChildParticle cpa,
ParticleKey par,
float *  par_rot,
ParticleKey child,
float  flat,
float  radius 
) [static]
void precalc_guides ( ParticleSimulationData sim,
ListBase effectors 
)
static ParticleCacheKey** psys_alloc_path_cache_buffers ( ListBase bufs,
int  tot,
int  steps 
) [static]
void psys_apply_hair_lattice ( Scene scene,
Object ob,
ParticleSystem psys 
)
void psys_cache_child_paths ( ParticleSimulationData sim,
float  cfra,
int  editupdate 
)
void psys_cache_edit_paths ( Scene scene,
Object ob,
PTCacheEdit edit,
float  cfra 
)

Definition at line 3036 of file particle.c.

References ParticleInterpolationData::birthtime, ParticleEditSettings::brushtype, ParticleInterpolationData::bspline, ParticleInterpolationData::cache, cache_key_incremental_rotation(), ParticleKey::co, ParticleCacheKey::co, ParticleCacheKey::col, copy_qt_qt(), copy_v3_v3(), ParticleInterpolationData::dietime, ParticleSystemModifierData::dm, ParticleInterpolationData::dm, do_particle_interpolation(), ParticleEditSettings::draw_step, ParticleInterpolationData::ekey, ParticleInterpolationData::epoint, ParticleSystem::flag, ParticleSettings::flag, PTCacheEditPoint::flag, ParticleSettings::from, ParticleData::hair, ParticleInterpolationData::hkey, i, init_particle_interpolation(), interp_v3_v3v3(), ParticleInterpolationData::keyed, PTCacheEditPoint::keys, mat3_to_quat_is_ok(), MAX2, mul_m4_v3(), PTCacheEdit::nosel_col, NULL, ParticleSimulationData::ob, ParticleSystem::part, PART_HAIR_BSPLINE, ToolSettings::particle, ParticleSystem::particles, PTCacheEdit::pathcache, PTCacheEdit::pathcachebufs, PE_BRUSH_WEIGHT, PEK_SELECT, PEP_EDIT_RECALC, PTCacheEdit::points, pow(), ParticleSimulationData::psmd, ParticleSimulationData::psys, PTCacheEdit::psys, psys_alloc_path_cache_buffers(), psys_cache_child_paths(), psys_free_path_cache(), psys_get_modifier(), PSYS_GLOBAL_HAIR, psys_mat_hair_to_global(), rot, ParticleCacheKey::rot, ParticleSimulationData::scene, PTCacheEdit::sel_col, ParticleCacheKey::steps, sub_v3_v3v3(), ParticleCacheKey::time, HairKey::time, PTCacheEditKey::time, ParticleKey::time, Scene::toolsettings, PTCacheEdit::totcached, PTCacheEdit::totpoint, ParticleCacheKey::vel, HairKey::weight, and weight_to_rgb().

Referenced by draw_update_ptcache_edit(), PE_update_object(), and PE_update_selection().

void psys_cache_paths ( ParticleSimulationData sim,
float  cfra 
)
float* psys_cache_vgroup ( DerivedMesh dm,
ParticleSystem psys,
int  vgroup 
)
int psys_check_edited ( ParticleSystem psys)
int psys_check_enabled ( Object ob,
ParticleSystem psys 
)
void psys_check_group_weights ( ParticleSettings part)
ParticleSettings* psys_copy_settings ( ParticleSettings part) [read]
static void psys_create_frand ( ParticleSystem psys) [static]
void psys_disable_all ( Object ob)
void psys_enable_all ( Object ob)
static void psys_face_mat ( Object ob,
DerivedMesh dm,
ParticleData pa,
float  mat[][4],
int  orco 
) [static]
Object* psys_find_object ( Scene scene,
ParticleSystem psys 
) [read]
void psys_find_parents ( ParticleSimulationData sim)
void psys_free ( Object ob,
ParticleSystem psys 
)
void psys_free_children ( ParticleSystem psys)
void psys_free_particles ( ParticleSystem psys)
void psys_free_path_cache ( ParticleSystem psys,
PTCacheEdit edit 
)
static void psys_free_path_cache_buffers ( ParticleCacheKey **  cache,
ListBase bufs 
) [static]
void psys_free_pdd ( ParticleSystem psys)
void psys_free_settings ( ParticleSettings part)
float psys_get_child_size ( ParticleSystem psys,
ChildParticle cpa,
float   UNUSEDcfra,
float *  UNUSEDpa_time 
)
float psys_get_child_time ( ParticleSystem psys,
ChildParticle cpa,
float  cfra,
float *  birthtime,
float *  dietime 
)
ParticleSystem* psys_get_current ( Object ob) [read]
short psys_get_current_num ( Object ob)
float psys_get_dietime_from_cache ( PointCache cache,
int  index 
)
void psys_get_dupli_path_transform ( ParticleSimulationData sim,
ParticleData pa,
ChildParticle cpa,
ParticleCacheKey cache,
float  mat[][4],
float *  scale 
)
void psys_get_dupli_texture ( ParticleSystem psys,
ParticleSettings part,
ParticleSystemModifierData psmd,
ParticleData pa,
ChildParticle cpa,
float *  uv,
float *  orco 
)
void psys_get_from_key ( ParticleKey key,
float *  loc,
float *  vel,
float *  rot,
float *  time 
)
Object* psys_get_lattice ( ParticleSimulationData sim) [read]
ParticleSystemModifierData* psys_get_modifier ( Object ob,
ParticleSystem psys 
) [read]
void psys_get_particle_on_path ( ParticleSimulationData sim,
int  p,
ParticleKey state,
int  vel 
)

Definition at line 3984 of file particle.c.

References ParticleInterpolationData::bspline, ParticleInterpolationData::cache, calc_latt_deform(), ParticleSystem::child, ParticleSettings::childflat, ParticleSettings::childrad, ParticleSettings::childtype, CLAMP(), ParticleKey::co, co, copy_particle_key(), copy_v3_v3(), ParticleThreadContext::dm, ParticleSystemModifierData::dm, ParticleInterpolationData::dm, DMCACHE_ISCHILD, do_child_modifiers(), do_guides(), do_particle_interpolation(), ParticleSystem::effectors, ParticleInterpolationData::epoint, ParticleData::flag, ParticleSettings::flag, ParticleSystem::flag, ParticleData::foffset, ChildParticle::foffset, ParticleSettings::from, ParticleData::fuv, ChildParticle::fuv, get_child_modifier_parameters(), give_current_material(), ParticleSystem::hair_out_dm, init_particle_interpolation(), ParticleInterpolationData::keyed, ParticleSystem::lattice, len_v3(), ParticleThreadContext::ma, mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), normalize_v3(), NULL, ParticleData::num, ChildParticle::num, ParticleSimulationData::ob, Object::obmat, offset_child(), ParticleSettings::omat, p, ChildParticle::pa, ChildParticle::parent, PARS_REKEY, ParticleSystem::part, PART_CHILD_FACES, PART_CHILD_GUIDE, PART_FROM_FACE, PART_HAIR, PART_HAIR_BSPLINE, PART_PHYS_KEYED, PARTICLE_PSMD, ParticleSystem::particles, ParticleSettings::phystype, ParticleSystem::pointcache, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_get_child_time(), psys_get_particle_on_path(), PSYS_GLOBAL_HAIR, psys_in_edit_mode(), PSYS_KEYED, psys_mat_hair_to_global(), psys_particle_on_emitter(), ParticleKey::rot, ParticleSimulationData::scene, ParticleThreadContext::sim, sub_v3_v3v3(), ParticleData::time, ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, ParticleSettings::type, unit_m4(), ParticleKey::vel, ChildParticle::w, and simple_enum_gen::w.

Referenced by applyModifier(), brush_add(), draw_new_particle_system(), psys_get_particle_on_path(), psys_get_particle_state(), rekey_particle(), rekey_particle_to_time(), render_new_particle_system(), and subdivide_particle().

int psys_get_particle_state ( ParticleSimulationData sim,
int  p,
ParticleKey state,
int  always 
)
void psys_get_texture ( ParticleSimulationData sim,
ParticleData pa,
ParticleTexture ptex,
int  event,
float  cfra 
)

Definition at line 3776 of file particle.c.

References blend(), MTex::blendtype, CLAMP_PARTICLE_TEXTURE_POS, CLAMP_PARTICLE_TEXTURE_POSNEG, ParticleTexture::clump, ParticleKey::co, co, copy_v3_v3(), ParticleTexture::damp, MTex::dampfac, MTex::def_var, ParticleData::dietime, ParticleSettings::distr, ParticleSystemModifierData::dm, ParticleTexture::effector, ELEM, ParticleTexture::exist, externtex(), fabsf, ParticleTexture::field, MTex::fieldfac, ParticleData::foffset, ParticleSettings::from, ParticleData::fuv, get_particle_uv(), ParticleTexture::gravity, MTex::gravityfac, Object::imat, ParticleTexture::ivel, MTex::ivelfac, ParticleTexture::kink, ParticleTexture::length, MTex::lengthfac, ParticleTexture::life, MTex::lifefac, MAP_PA_TIME, MTex::mapto, MAX_MTEX, ParticleSettings::mtex, mul_m4_v3(), ParticleData::num, ParticleData::num_dmcache, MTex::object, MTex::padensfac, PAMAP_DAMP, PAMAP_DENS, PAMAP_FIELD, PAMAP_GRAVITY, PAMAP_IVEL, PAMAP_LENGTH, PAMAP_LIFE, PAMAP_SIZE, PAMAP_TIME, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_FACE, PART_FROM_VOLUME, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_particle_on_emitter(), ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, SET_PARTICLE_TEXTURE, ParticleTexture::size, MTex::sizefac, ParticleData::state, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_PARTICLE, TEXCO_UV, texture_value_blend(), ParticleData::time, ParticleTexture::time, MTex::timefac, ParticleSystem::totpart, and MTex::uvname.

Referenced by basic_integrate(), cached_step(), dynamics_step(), initialize_particle(), psys_get_birth_coordinates(), and reset_particle().

float psys_get_timestep ( ParticleSimulationData sim)
int psys_in_edit_mode ( Scene scene,
ParticleSystem psys 
)
void psys_interpolate_face ( MVert mvert,
MFace mface,
MTFace tface,
float(*)  orcodata[3],
float *  w,
float *  vec,
float *  nor,
float *  utan,
float *  vtan,
float *  orco,
float *  ornor 
)
void psys_interpolate_mcol ( const MCol mcol,
int  quad,
const float  w[4],
MCol mc 
)

Definition at line 1512 of file particle.c.

void psys_interpolate_particle ( short  type,
ParticleKey  keys[4],
float  dt,
ParticleKey result,
int  velocity 
)
void psys_interpolate_uvs ( const MTFace tface,
int  quad,
const float  w[4],
float  uvco[2] 
)

Definition at line 1489 of file particle.c.

References MTFace::uv.

static float psys_interpolate_value_from_verts ( DerivedMesh dm,
short  from,
int  index,
const float  fw[4],
const float *  values 
) [static]
void psys_make_billboard ( ParticleBillboardData bb,
float  xvec[3],
float  yvec[3],
float  zvec[3],
float  center[3] 
)
static int psys_map_index_on_dm ( DerivedMesh dm,
int  from,
int  index,
int  index_dmcache,
const float  fw[4],
float   UNUSEDfoffset,
int *  mapindex,
float  mapfw[4] 
) [static]
void psys_mat_hair_to_global ( Object ob,
DerivedMesh dm,
short  from,
ParticleData pa,
float  hairmat[][4] 
)
void psys_mat_hair_to_object ( Object UNUSEDob,
DerivedMesh dm,
short  from,
ParticleData pa,
float  hairmat[][4] 
)
void psys_mat_hair_to_orco ( Object ob,
DerivedMesh dm,
short  from,
ParticleData pa,
float  hairmat[][4] 
)
ParticleSettings* psys_new_settings ( const char *  name,
Main main 
) [read]
static void psys_origspace_to_w ( OrigSpaceFace osface,
int  quad,
const float  w[4],
float  neww[4] 
) [static]

Definition at line 1564 of file particle.c.

References co, interp_weights_poly_v3(), psys_w_to_origspace(), and OrigSpaceFace::uv.

Referenced by psys_map_index_on_dm().

int psys_particle_dm_face_lookup ( Object ob,
DerivedMesh dm,
int  index,
const float  fw[4],
struct LinkNode node 
)
void psys_particle_on_dm ( DerivedMesh dm,
int  from,
int  index,
int  index_dmcache,
const float  fw[4],
float  foffset,
float  vec[3],
float  nor[3],
float  utan[3],
float  vtan[3],
float  orco[3],
float  ornor[3] 
)
void psys_particle_on_emitter ( ParticleSystemModifierData psmd,
int  from,
int  index,
int  index_dmcache,
float *  fuv,
float  foffset,
float *  vec,
float *  nor,
float *  utan,
float *  vtan,
float *  orco,
float *  ornor 
)
static void psys_particle_on_shape ( int   UNUSEDdistr,
int   UNUSEDindex,
float *  UNUSEDfuv,
float *  vec,
float *  nor,
float *  utan,
float *  vtan,
float *  orco,
float *  ornor 
) [static]

Definition at line 1810 of file particle.c.

References copy_v3_v3().

Referenced by psys_particle_on_emitter().

float psys_particle_value_from_verts ( DerivedMesh dm,
short  from,
ParticleData pa,
float *  values 
)
static float psys_render_projected_area ( ParticleSystem psys,
const float  center[3],
float  area,
double  vprate,
float *  viewport 
) [static]
void psys_render_restore ( Object ob,
ParticleSystem psys 
)
void psys_render_set ( Object ob,
ParticleSystem psys,
float  viewmat[][4],
float  winmat[][4],
int  winx,
int  winy,
int  timeoffset 
)
int psys_render_simplify_distribution ( ParticleThreadContext ctx,
int  tot 
)
int psys_render_simplify_params ( ParticleSystem psys,
ChildParticle cpa,
float *  params 
)
static float psys_render_viewport_falloff ( double  rate,
float  dist,
float  width 
) [static]

Definition at line 621 of file particle.c.

References pow().

Referenced by psys_render_projected_area().

void psys_set_current_num ( Object ob,
int  index 
)
static void psys_thread_create_path ( ParticleThread thread,
struct ChildParticle cpa,
ParticleCacheKey child_keys,
int  i 
) [static]

Definition at line 2461 of file particle.c.

References add_v3_v3(), ParticleThreadContext::between, ParticleThreadContext::cfra, check_path_length(), ParticleSystem::childcache, ParticleSettings::childflat, ParticleSettings::childrad, CLAMP(), ParticleKey::co, ParticleCacheKey::co, co, copy_qt_qt(), copy_v3_v3(), ParticleThread::ctx, simple_enum_gen::d, ParticleSystemModifierData::dm, DMCACHE_ISCHILD, do_child_modifiers(), do_path_effectors(), dot_v3v3(), ParticleSettings::draw_col, ParticleSystem::edit, ParticleThreadContext::editupdate, ParticleTexture::effector, ParticleTexture::exist, ParticleSettings::flag, PTCacheEditPoint::flag, ParticleData::foffset, ChildParticle::foffset, ParticleSettings::from, ParticleData::fuv, ChildParticle::fuv, get_child_modifier_parameters(), get_strand_normal(), interp_v3_v3v3v3v3(), interp_v4_v4v4(), len_v3(), len_v3v3(), ParticleTexture::length, length(), ParticleThreadContext::ma, madd_v3_v3fl(), mul_m4_v3(), mul_qt_qtqt(), mul_qt_v3(), mul_v3_fl(), normalize_v3(), NULL, ParticleData::num, ChildParticle::num, ParticleSimulationData::ob, Object::obmat, offset_child(), ChildParticle::pa, ChildParticle::parent, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_LONG_HAIR, PART_DRAW_COL_MAT, PART_FROM_FACE, ParticleSystem::particles, ParticleSettings::parting_fac, ParticleSettings::parting_max, ParticleSettings::parting_min, ParticleSystem::pathcache, PTCacheEdit::pathcache, PEP_EDIT_RECALC, PTCacheEdit::points, project_v3_v3v3(), ParticleSimulationData::psmd, ParticleSimulationData::psys, PSYS_FRAND, psys_in_edit_mode(), psys_mat_hair_to_global(), psys_particle_on_emitter(), Material::r, RAD2DEGF, ParticleCacheKey::rot, rot, saacos(), ParticleSimulationData::scene, ParticleThreadContext::sim, ParticleCacheKey::steps, ParticleThreadContext::steps, sub_v3_v3v3(), ParticleThreadContext::totparent, unit_qt(), ParticleKey::vel, ParticleCacheKey::vel, ChildParticle::w, simple_enum_gen::w, and zero_v3().

Referenced by exec_child_path_cache().

static int psys_threads_init_path ( ParticleThread threads,
Scene scene,
float  cfra,
int  editupdate 
) [static]
int psys_uses_gravity ( ParticleSimulationData sim)
void psys_vec_rot_to_face ( DerivedMesh dm,
ParticleData pa,
float *  vec 
)

Definition at line 3371 of file particle.c.

References mul_mat3_m4_v3(), psys_face_mat(), and transpose_m4().

Referenced by save_hair().

static void psys_w_to_origspace ( const float  w[4],
float  uv[2] 
) [static]

Definition at line 1557 of file particle.c.

Referenced by psys_origspace_to_w(), and psys_particle_dm_face_lookup().

static void triatomat ( float *  v1,
float *  v2,
float *  v3,
float(*)  uv[2],
float  mat[][4] 
) [static]

Definition at line 3275 of file particle.c.

References cross_v3_v3v3(), normal_tri_v3(), normalize_v3(), and sub_v3_v3v3().

Referenced by psys_face_mat().