Blender V2.61 - r43446
|
#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) |
ParticleSystem * | psys_get_current (Object *ob) |
short | psys_get_current_num (Object *ob) |
void | psys_set_current_num (Object *ob, int index) |
Object * | psys_find_object (Scene *scene, ParticleSystem *psys) |
Object * | psys_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) |
ParticleSystemModifierData * | psys_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]) |
ModifierData * | object_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) |
ParticleSettings * | psys_new_settings (const char *name, Main *main) |
ParticleSettings * | psys_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) |
Definition in file particle.c.
#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 struct ParticleInterpolationData ParticleInterpolationData |
typedef struct ParticleRenderData ParticleRenderData |
typedef struct ParticleRenderElem ParticleRenderElem |
static void cache_key_incremental_rotation | ( | ParticleCacheKey * | key0, |
ParticleCacheKey * | key1, | ||
ParticleCacheKey * | key2, | ||
float * | prev_tangent, | ||
int | i | ||
) | [static] |
Definition at line 2808 of file particle.c.
References angle(), axis_angle_to_quat(), ParticleCacheKey::co, copy_v3_v3(), copy_v4_v4(), cross_v3_v3v3(), dot_v3v3(), mul_qt_qtqt(), normalize_v3(), ParticleCacheKey::rot, saacos(), sub_v3_v3v3(), and unit_qt().
Referenced by psys_cache_edit_paths().
static int check_path_length | ( | int | k, |
ParticleCacheKey * | keys, | ||
ParticleCacheKey * | state, | ||
float | max_length, | ||
float * | cur_length, | ||
float | length, | ||
float * | dvec | ||
) | [static] |
Definition at line 2257 of file particle.c.
References add_v3_v3v3(), ParticleCacheKey::co, length(), mul_v3_fl(), and ParticleCacheKey::steps.
Referenced by psys_thread_create_path().
void copy_particle_key | ( | ParticleKey * | to, |
ParticleKey * | from, | ||
int | time | ||
) |
Definition at line 3240 of file particle.c.
References ParticleKey::time.
Referenced by boid_body(), do_particle_interpolation(), dynamics_step(), get_pointcache_keys_for_time(), integrate_particle(), psys_get_particle_on_path(), psys_get_particle_state(), set_keyed_keys(), and sph_integrate().
int count_particles | ( | ParticleSystem * | psys | ) |
Definition at line 93 of file particle.c.
References ParticleSettings::flag, LOOP_SHOWN_PARTICLES, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_DIED, PART_UNBORN, and PARTICLE_P.
Referenced by stats_dupli_object().
int count_particles_mod | ( | ParticleSystem * | psys, |
int | totgr, | ||
int | cur | ||
) |
Definition at line 106 of file particle.c.
References ParticleSettings::flag, LOOP_SHOWN_PARTICLES, p, PARS_DEAD, PARS_UNBORN, ParticleSystem::part, PART_DIED, PART_UNBORN, and PARTICLE_P.
Referenced by stats_dupli_object().
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] |
Definition at line 3940 of file particle.c.
References ParticleSystem::child, ParticleSettings::childtype, ParticleTexture::clump, ParticleSettings::clumpfac, ParticleSettings::clumppow, do_clump(), do_guides(), do_kink(), do_rough(), do_rough_end(), ParticleSystem::effectors, ParticleSettings::flag, ParticleSystem::frand, ParticleSettings::kink, ParticleTexture::kink, ParticleSettings::kink_amp, ParticleSettings::kink_amp_clump, ParticleSettings::kink_axis, ParticleSettings::kink_flat, ParticleSettings::kink_freq, ParticleSettings::kink_shape, ParticleSimulationData::ob, Object::obmat, ChildParticle::parent, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_FACES, ParticleSimulationData::psys, PSYS_FRAND_COUNT, ParticleTexture::rough1, ParticleSettings::rough1, ParticleSettings::rough1_size, ParticleTexture::rough2, ParticleSettings::rough2, ParticleSettings::rough2_size, ParticleSettings::rough2_thres, ParticleSettings::rough_end, ParticleSettings::rough_end_shape, and ParticleTexture::roughe.
Referenced by psys_get_particle_on_path(), psys_get_particle_state(), and psys_thread_create_path().
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 | ||
) |
Definition at line 2094 of file particle.c.
References add_v3_v3(), angle(), axis_angle_to_quat(), calc_taper(), CLAMP(), PartDeflect::clump_fac, PartDeflect::clump_pow, ParticleKey::co, copy_v3_v3(), cross_v3_v3v3(), CU_PATH_RADIUS, Object::data, data, do_clump(), do_kink(), dot_v3v3(), ListBase::first, Curve::flag, PartDeflect::flag, PartDeflect::forcefield, PartDeflect::free_end, EffectorCache::guide_data, EffectorCache::guide_dir, EffectorCache::guide_loc, interp_v3_v3v3(), PartDeflect::kink, PartDeflect::kink_amp, PartDeflect::kink_axis, PartDeflect::kink_freq, PartDeflect::kink_shape, len_v3(), madd_v3_v3fl(), mul_m4_v3(), mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), EffectorCache::next, normalize_v3(), NULL, EffectorCache::ob, Object::obmat, EffectorCache::pd, PFIELD_GUIDE, PFIELD_GUIDE_PATH_ADD, PFIELD_GUIDE_PATH_WEIGHT, saacos(), EffectorCache::scene, GuideEffectorData::strength, Curve::taperobj, GuideEffectorData::vec_to_point, ParticleKey::vel, and where_on_path().
Referenced by basic_integrate(), do_child_modifiers(), and psys_get_particle_on_path().
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] |
Definition at line 1858 of file particle.c.
References add_v3_v3(), add_v3_v3v3(), axis_angle_to_quat(), CLAMP(), ParticleKey::co, copy_v3_v3(), cos(), dot_v3v3(), fabs(), interp_v3_v3v3(), length(), M_PI, madd_v3_v3fl(), MIN2, mul_mat3_m4_v3(), mul_qt_v3(), mul_v3_fl(), mul_v3_v3fl(), negate_v3(), normalize_v3(), normalize_v3_v3(), NULL, PART_KINK_BRAID, PART_KINK_CURL, PART_KINK_NO, PART_KINK_RADIAL, PART_KINK_WAVE, pow(), project_v3_v3v3(), sin(), sqrt(), sub_v3_v3(), sub_v3_v3v3(), and ParticleKey::vel.
Referenced by do_child_modifiers(), and do_guides().
static void do_particle_interpolation | ( | ParticleSystem * | psys, |
int | p, | ||
ParticleData * | pa, | ||
float | t, | ||
ParticleInterpolationData * | pind, | ||
ParticleKey * | result | ||
) | [static] |
Definition at line 1206 of file particle.c.
References ParticleInterpolationData::bspline, ParticleInterpolationData::cache, CLAMP(), copy_particle_key(), ParticleData::dietime, ParticleInterpolationData::dm, ParticleTarget::duration, edit_to_particle(), ParticleInterpolationData::ekey, ParticleInterpolationData::epoint, ListBase::first, ParticleSystem::flag, get_pointcache_keys_for_time(), ParticleData::hair, hair_to_particle(), ParticleInterpolationData::hkey, interp_qt_qtqt(), KEY_BSPLINE, KEY_CARDINAL, ParticleInterpolationData::keyed, PTCacheEditPoint::keys, ParticleInterpolationData::kkey, ListBase::last, mul_v3_fl(), ParticleInterpolationData::mvert, mvert_to_particle(), ParticleTarget::next, NULL, ParticleSystem::part, PART_PHYS_KEYED, ParticleSettings::phystype, ParticleInterpolationData::pm, ParticleTarget::prev, psys_interpolate_particle(), PSYS_KEYED_TIMING, ParticleKey::rot, ParticleSystem::targets, HairKey::time, ParticleTarget::time, ParticleData::time, PTCacheEditKey::time, ParticleKey::time, ParticleSettings::timetweak, ParticleData::totkey, PTCacheEditPoint::totkey, ParticleKey::vel, and PTCacheEditKey::vel.
Referenced by psys_cache_edit_paths(), and psys_get_particle_on_path().
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] |
Definition at line 2226 of file particle.c.
References add_v3_v3(), ParticleCacheKey::co, co, ParticleKey::co, ParticleSimulationData::colliders, copy_qt_qt(), copy_v3_v3(), ParticleSettings::eff_hair, ParticleSettings::effector_weights, ParticleSystem::effectors, ParticleSystem::flag, len_v3(), madd_v3_v3v3fl(), mul_v3_fl(), normalize_v3(), NULL, ParticleSystem::part, ParticleSystem::particles, pd_point_from_particle(), pdDoEffectors(), powf, ParticleSimulationData::psys, PSYS_HAIR_DYNAMICS, ParticleKey::rot, sub_v3_v3v3(), and ParticleKey::vel.
Referenced by psys_thread_create_path().
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] |
Definition at line 1186 of file particle.c.
References PTCacheEditKey::co, ParticleKey::co, copy_v3_v3(), PTCacheEditKey::time, ParticleKey::time, ParticleKey::vel, and PTCacheEditKey::vel.
Referenced by do_particle_interpolation().
static void* exec_child_path_cache | ( | void * | data | ) | [static] |
Definition at line 2724 of file particle.c.
References ParticleSystem::child, ParticleSystem::childcache, ParticleThread::ctx, i, ParticleThread::num, ParticleThreadContext::parent_pass, ParticleSimulationData::psys, psys_thread_create_path(), ParticleThreadContext::sim, ParticleThread::tot, ParticleThreadContext::totchild, and ParticleThreadContext::totparent.
Referenced by psys_cache_child_paths().
static void expand_local_particlesettings | ( | ParticleSettings * | part | ) | [static] |
Definition at line 3598 of file particle.c.
References ParticleSettings::dup_group, i, id_lib_extern(), MAX_MTEX, ParticleSettings::mtex, and MTex::tex.
Referenced by make_local_particlesettings().
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] |
Definition at line 446 of file particle.c.
References ParticleSystem::childcache, ParticleSystem::childcachebufs, NULL, psys_free_path_cache_buffers(), and ParticleSystem::totchildcache.
Referenced by psys_cache_child_paths(), psys_free_children(), and psys_free_path_cache().
void free_hair | ( | Object * | UNUSEDob, |
ParticleSystem * | psys, | ||
int | dynamics | ||
) |
Definition at line 391 of file particle.c.
References BKE_ptcache_add(), BKE_ptcache_free_list(), ParticleSystem::clmd, cloth_free_modifier(), ListBase::first, ParticleSystem::flag, ParticleSystem::hair_in_dm, ParticleSystem::hair_out_dm, ListBase::last, LOOP_PARTICLES, MEM_freeN(), modifier_free(), NULL, PARTICLE_P, ClothModifierData::point_cache, ParticleSystem::pointcache, PSYS_HAIR_DONE, ClothModifierData::ptcaches, ParticleSystem::ptcaches, and DerivedMesh::release.
void free_keyed_keys | ( | ParticleSystem * | psys | ) |
Definition at line 428 of file particle.c.
References ParticleData::keys, LOOP_PARTICLES, MEM_freeN(), NULL, ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, and ParticleSettings::type.
Referenced by particle_system_update(), psys_prepare_physics(), and set_keyed_keys().
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] |
Definition at line 3914 of file particle.c.
References ParticleSystem::cfra, ParticleSystem::child, ParticleTexture::clump, ParticleThreadContext::dm, ParticleTexture::effector, ParticleTexture::exist, get_cpa_texture(), ParticleTexture::kink, ParticleTexture::length, ChildParticle::pa, PAMAP_CHILD, PAMAP_DENS, ParticleSystem::particles, ParticleSimulationData::psys, PSYS_FRAND, psys_interpolate_value_from_verts(), ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, ParticleThreadContext::sim, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_effector, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, and ParticleThreadContext::vg_roughe.
Referenced by psys_get_particle_on_path(), and psys_thread_create_path().
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] |
Definition at line 3711 of file particle.c.
References blend(), MTex::blendtype, CLAMP_PARTICLE_TEXTURE_POS, ParticleSettings::clength, ParticleSettings::clength_thres, ParticleTexture::clump, MTex::clumpfac, ParticleKey::co, copy_v3_v3(), ParticleTexture::damp, MTex::def_var, ParticleData::dietime, ParticleSettings::distr, ParticleTexture::effector, ELEM, ParticleTexture::exist, externtex(), ParticleTexture::field, ParticleSettings::from, get_particle_uv(), ParticleTexture::gravity, Object::imat, ParticleTexture::ivel, ParticleTexture::kink, MTex::kinkfac, ParticleTexture::length, MTex::lengthfac, ParticleTexture::life, MTex::mapto, MAX_MTEX, ParticleSettings::mtex, mul_m4_v3(), NULL, MTex::object, MTex::padensfac, PAMAP_CLUMP, PAMAP_DENS, PAMAP_KINK, PAMAP_LENGTH, PAMAP_ROUGH, PART_DISTR_GRID, PART_FROM_FACE, PART_FROM_VOLUME, PSYS_FRAND, ParticleSettings::randlength, ParticleTexture::rough1, ParticleTexture::rough2, ParticleTexture::roughe, MTex::roughfac, SET_PARTICLE_TEXTURE, ParticleTexture::size, ParticleData::state, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_PARTICLE, TEXCO_UV, texture_value_blend(), ParticleData::time, ParticleTexture::time, and MTex::uvname.
Referenced by get_child_modifier_parameters().
static int get_particle_uv | ( | DerivedMesh * | dm, |
ParticleData * | pa, | ||
int | face_index, | ||
const float | fuv[4], | ||
char * | name, | ||
float * | texco | ||
) | [static] |
Definition at line 3667 of file particle.c.
References CD_MFACE, CD_MTFACE, CustomData_get_layer(), CustomData_get_layer_named(), DMCACHE_NOTFOUND, DerivedMesh::faceData, DerivedMesh::getFaceData, DerivedMesh::getNumFaces, i, NULL, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_uvs(), and MFace::v4.
Referenced by get_cpa_texture(), and psys_get_texture().
static void get_pointcache_keys_for_time | ( | Object * | UNUSEDob, |
PointCache * | cache, | ||
PTCacheMem ** | cur, | ||
int | index, | ||
float | t, | ||
ParticleKey * | key1, | ||
ParticleKey * | key2 | ||
) | [static] |
Definition at line 1069 of file particle.c.
References BKE_ptcache_make_particle_key(), BKE_ptcache_mem_index_find(), copy_particle_key(), PTCacheMem::data, ListBase::first, PTCacheMem::frame, PointCache::mem_cache, PTCacheMem::next, NULL, and PTCacheMem::prev.
Referenced by do_particle_interpolation(), and init_particle_interpolation().
static int get_pointcache_times_for_particle | ( | PointCache * | cache, |
int | index, | ||
float * | start, | ||
float * | end | ||
) | [static] |
Definition at line 1104 of file particle.c.
References BKE_ptcache_mem_index_find(), ListBase::first, PTCacheMem::frame, ListBase::last, PointCache::mem_cache, PTCacheMem::next, and PTCacheMem::prev.
Referenced by init_particle_interpolation().
static void get_strand_normal | ( | Material * | ma, |
float * | surfnor, | ||
float | surfdist, | ||
float * | nor | ||
) | [static] |
Definition at line 2344 of file particle.c.
References blend(), CLAMP(), copy_v3_v3(), cross(), cross_v3_v3v3(), INPR, interp_v3_v3v3(), MA_STR_SURFDIFF, Material::mode, normalize_v3(), and Material::strand_surfnor.
Referenced by psys_thread_create_path().
static void hair_to_particle | ( | ParticleKey * | key, |
HairKey * | hkey | ||
) | [static] |
Definition at line 1194 of file particle.c.
References HairKey::co, ParticleKey::co, copy_v3_v3(), HairKey::time, and ParticleKey::time.
Referenced by do_particle_interpolation().
static void init_particle_interpolation | ( | Object * | ob, |
ParticleSystem * | psys, | ||
ParticleData * | pa, | ||
ParticleInterpolationData * | pind | ||
) | [static] |
Definition at line 1141 of file particle.c.
References ParticleInterpolationData::birthtime, ParticleInterpolationData::cache, CDDM_get_vert(), ParticleData::dietime, ParticleInterpolationData::dietime, ParticleInterpolationData::dm, ParticleInterpolationData::ekey, PointCache::endframe, ParticleInterpolationData::epoint, get_pointcache_keys_for_time(), get_pointcache_times_for_particle(), ParticleData::hair, ParticleData::hair_index, ParticleInterpolationData::hkey, ParticleInterpolationData::keyed, ParticleData::keys, PTCacheEditPoint::keys, ParticleInterpolationData::kkey, MAX2, MIN2, ParticleInterpolationData::mvert, NULL, ParticleSystem::particles, ParticleInterpolationData::pm, PointCache::startframe, HairKey::time, ParticleData::time, ParticleKey::time, PTCacheEditKey::time, ParticleData::totkey, and PTCacheEditPoint::totkey.
Referenced by psys_cache_edit_paths(), and psys_get_particle_on_path().
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 | ) |
Definition at line 3608 of file particle.c.
References BKE_id_lib_local_paths(), ELEM, expand_local_particlesettings(), FALSE, ListBase::first, G, Object::id, ParticleSettings::id, id_clear_lib_data(), ID::lib, ParticleSystem::next, ID::next, Main::object, ParticleSystem::part, Object::particlesystem, psys_copy_settings(), TRUE, and ID::us.
Referenced by id_make_local().
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] |
Definition at line 3392 of file particle.c.
References BKE_frame_to_ctime(), BKE_ptcache_add(), BLI_addtail(), BLI_countlist(), BLI_snprintf(), BLI_strncpy(), CFRA, ParticleSystem::cfra, DAG_id_tag_update(), DAG_scene_sort(), eModifierType_ParticleSystem, ListBase::first, ParticleSystem::flag, G, Object::id, MEM_callocN(), modifier_new(), modifier_unique_name(), Object::modifiers, ModifierData::name, ParticleSystem::name, ParticleSystem::next, NULL, OB_MESH, OB_RECALC_DATA, ParticleSystem::part, Object::particlesystem, ParticleSystem::pointcache, ParticleSystemModifierData::psys, PSYS_CURRENT, PSYS_ENABLED, psys_new_settings(), ParticleSystem::ptcaches, ParticleSystem::totpart, and Object::type.
Referenced by ED_object_modifier_add(), and particle_system_add_exec().
Definition at line 3435 of file particle.c.
References BLI_remlink(), DynamicPaintModifierData::brush, DAG_id_tag_update(), DAG_scene_sort(), eModifierType_DynamicPaint, eModifierType_Smoke, ListBase::first, SmokeModifierData::flow, G, Object::id, MOD_SMOKE_TYPE_FLOW, Object::mode, modifier_free(), Object::modifiers, modifiers_findByType(), NULL, OB_MODE_PARTICLE_EDIT, OB_RECALC_DATA, Object::particlesystem, DynamicPaintBrushSettings::psys, SmokeFlowSettings::psys, PSYS_CURRENT, psys_free(), psys_get_current(), psys_get_modifier(), and SmokeModifierData::type.
Referenced by particle_system_remove_exec().
static void offset_child | ( | ChildParticle * | cpa, |
ParticleKey * | par, | ||
float * | par_rot, | ||
ParticleKey * | child, | ||
float | flat, | ||
float | radius | ||
) | [static] |
Definition at line 2271 of file particle.c.
References add_v3_v3(), ParticleKey::co, copy_qt_qt(), copy_v3_v3(), ChildParticle::fuv, mul_qt_v3(), mul_v3_fl(), ParticleKey::rot, unit_qt(), and ParticleKey::vel.
Referenced by psys_get_particle_on_path(), psys_get_particle_state(), and psys_thread_create_path().
void precalc_guides | ( | ParticleSimulationData * | sim, |
ListBase * | effectors | ||
) |
Definition at line 2054 of file particle.c.
References ParticleKey::co, copy_v3_v3(), data, EffectorData::distance, effector_falloff(), ParticleSettings::effector_weights, ListBase::first, PartDeflect::forcefield, ParticleSettings::from, EffectorCache::guide_data, EffectorCache::guide_dir, EffectorCache::guide_loc, len_v3(), LOOP_PARTICLES, MEM_callocN(), mul_m4_v3(), mul_mat3_m4_v3(), EffectorCache::next, EffectorData::nor, ParticleSimulationData::ob, Object::obmat, p, ParticleSystem::part, PARTICLE_P, EffectorCache::pd, pd_point_from_particle(), PFIELD_GUIDE, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_particle_on_emitter(), state, GuideEffectorData::strength, sub_v3_v3v3(), ParticleSystem::totpart, GuideEffectorData::vec_to_point, EffectorData::vec_to_point, and ParticleKey::vel.
Referenced by psys_update_effectors().
static ParticleCacheKey** psys_alloc_path_cache_buffers | ( | ListBase * | bufs, |
int | tot, | ||
int | steps | ||
) | [static] |
Definition at line 124 of file particle.c.
References BLI_addtail(), LinkData::data, i, MAX2, MEM_callocN(), MIN2, and PATH_CACHE_BUF_SIZE.
Referenced by psys_cache_child_paths(), and psys_cache_edit_paths().
void psys_apply_hair_lattice | ( | Scene * | scene, |
Object * | ob, | ||
ParticleSystem * | psys | ||
) |
Definition at line 4528 of file particle.c.
References calc_latt_deform(), HairKey::co, ParticleSystemModifierData::dm, end_latt_deform(), ParticleSystem::flag, ParticleSettings::from, ParticleData::hair, invert_m4_m4(), ParticleSystem::lattice, mul_m4_v3(), NULL, ParticleSimulationData::ob, p, ParticleSystem::part, ParticleSystem::particles, ParticleSimulationData::psmd, ParticleSimulationData::psys, PSYS_EDITED, psys_get_lattice(), psys_get_modifier(), psys_mat_hair_to_global(), ParticleSimulationData::scene, ParticleData::totkey, and ParticleSystem::totpart.
Referenced by modifier_apply_obdata().
void psys_cache_child_paths | ( | ParticleSimulationData * | sim, |
float | cfra, | ||
int | editupdate | ||
) |
Definition at line 2745 of file particle.c.
References BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), ParticleSystem::childcache, ParticleSystem::childcachebufs, ParticleThread::ctx, exec_child_path_cache(), ParticleSystem::flag, free_child_path_cache(), i, ParticleThreadContext::parent_pass, ParticleSimulationData::psys, psys_alloc_path_cache_buffers(), PSYS_GLOBAL_HAIR, psys_threads_create(), psys_threads_free(), psys_threads_init_path(), ParticleSimulationData::scene, ParticleThreadContext::steps, threads, ParticleThread::tot, ParticleThreadContext::totchild, ParticleSystem::totchildcache, and ParticleThreadContext::totparent.
Referenced by psys_cache_edit_paths(), and psys_update_path_cache().
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 | ||
) |
Definition at line 2848 of file particle.c.
References ParticleSystem::flag, ParticleSystem::hair_out_dm, NULL, ParticleSystem::part, PART_HAIR, ToolSettings::particle, PARTICLE_P, PARTICLE_PSMD, ParticleSimulationData::psys, PSYS_HAIR_DYNAMICS, ParticleSimulationData::scene, Scene::toolsettings, and ParticleSettings::type.
Referenced by psys_update_path_cache().
float* psys_cache_vgroup | ( | DerivedMesh * | dm, |
ParticleSystem * | psys, | ||
int | vgroup | ||
) |
Definition at line 2289 of file particle.c.
References CD_MDEFORMVERT, defvert_find_weight(), DerivedMesh::getNumVerts, DerivedMesh::getVertDataArray, i, MEM_callocN(), ParticleSystem::vg_neg, and ParticleSystem::vgroup.
Referenced by distribute_threads_init_data(), and psys_threads_init_path().
int psys_check_edited | ( | ParticleSystem * | psys | ) |
Definition at line 293 of file particle.c.
References PointCache::edit, ParticleSystem::edit, PTCacheEdit::edited, ParticleSystem::flag, ParticleSystem::part, PART_HAIR, ParticleSystem::pointcache, PSYS_EDITED, and ParticleSettings::type.
int psys_check_enabled | ( | Object * | ob, |
ParticleSystem * | psys | ||
) |
Definition at line 267 of file particle.c.
References eModifierMode_Realtime, eModifierMode_Render, ParticleSystem::flag, ParticleSystem::frand, G, MEM_freeN(), ModifierData::mode, ParticleSystemModifierData::modifier, ParticleSystem::part, psys_create_frand(), PSYS_DELETE, PSYS_DISABLED, psys_get_modifier(), PSYS_RECALC_RESET, ParticleSystem::recalc, and ParticleSystem::renderdata.
Referenced by add_particles_to_effectors(), build_dag_object(), dag_object_time_update_flags(), deformVerts(), draw_new_particle_system(), dynamicPaint_doStep(), new_particle_duplilist(), object_handle_update(), particle_system_update(), pointdensity_cache_psys(), and render_new_particle_system().
void psys_check_group_weights | ( | ParticleSettings * | part | ) |
Definition at line 301 of file particle.c.
References BLI_addtail(), BLI_freelinkN(), BLI_freelistN(), ParticleDupliWeight::count, ParticleSettings::dup_group, ParticleSettings::dupliweights, ListBase::first, ParticleDupliWeight::flag, Group::gobject, MEM_callocN(), GroupObject::next, ParticleDupliWeight::next, GroupObject::ob, ParticleDupliWeight::ob, object_in_group(), PART_DRAW_GR, PART_DUPLIW_CURRENT, and ParticleSettings::ren_as.
Referenced by new_particle_duplilist().
ParticleSettings* psys_copy_settings | ( | ParticleSettings * | part | ) | [read] |
Definition at line 3572 of file particle.c.
References BLI_duplicatelist(), boid_copy_settings(), ParticleSettings::boids, copy_libblock(), ParticleSettings::dupliweights, ParticleSettings::effector_weights, ParticleSettings::fluid, ParticleSettings::id, id_us_plus(), MAX_MTEX, MEM_dupallocN(), MEM_mallocN(), ParticleSettings::mtex, ParticleSettings::pd, ParticleSettings::pd2, and MTex::tex.
Referenced by id_copy(), make_local_particlesettings(), new_particle_settings_exec(), and object_add_duplicate_internal().
static void psys_create_frand | ( | ParticleSystem * | psys | ) | [static] |
Definition at line 257 of file particle.c.
References BLI_frand(), BLI_srandom(), ParticleSystem::frand, i, MEM_callocN(), PSYS_FRAND_COUNT, and ParticleSystem::seed.
Referenced by psys_check_enabled().
void psys_disable_all | ( | Object * | ob | ) |
Definition at line 239 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_DISABLED.
Referenced by particle_intersect_dm().
void psys_enable_all | ( | Object * | ob | ) |
Definition at line 246 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, Object::particlesystem, and PSYS_DISABLED.
Referenced by particle_intersect_dm().
static void psys_face_mat | ( | Object * | ob, |
DerivedMesh * | dm, | ||
ParticleData * | pa, | ||
float | mat[][4], | ||
int | orco | ||
) | [static] |
Definition at line 3316 of file particle.c.
References CD_MFACE, CD_ORCO, CD_ORIGINDEX, CD_ORIGSPACE, copy_v3_v3(), Object::data, DM_get_vert_data_layer(), DMCACHE_NOTFOUND, DerivedMesh::getFaceData, DerivedMesh::getNumFaces, DerivedMesh::getVertCo, DerivedMesh::getVertDataArray, NULL, ParticleData::num, ParticleData::num_dmcache, transform_mesh_orco_verts(), triatomat(), unit_m4(), OrigSpaceFace::uv, MFace::v1, MFace::v2, and MFace::v3.
Referenced by psys_mat_hair_to_object(), psys_mat_hair_to_orco(), and psys_vec_rot_to_face().
Object* psys_find_object | ( | Scene * | scene, |
ParticleSystem * | psys | ||
) | [read] |
Definition at line 204 of file particle.c.
References Scene::base, ListBase::first, ParticleSystem::next, Base::next, NULL, Base::object, and Object::particlesystem.
void psys_find_parents | ( | ParticleSimulationData * | sim | ) |
Definition at line 2314 of file particle.c.
References BLI_kdtree_balance(), BLI_kdtree_find_nearest(), BLI_kdtree_free(), BLI_kdtree_insert(), BLI_kdtree_new(), ParticleSystem::child, ParticleSettings::child_nbr, co, DMCACHE_ISCHILD, ChildParticle::foffset, ChildParticle::fuv, G, NULL, ChildParticle::num, p, ChildParticle::parent, ParticleSettings::parents, ParticleSystem::part, PART_FROM_FACE, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_particle_on_emitter(), ParticleSettings::ren_child_nbr, and ParticleSystem::totchild.
Referenced by psys_update_path_cache().
void psys_free | ( | Object * | ob, |
ParticleSystem * | psys | ||
) |
Definition at line 524 of file particle.c.
References BKE_ptcache_free_list(), BLI_bvhtree_free(), BLI_freelistN(), BLI_kdtree_free(), ParticleSystem::bvhtree, ParticleSystem::child, ParticleSystem::edit, ParticleSystem::effectors, ELEM, ListBase::first, ParticleSystem::fluid_springs, ParticleSystem::frand, ParticleSystem::free_edit, free_hair(), ParticleSettings::id, MEM_freeN(), ParticleSystem::next, NULL, OB_DUPLIPARTS, ParticleSystem::part, PART_DRAW_GR, PART_DRAW_OB, Object::particlesystem, ParticleSystem::pdd, pdEndEffectors(), ParticleSystem::pointcache, psys_free_particles(), psys_free_path_cache(), psys_free_pdd(), ParticleSystem::ptcaches, ParticleSettings::ren_as, ParticleSystem::targets, ParticleSystem::totchild, Object::transflag, ParticleSystem::tree, and ID::us.
Referenced by object_free_particlesystems(), object_handle_update(), object_modifier_remove(), and object_remove_particle_system().
void psys_free_children | ( | ParticleSystem * | psys | ) |
Definition at line 467 of file particle.c.
References ParticleSystem::child, free_child_path_cache(), MEM_freeN(), NULL, and ParticleSystem::totchild.
Referenced by psys_update_path_cache(), and update_children().
void psys_free_particles | ( | ParticleSystem * | psys | ) |
Definition at line 477 of file particle.c.
References ParticleData::boid, ParticleData::keys, LOOP_PARTICLES, MEM_freeN(), NULL, ParticleSystem::part, PART_HAIR, PARTICLE_P, ParticleSystem::particles, ParticleSystem::totpart, and ParticleSettings::type.
Referenced by psys_free(), and psys_reset().
void psys_free_path_cache | ( | ParticleSystem * | psys, |
PTCacheEdit * | edit | ||
) |
Definition at line 452 of file particle.c.
References free_child_path_cache(), NULL, ParticleSystem::pathcache, PTCacheEdit::pathcache, ParticleSystem::pathcachebufs, PTCacheEdit::pathcachebufs, psys_free_path_cache_buffers(), ParticleSystem::totcached, and PTCacheEdit::totcached.
Referenced by brush_edit_apply(), connect_hair(), disconnect_hair(), particle_system_update(), PE_free_ptcache_edit(), psys_cache_edit_paths(), psys_free(), psys_render_restore(), psys_reset(), and psys_update_path_cache().
static void psys_free_path_cache_buffers | ( | ParticleCacheKey ** | cache, |
ListBase * | bufs | ||
) | [static] |
Definition at line 149 of file particle.c.
References BLI_freelistN(), LinkData::data, ListBase::first, MEM_freeN(), and LinkData::next.
Referenced by free_child_path_cache(), and psys_free_path_cache().
void psys_free_pdd | ( | ParticleSystem * | psys | ) |
Definition at line 500 of file particle.c.
References ParticleDrawData::cdata, MEM_freeN(), ParticleDrawData::ndata, NULL, ParticleSystem::pdd, ParticleDrawData::tot_vec_size, ParticleDrawData::totpoint, ParticleDrawData::vdata, and ParticleDrawData::vedata.
Referenced by draw_new_particle_system(), psys_free(), and realloc_particles().
void psys_free_settings | ( | ParticleSettings * | part | ) |
Definition at line 368 of file particle.c.
References BKE_free_animdata(), BLI_freelistN(), boid_free_settings(), ParticleSettings::boids, ParticleSettings::dupliweights, ParticleSettings::effector_weights, ParticleSettings::fluid, fluid_free_settings(), free_partdeflect(), Tex::id, ParticleSettings::id, MAX_MTEX, MEM_freeN(), ParticleSettings::mtex, ParticleSettings::pd, ParticleSettings::pd2, MTex::tex, and ID::us.
Referenced by free_libblock().
float psys_get_child_size | ( | ParticleSystem * | psys, |
ChildParticle * | cpa, | ||
float | UNUSEDcfra, | ||
float * | UNUSEDpa_time | ||
) |
Definition at line 3897 of file particle.c.
References ParticleSystem::child, ParticleSettings::childrandsize, ParticleSettings::childsize, ParticleSettings::childtype, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, PSYS_FRAND, ParticleData::size, ParticleSettings::size, and size().
float psys_get_child_time | ( | ParticleSystem * | psys, |
ChildParticle * | cpa, | ||
float | cfra, | ||
float * | birthtime, | ||
float * | dietime | ||
) |
Definition at line 3868 of file particle.c.
References ParticleSystem::child, ParticleSettings::childtype, ParticleData::lifetime, ParticleSettings::lifetime, ChildParticle::pa, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, ParticleSystem::particles, PSYS_FRAND, ParticleSettings::randlife, ParticleData::time, ChildParticle::w, and simple_enum_gen::w.
Referenced by draw_new_particle_system(), pointdensity_cache_psys(), psys_get_particle_on_path(), psys_get_particle_state(), and render_new_particle_system().
ParticleSystem* psys_get_current | ( | Object * | ob | ) | [read] |
Definition at line 165 of file particle.c.
References ListBase::first, ParticleSystem::flag, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
Referenced by buttons_context_path_particle(), buttons_texture_users_from_context(), clear_edited_exec(), draw_new_particle_system(), object_remove_particle_system(), and psys_in_edit_mode().
short psys_get_current_num | ( | Object * | ob | ) |
Definition at line 177 of file particle.c.
References ListBase::first, ParticleSystem::flag, i, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
float psys_get_dietime_from_cache | ( | PointCache * | cache, |
int | index | ||
) |
Definition at line 1128 of file particle.c.
References BKE_ptcache_mem_index_find(), PTCacheMem::frame, ListBase::last, PointCache::mem_cache, and PTCacheMem::prev.
Referenced by reset_particle().
void psys_get_dupli_path_transform | ( | ParticleSimulationData * | sim, |
ParticleData * | pa, | ||
ChildParticle * | cpa, | ||
ParticleCacheKey * | cache, | ||
float | mat[][4], | ||
float * | scale | ||
) |
Definition at line 4377 of file particle.c.
References axis_angle_to_quat(), ParticleSettings::childflat, ParticleCacheKey::co, copy_m3_m4(), copy_v3_v3(), cross_v3_v3v3(), DMCACHE_ISCHILD, dot_v3v3(), fabs(), ChildParticle::foffset, ParticleData::foffset, ParticleSettings::from, ChildParticle::fuv, ParticleData::fuv, Object::imat, len(), M_PI, mul_m3_v3(), mul_qt_v3(), normalize_v3(), NULL, ChildParticle::num, ParticleData::num, ParticleData::num_dmcache, ParticleSimulationData::ob, ChildParticle::pa, ParticleSystem::part, PART_CHILD_FACES, PART_FROM_FACE, PART_ROT_VEL, ParticleSystem::particles, ParticleSettings::phasefac, ParticleSimulationData::psmd, ParticleSimulationData::psys, PSYS_FRAND, psys_particle_on_emitter(), quat_to_mat4(), ParticleSettings::randphasefac, ParticleKey::rot, ParticleSettings::rotmode, ParticleData::state, ParticleCacheKey::steps, sub_v3_v3v3(), transpose_m3(), and unit_m4().
Referenced by new_particle_duplilist().
void psys_get_dupli_texture | ( | ParticleSystem * | psys, |
ParticleSettings * | part, | ||
ParticleSystemModifierData * | psmd, | ||
ParticleData * | pa, | ||
ChildParticle * | cpa, | ||
float * | uv, | ||
float * | orco | ||
) |
Definition at line 4328 of file particle.c.
References CD_MFACE, CD_MTFACE, ParticleSettings::childtype, CustomData_get_layer(), ParticleSystemModifierData::dm, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, DerivedMesh::faceData, ParticleData::foffset, ChildParticle::foffset, ParticleSettings::from, ParticleData::fuv, ChildParticle::fuv, DerivedMesh::getFaceData, DerivedMesh::getNumFaces, ParticleData::num, ChildParticle::num, ParticleData::num_dmcache, ChildParticle::pa, PART_CHILD_FACES, PART_FROM_FACE, ParticleSystem::particles, psys_interpolate_uvs(), psys_particle_on_emitter(), and MFace::v4.
Referenced by new_particle_duplilist().
void psys_get_from_key | ( | ParticleKey * | key, |
float * | loc, | ||
float * | vel, | ||
float * | rot, | ||
float * | time | ||
) |
Definition at line 3251 of file particle.c.
References ParticleKey::co, copy_qt_qt(), copy_v3_v3(), ParticleKey::rot, ParticleKey::time, and ParticleKey::vel.
Object* psys_get_lattice | ( | ParticleSimulationData * | sim | ) | [read] |
Definition at line 218 of file particle.c.
References eModifierType_Lattice, init_latt_deform(), ModifierData::next, NULL, ParticleSimulationData::ob, LatticeModifierData::object, ParticleSimulationData::psys, psys_get_modifier(), psys_in_edit_mode(), ParticleSimulationData::scene, and ModifierData::type.
Referenced by applyModifier(), cached_step(), draw_new_particle_system(), explodeMesh(), new_particle_duplilist(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_threads_init_path(), render_new_particle_system(), and save_hair().
ParticleSystemModifierData* psys_get_modifier | ( | Object * | ob, |
ParticleSystem * | psys | ||
) | [read] |
Definition at line 1791 of file particle.c.
References eModifierType_ParticleSystem, ListBase::first, Object::modifiers, ModifierData::next, NULL, ParticleSystemModifierData::psys, and ModifierData::type.
Referenced by applyModifier(), brush_add(), brush_edit_apply(), connect_hair(), createTransParticleVerts(), disconnect_hair(), draw_new_particle_system(), dupli_render_particle_set(), flushTransParticles(), foreach_mouse_hit_key(), lib_link_particlesystems(), new_particle_duplilist(), object_handle_update(), object_remove_particle_system(), particle_system_update(), PE_apply_mirror(), PE_create_particle_edit(), pe_deflect_emitter(), PE_lasso_select(), PE_minmax(), PE_mirror_x(), PE_update_mirror_cache(), psys_apply_hair_lattice(), psys_cache_edit_paths(), psys_check_enabled(), psys_get_lattice(), psys_render_restore(), psys_render_set(), recalc_emitter_field(), remove_doubles_exec(), remove_tagged_keys(), remove_tagged_particles(), render_new_particle_system(), and update_world_cos().
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 | ||
) |
Definition at line 4189 of file particle.c.
References ParticleKey::ave, BKE_curframe(), calc_latt_deform(), ParticleSystem::child, ParticleSettings::childflat, ParticleSettings::childrad, ParticleSettings::childtype, CLAMP(), ParticleKey::co, copy_particle_key(), ParticleData::dietime, do_child_modifiers(), ELEM, ParticleSettings::end, ParticleSettings::flag, ParticleSystem::flag, RenderData::frs_sec, ChildParticle::fuv, interp_qt_qtqt(), interp_v3_v3v3(), ParticleSystem::lattice, ParticleData::lifetime, ParticleSettings::lifetime, madd_v3_v3v3fl(), MIN2, mul_v3_fl(), NULL, offset_child(), p, ChildParticle::parent, ParticleSystem::part, PART_CHILD_FACES, PART_DIED, PART_PHYS_KEYED, PART_PHYS_NO, PART_UNBORN, ParticleSystem::particles, ParticleSettings::phystype, ParticleData::prev_state, ParticleSimulationData::psys, PSYS_FRAND, psys_get_child_time(), psys_get_particle_on_path(), psys_get_timestep(), psys_interpolate_particle(), PSYS_KEYED, Scene::r, ParticleKey::rot, ParticleSimulationData::scene, ParticleSettings::sta, ParticleData::state, ParticleData::time, ParticleKey::time, ParticleSystem::totchild, ParticleSystem::totpart, unit_m4(), and ParticleKey::vel.
Referenced by applyModifier(), draw_new_particle_system(), explodeMesh(), get_effector_data(), new_particle_duplilist(), pointdensity_cache_psys(), render_new_particle_system(), and set_keyed_keys().
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 | ) |
Definition at line 3864 of file particle.c.
References ParticleSystem::part, ParticleSimulationData::psys, and ParticleSettings::timetweak.
Referenced by basic_integrate(), brush_add(), collision_check(), draw_new_particle_system(), dynamics_step(), pd_point_from_particle(), psys_get_particle_state(), and sph_integrate().
int psys_in_edit_mode | ( | Scene * | scene, |
ParticleSystem * | psys | ||
) |
Definition at line 253 of file particle.c.
References Scene::basact, PointCache::edit, ParticleSystem::edit, Object::mode, OB_MODE_PARTICLE_EDIT, Base::object, ParticleSystem::pointcache, psys_get_current(), and ParticleSystem::renderdata.
Referenced by draw_new_particle_system(), psys_get_lattice(), psys_get_particle_on_path(), psys_thread_create_path(), psys_threads_init_path(), and psys_update_path_cache().
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 | ||
) |
Definition at line 1372 of file particle.c.
References MVert::co, copy_v3_v3(), MFace::flag, interp_v3_v3v3v3(), interp_v3_v3v3v3v3(), map_to_sphere(), ME_SMOOTH, MVert::no, normal_quad_v3(), normal_short_to_float_v3(), normal_tri_v3(), sub_v3_v3v3(), MTFace::uv, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by distribute_threads_exec(), and psys_particle_on_dm().
Definition at line 1512 of file particle.c.
void psys_interpolate_particle | ( | short | type, |
ParticleKey | keys[4], | ||
float | dt, | ||
ParticleKey * | result, | ||
int | velocity | ||
) |
Definition at line 1018 of file particle.c.
References co, ParticleKey::co, interp_cubic_v3(), interp_v3_v3v3v3v3(), key_curve_position_weights(), sub_v3_v3v3(), and ParticleKey::vel.
Referenced by do_particle_interpolation(), psys_get_particle_state(), ptcache_cloth_interpolate(), ptcache_particle_interpolate(), and ptcache_softbody_interpolate().
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] |
Definition at line 1537 of file particle.c.
References CD_MFACE, DerivedMesh::getFaceData, interpolate_particle_value(), PART_FROM_FACE, PART_FROM_VERT, PART_FROM_VOLUME, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by get_child_modifier_parameters(), and psys_particle_value_from_verts().
void psys_make_billboard | ( | ParticleBillboardData * | bb, |
float | xvec[3], | ||
float | yvec[3], | ||
float | zvec[3], | ||
float | center[3] | ||
) |
Definition at line 4443 of file particle.c.
References add_v3_v3(), ParticleBillboardData::align, copy_v3_v3(), cos(), cross_v3_v3v3(), dot_v3v3(), ParticleBillboardData::lock, M_PI, madd_v3_v3fl(), madd_v3_v3v3fl(), mul_v3_fl(), normalize_v3(), normalize_v3_v3(), ParticleBillboardData::ob, Object::obmat, ParticleBillboardData::offset, PART_BB_VEL, PART_BB_VIEW, sin(), ParticleBillboardData::size, sub_v3_v3v3(), ParticleBillboardData::tilt, ParticleBillboardData::vec, ParticleBillboardData::vel, and zero_v3().
Referenced by draw_particle(), and particle_billboard().
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] |
Definition at line 1654 of file particle.c.
References CD_MFACE, CD_ORIGSPACE, copy_v4_v4(), DerivedMesh::deformedOnly, DMCACHE_ISCHILD, DMCACHE_NOTFOUND, DerivedMesh::getFaceData, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, i, NULL, PART_FROM_VERT, psys_origspace_to_w(), and MFace::v4.
Referenced by psys_particle_on_dm(), and psys_particle_value_from_verts().
void psys_mat_hair_to_global | ( | Object * | ob, |
DerivedMesh * | dm, | ||
short | from, | ||
ParticleData * | pa, | ||
float | hairmat[][4] | ||
) |
Definition at line 3380 of file particle.c.
References mult_m4_m4m4(), Object::obmat, and psys_mat_hair_to_object().
Referenced by brush_add(), brush_puff(), connect_hair(), createTransParticleVerts(), disconnect_hair(), flushTransParticles(), foreach_mouse_hit_key(), PE_lasso_select(), PE_minmax(), psys_apply_hair_lattice(), psys_cache_edit_paths(), psys_get_particle_on_path(), psys_thread_create_path(), and update_world_cos().
void psys_mat_hair_to_object | ( | Object * | UNUSEDob, |
DerivedMesh * | dm, | ||
short | from, | ||
ParticleData * | pa, | ||
float | hairmat[][4] | ||
) |
Definition at line 3349 of file particle.c.
References copy_v3_v3(), ParticleData::foffset, ParticleData::fuv, ParticleData::num, ParticleData::num_dmcache, psys_face_mat(), and psys_particle_on_dm().
void psys_mat_hair_to_orco | ( | Object * | ob, |
DerivedMesh * | dm, | ||
short | from, | ||
ParticleData * | pa, | ||
float | hairmat[][4] | ||
) |
Definition at line 3358 of file particle.c.
References CD_ORIGINDEX, copy_v3_v3(), Object::data, DM_get_vert_data_layer(), ParticleData::foffset, ParticleData::fuv, ParticleData::num, ParticleData::num_dmcache, psys_face_mat(), psys_particle_on_dm(), and transform_mesh_orco_verts().
Referenced by PE_mirror_particle(), and PE_update_mirror_cache().
ParticleSettings* psys_new_settings | ( | const char * | name, |
Main * | main | ||
) | [read] |
Definition at line 3558 of file particle.c.
References alloc_libblock(), default_particle_settings(), G, ID_PA, NULL, and Main::particle.
Referenced by do_versions(), new_particle_settings_exec(), and object_add_particle_system().
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 | ||
) |
Definition at line 1587 of file particle.c.
References CD_MFACE, CD_ORIGINDEX, CD_ORIGSPACE, Object::data, DMCACHE_NOTFOUND, GET_INT_FROM_POINTER, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, isect_point_quad_v2(), isect_point_tri_v2(), LinkNode::link, LinkNode::next, NULL, psys_w_to_origspace(), Mesh::totface, and MFace::v4.
Referenced by brush_add(), connect_hair(), PE_mirror_x(), and psys_calc_dmcache().
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] | ||
) |
Definition at line 1714 of file particle.c.
References add_v3_v3(), CD_MFACE, CD_MTFACE, CD_MVERT, CD_ORCO, copy_v3_v3(), CustomData_get_layer(), DerivedMesh::faceData, DerivedMesh::getFaceData, DerivedMesh::getVertCo, DerivedMesh::getVertDataArray, DerivedMesh::getVertNo, mul_v3_fl(), normalize_v3(), PART_FROM_VERT, PART_FROM_VOLUME, psys_interpolate_face(), and psys_map_index_on_dm().
Referenced by brush_add(), distribute_threads_exec(), distribute_threads_init_data(), psys_mat_hair_to_object(), psys_mat_hair_to_orco(), and psys_particle_on_emitter().
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 | ||
) |
Definition at line 1836 of file particle.c.
References copy_v3_v3(), ParticleSettings::distr, ParticleSystemModifierData::dm, ParticleSettings::from, ParticleSystem::part, PART_DISTR_GRID, PART_FROM_VERT, ParticleSystemModifierData::psys, psys_particle_on_dm(), and psys_particle_on_shape().
Referenced by createFacepa(), precalc_guides(), psys_find_parents(), psys_get_birth_coordinates(), psys_get_dupli_path_transform(), psys_get_dupli_texture(), psys_get_particle_on_path(), psys_get_texture(), psys_thread_create_path(), and render_new_particle_system().
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 | ||
) |
Definition at line 1780 of file particle.c.
References ParticleData::foffset, ParticleData::fuv, ParticleData::num, ParticleData::num_dmcache, psys_interpolate_value_from_verts(), and psys_map_index_on_dm().
static float psys_render_projected_area | ( | ParticleSystem * | psys, |
const float | center[3], | ||
float | area, | ||
double | vprate, | ||
float * | viewport | ||
) | [static] |
Definition at line 626 of file particle.c.
References co, copy_v3_v3(), data, M_PI, mul_m4_v4(), normalize_v3_v3(), ortho_basis_v3v3_v3(), psys_render_viewport_falloff(), ParticleSystem::renderdata, sqrt(), sqrtf, ParticleRenderData::viewmat, simple_enum_gen::w, ParticleRenderData::winmat, ParticleRenderData::winx, and ParticleRenderData::winy.
Referenced by psys_render_simplify_distribution().
void psys_render_restore | ( | Object * | ob, |
ParticleSystem * | psys | ||
) |
Definition at line 728 of file particle.c.
References ParticleRenderData::child, ParticleSystem::child, ParticleRenderData::childcache, ParticleSystem::childcache, ParticleRenderData::childcachebufs, ParticleSystem::childcachebufs, data, ParticleRenderData::dm, ParticleSystemModifierData::dm, ParticleRenderData::elems, eParticleSystemFlag_psys_updated, ListBase::first, ParticleSystemModifierData::flag, ListBase::last, MEM_freeN(), DerivedMesh::needsFree, NULL, ParticleRenderData::pathcache, ParticleSystem::pathcache, ParticleRenderData::pathcachebufs, ParticleSystem::pathcachebufs, psys_calc_dmcache(), psys_free_path_cache(), psys_get_modifier(), DerivedMesh::release, ParticleSystem::renderdata, ParticleRenderData::totcached, ParticleSystem::totcached, ParticleRenderData::totchild, ParticleSystem::totchild, ParticleRenderData::totchildcache, ParticleSystem::totchildcache, ParticleRenderData::totdmedge, ParticleSystemModifierData::totdmedge, ParticleRenderData::totdmface, ParticleSystemModifierData::totdmface, ParticleRenderData::totdmvert, and ParticleSystemModifierData::totdmvert.
Referenced by add_render_object(), dupli_render_particle_set(), and pointdensity_cache_psys().
void psys_render_set | ( | Object * | ob, |
ParticleSystem * | psys, | ||
float | viewmat[][4], | ||
float | winmat[][4], | ||
int | winx, | ||
int | winy, | ||
int | timeoffset | ||
) |
Definition at line 677 of file particle.c.
References CDDM_copy(), ParticleSystem::child, ParticleRenderData::child, ParticleSystem::childcache, ParticleRenderData::childcache, ParticleSystem::childcachebufs, ParticleRenderData::childcachebufs, copy_m4_m4(), data, ParticleSettings::disp, ParticleRenderData::dm, ParticleSystemModifierData::dm, ListBase::first, G, ListBase::last, ParticleRenderData::mat, MEM_callocN(), mult_m4_m4m4(), NULL, Object::obmat, ParticleSystem::part, PART_HAIR, ParticleSystem::pathcache, ParticleRenderData::pathcache, ParticleSystem::pathcachebufs, ParticleRenderData::pathcachebufs, psys_get_modifier(), PSYS_RECALC_RESET, ParticleSystem::recalc, ParticleSystem::renderdata, ParticleRenderData::timeoffset, ParticleSystem::totcached, ParticleRenderData::totcached, ParticleSystem::totchild, ParticleRenderData::totchild, ParticleSystem::totchildcache, ParticleRenderData::totchildcache, ParticleSystemModifierData::totdmedge, ParticleRenderData::totdmedge, ParticleSystemModifierData::totdmface, ParticleRenderData::totdmface, ParticleSystemModifierData::totdmvert, ParticleRenderData::totdmvert, ParticleSettings::type, ParticleRenderData::viewmat, ParticleRenderData::winmat, ParticleRenderData::winx, and ParticleRenderData::winy.
Referenced by add_render_object(), dupli_render_particle_set(), and pointdensity_cache_psys().
int psys_render_simplify_distribution | ( | ParticleThreadContext * | ctx, |
int | tot | ||
) |
Definition at line 777 of file particle.c.
References add_v3_v3(), area_quad_v3(), area_tri_v3(), CD_ORIGINDEX, MVert::co, copy_v3_v3(), ParticleRenderElem::curchild, data, Object::data, ParticleThreadContext::dm, ParticleRenderData::dosimplify, ParticleSettings::draw, ParticleRenderData::elems, DerivedMesh::getFaceArray, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getVertArray, ParticleThreadContext::index, ParticleRenderElem::lambda, log(), MAX2, MEM_callocN(), MEM_freeN(), mesh_get_texspace(), MIN2, mul_v3_fl(), ParticleSimulationData::ob, ParticleRenderData::origindex, ParticleSystem::part, PART_DRAW_PATH, PART_DRAW_REN_STRAND, PART_SIMPLIFY_ENABLE, PART_SIMPLIFY_VIEWPORT, pow(), powf, ParticleSimulationData::psys, psys_render_projected_area(), ParticleRenderElem::reduce, ParticleSettings::ren_as, ParticleSystem::renderdata, ParticleRenderElem::scalemax, ParticleRenderElem::scalemin, ParticleThreadContext::sim, ParticleSettings::simplify_flag, ParticleSettings::simplify_rate, ParticleSettings::simplify_refsize, ParticleSettings::simplify_transition, ParticleSettings::simplify_viewport, size(), ParticleThreadContext::skip, sqrt(), ParticleRenderElem::t, ParticleRenderData::timeoffset, ParticleRenderElem::totchild, Mesh::totface, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by distribute_threads_init_data().
int psys_render_simplify_params | ( | ParticleSystem * | psys, |
ChildParticle * | cpa, | ||
float * | params | ||
) |
Definition at line 948 of file particle.c.
References ParticleRenderElem::curchild, data, ParticleRenderData::dosimplify, ParticleRenderData::elems, ParticleRenderElem::lambda, ChildParticle::num, ParticleRenderData::origindex, ParticleSystem::part, PART_SIMPLIFY_ENABLE, ParticleRenderElem::reduce, ParticleSystem::renderdata, ParticleRenderElem::scalemax, ParticleRenderElem::scalemin, ParticleSettings::simplify_flag, ParticleRenderElem::t, ParticleRenderElem::totchild, and simple_enum_gen::w.
Referenced by render_new_particle_system().
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 | ||
) |
Definition at line 190 of file particle.c.
References ListBase::first, ParticleSystem::flag, i, ParticleSystem::next, NULL, Object::particlesystem, and PSYS_CURRENT.
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] |
Definition at line 2376 of file particle.c.
References ParticleThreadContext::between, ParticleThreadContext::cfra, ParticleSettings::child_nbr, ParticleSettings::childtype, ParticleThread::ctx, ParticleSettings::disp, ParticleThreadContext::dm, ParticleEditSettings::draw_step, ParticleSettings::draw_step, ParticleSystem::edit, ParticleThreadContext::editupdate, ParticleSettings::flag, ParticleEditSettings::flag, G, i, ParticleSystem::lattice, MIN2, NULL, ParticleThreadContext::parent_pass, ParticleSettings::parents, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_FACES, ToolSettings::particle, PE_DRAW_PART, pow(), ParticleSimulationData::psys, psys_cache_vgroup(), psys_get_lattice(), psys_in_edit_mode(), PSYS_VG_CLUMP, PSYS_VG_EFFECTOR, PSYS_VG_KINK, PSYS_VG_LENGTH, PSYS_VG_ROUGH1, PSYS_VG_ROUGH2, PSYS_VG_ROUGHE, ParticleSettings::ren_child_nbr, ParticleSettings::ren_step, ParticleSystem::renderdata, rng_new(), ParticleThread::rng_path, ParticleSystem::seed, ParticleThreadContext::sim, ParticleThreadContext::steps, Scene::toolsettings, ParticleThread::tot, ParticleThreadContext::totchild, ParticleSystem::totchild, ParticleThreadContext::totparent, ParticleThreadContext::vg_clump, ParticleThreadContext::vg_effector, ParticleThreadContext::vg_kink, ParticleThreadContext::vg_length, ParticleThreadContext::vg_rough1, ParticleThreadContext::vg_rough2, and ParticleThreadContext::vg_roughe.
Referenced by psys_cache_child_paths().
int psys_uses_gravity | ( | ParticleSimulationData * | sim | ) |
Definition at line 355 of file particle.c.
References ParticleSettings::effector_weights, PhysicsSettings::flag, EffectorWeights::global_gravity, ParticleSystem::part, PHYS_GLOBAL_GRAVITY, Scene::physics_settings, ParticleSimulationData::psys, and ParticleSimulationData::scene.
Referenced by basic_integrate(), boid_body(), rule_average_speed(), and sph_solver_init().
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().