Blender
V3.3
|
#include "BLI_math.h"
#include "BLI_noise.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "BKE_colortools.h"
#include "BKE_particle.h"
#include "particle_private.h"
Go to the source code of this file.
Classes | |
struct | ParticlePathIterator |
struct | ParticlePathModifier |
Typedefs | |
typedef struct ParticlePathIterator | ParticlePathIterator |
typedef struct ParticlePathModifier | ParticlePathModifier |
Functions | |
static void | psys_path_iter_get (ParticlePathIterator *iter, ParticleCacheKey *keys, int totkeys, ParticleCacheKey *parent, int index) |
static void | do_kink_spiral_deform (ParticleKey *state, const float dir[3], const float kink[3], float time, float freq, float shape, float amplitude, const float spiral_start[3]) |
static void | do_kink_spiral (ParticleThreadContext *ctx, ParticleTexture *ptex, const float parent_orco[3], ChildParticle *cpa, const float orco[3], float hairmat[4][4], ParticleCacheKey *keys, ParticleCacheKey *parent_keys, int *r_totkeys, float *r_max_length) |
static bool | check_path_length (int k, ParticleCacheKey *keys, ParticleCacheKey *key, float max_length, float step_length, float *cur_length, float dvec[3]) |
void | psys_apply_child_modifiers (ParticleThreadContext *ctx, struct ListBase *modifiers, ChildParticle *cpa, ParticleTexture *ptex, const float orco[3], float hairmat[4][4], ParticleCacheKey *keys, ParticleCacheKey *parent_keys, const float parent_orco[3]) |
void | do_kink (ParticleKey *state, const float par_co[3], const float par_vel[3], const float par_rot[4], float time, float freq, float shape, float amplitude, float flat, short type, short axis, float obmat[4][4], int smooth_start) |
static float | do_clump_level (float result[3], const float co[3], const float par_co[3], float time, float clumpfac, float clumppow, float pa_clump, CurveMapping *clumpcurve) |
float | do_clump (ParticleKey *state, const float par_co[3], float time, const float orco_offset[3], float clumpfac, float clumppow, float pa_clump, bool use_clump_noise, float clump_noise_size, CurveMapping *clumpcurve) |
static void | do_rough (const float loc[3], const float mat[4][4], float t, float fac, float size, float thres, ParticleKey *state) |
static void | do_rough_end (const float loc[3], const float mat[4][4], float t, float fac, float shape, ParticleKey *state) |
static void | do_rough_curve (const float loc[3], const float mat[4][4], float time, float fac, float size, CurveMapping *roughcurve, ParticleKey *state) |
static int | twist_num_segments (const ParticleChildModifierContext *modifier_ctx) |
static void | twist_get_axis (const ParticleChildModifierContext *modifier_ctx, const float time, float r_axis[3]) |
static float | BKE_curvemapping_integrate_clamped (CurveMapping *curve, float start, float end, float step) |
static void | do_twist (const ParticleChildModifierContext *modifier_ctx, ParticleKey *state, const float time) |
void | do_child_modifiers (const ParticleChildModifierContext *modifier_ctx, float mat[4][4], ParticleKey *state, float t) |
typedef struct ParticlePathIterator ParticlePathIterator |
typedef struct ParticlePathModifier ParticlePathModifier |
|
static |
Definition at line 731 of file particle_child.c.
References BKE_curvemapping_evaluateF(), clamp_f(), curve, x, and y.
Referenced by do_twist().
|
static |
Definition at line 271 of file particle_child.c.
References add_v3_v3v3(), ParticleCacheKey::co, mul_v3_fl(), ParticleCacheKey::segments, and sub_v3_v3v3().
Referenced by psys_apply_child_modifiers().
void do_child_modifiers | ( | const ParticleChildModifierContext * | modifier_ctx, |
float | mat[4][4], | ||
ParticleKey * | state, | ||
float | t | ||
) |
Definition at line 798 of file particle_child.c.
References ParticleSystem::child, ParticleSettings::child_flag, ParticleSettings::childtype, ParticleTexture::clump, ParticleSettings::clump_noise_size, ParticleThreadContext::clumpcurve, ParticleSettings::clumpcurve, ParticleSettings::clumpfac, ParticleSettings::clumppow, ParticleChildModifierContext::cpa, ParticleSimulationData::depsgraph, do_clump(), do_guides(), do_kink(), do_rough(), do_rough_curve(), do_rough_end(), do_twist(), ParticleSystem::effectors, ParticleSettings::flag, ParticleSettings::kink, ParticleTexture::kink_amp, ParticleSettings::kink_amp, ParticleSettings::kink_amp_clump, ParticleSettings::kink_axis, ParticleSettings::kink_flat, ParticleTexture::kink_freq, ParticleSettings::kink_freq, ParticleSettings::kink_shape, NULL, ParticleSimulationData::ob, Object::obmat, ParticleChildModifierContext::orco, ParticleChildModifierContext::par_co, ParticleChildModifierContext::par_orco, ParticleChildModifierContext::par_rot, ParticleChildModifierContext::par_vel, ChildParticle::parent, ParticleSystem::part, PART_CHILD_EFFECT, PART_CHILD_FACES, PART_CHILD_USE_CLUMP_CURVE, PART_CHILD_USE_CLUMP_NOISE, PART_CHILD_USE_ROUGH_CURVE, ParticleSimulationData::psys, psys_frand_vec(), ParticleChildModifierContext::ptex, ParticleTexture::rough1, ParticleSettings::rough1, ParticleSettings::rough1_size, ParticleTexture::rough2, ParticleSettings::rough2, ParticleSettings::rough2_size, ParticleSettings::rough2_thres, ParticleSettings::rough_end, ParticleSettings::rough_end_shape, ParticleThreadContext::roughcurve, ParticleSettings::roughcurve, ParticleTexture::roughe, ParticleChildModifierContext::sim, state, sub_v3_v3v3(), t, and ParticleChildModifierContext::thread_ctx.
Referenced by do_kink_spiral(), psys_apply_child_modifiers(), psys_get_particle_on_path(), and psys_get_particle_state().
float do_clump | ( | ParticleKey * | state, |
const float | par_co[3], | ||
float | time, | ||
const float | orco_offset[3], | ||
float | clumpfac, | ||
float | clumppow, | ||
float | pa_clump, | ||
bool | use_clump_noise, | ||
float | clump_noise_size, | ||
CurveMapping * | clumpcurve | ||
) |
Definition at line 606 of file particle_child.c.
References add_v3_v3v3(), BLI_noise_voronoi(), center, do_clump_level(), mul_v3_fl(), mul_v3_v3fl(), state, and time.
Referenced by do_child_modifiers(), and do_guides().
|
static |
Definition at line 566 of file particle_child.c.
References BKE_curvemapping_evaluateF(), clamp_f(), double(), float(), interp_v3_v3v3(), pow(), result, and time.
Referenced by do_clump().
void do_kink | ( | ParticleKey * | state, |
const float | par_co[3], | ||
const float | par_vel[3], | ||
const float | par_rot[4], | ||
float | time, | ||
float | freq, | ||
float | shape, | ||
float | amplitude, | ||
float | flat, | ||
short | type, | ||
short | axis, | ||
float | obmat[4][4], | ||
int | smooth_start | ||
) |
Definition at line 394 of file particle_child.c.
References add_v3_v3(), add_v3_v3v3(), axis_angle_to_quat(), CLAMP, copy_v3_v3(), cosf, dot_v3v3(), ELEM, fabsf, flat(), float(), interp_v3_v3v3(), blender::math::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(), PART_KINK_BRAID, PART_KINK_CURL, PART_KINK_NO, PART_KINK_RADIAL, PART_KINK_SPIRAL, PART_KINK_WAVE, pow(), project_v3_v3v3(), q1, result, sinf, sqrt(), state, sub_v3_v3(), sub_v3_v3v3(), t, time, and type.
Referenced by do_child_modifiers(), and do_guides().
|
static |
Definition at line 123 of file particle_child.c.
References Freestyle::a, axis_angle_normalized_to_mat3(), ParticleSystem::child, ParticleSystem::child_seed, ParticleCacheKey::co, ParticleChildModifierContext::cpa, do_child_modifiers(), do_kink_spiral_deform(), ParticleThreadContext::extra_segments, float(), interp_qt_qtqt(), interp_v3_v3v3(), ParticleSettings::kink, ParticleTexture::kink_amp, ParticleSettings::kink_amp, ParticleSettings::kink_amp_random, ParticleSettings::kink_axis, ParticleSettings::kink_axis_random, ParticleTexture::kink_freq, ParticleSettings::kink_freq, ParticleSettings::kink_shape, len_v3v3(), ParticleTexture::length, M_PI, mul_m3_v3(), mul_mat3_m4_v3(), normalize_v3(), NULL, ParticleSimulationData::ob, Object::obmat, ParticleChildModifierContext::orco, ParticleChildModifierContext::par_co, ParticleChildModifierContext::par_orco, ParticleChildModifierContext::par_rot, ParticleChildModifierContext::par_vel, ParticleChildModifierContext::parent_keys, ParticleSystem::part, project_v3_v3v3(), ParticleSimulationData::psys, psys_frand(), psys_path_iter_get(), ParticleChildModifierContext::ptex, rot, ParticleCacheKey::rot, seed, ParticleThreadContext::segments, ParticleThreadContext::sim, ParticleChildModifierContext::sim, sub_v3_v3v3(), ParticleChildModifierContext::thread_ctx, ParticleCacheKey::vel, and zero_v3().
Referenced by psys_apply_child_modifiers().
|
static |
Definition at line 65 of file particle_child.c.
References add_v3_v3v3(), atanf, axis_angle_normalized_to_mat3(), usdtokens::b(), CLAMP, copy_v3_v3(), cross_v3_v3v3(), expf, float(), M_PI, M_PI_2, madd_v3_v3fl(), mul_m3_v3(), mul_v3_v3fl(), normalize_v3(), result, rot, sqrtf, state, and time.
Referenced by do_kink_spiral().
|
static |
Definition at line 637 of file particle_child.c.
References BLI_noise_generic_turbulence(), copy_v3_v3(), fabsf, madd_v3_v3fl(), mul_v3_fl(), size(), state, and t.
Referenced by do_child_modifiers().
|
static |
Definition at line 681 of file particle_child.c.
References BKE_curvemapping_evaluateF(), BLI_noise_generic_turbulence(), clamp_f(), copy_v3_v3(), madd_v3_v3fl(), mul_v3_fl(), size(), state, and time.
Referenced by do_child_modifiers().
|
static |
Definition at line 665 of file particle_child.c.
References copy_v2_v2(), float(), madd_v3_v3fl(), mul_v2_fl(), pow(), state, and t.
Referenced by do_child_modifiers().
|
static |
Definition at line 748 of file particle_child.c.
References add_v3_v3(), angle(), BKE_curvemapping_integrate_clamped(), ParticleSettings::child_flag, ParticleSettings::childtype, M_PI, NULL, ParticleChildModifierContext::par_co, ParticleChildModifierContext::parent_keys, ParticleSystem::part, PART_CHILD_PARTICLES, PART_CHILD_USE_TWIST_CURVE, ParticleSimulationData::psys, ParticleChildModifierContext::ptex, rotate_v3_v3v3fl(), ParticleChildModifierContext::sim, state, sub_v3_v3v3(), ParticleChildModifierContext::thread_ctx, time, ParticleTexture::twist, ParticleSettings::twist, twist_get_axis(), twist_num_segments(), ParticleThreadContext::twistcurve, and ParticleSettings::twistcurve.
Referenced by do_child_modifiers().
void psys_apply_child_modifiers | ( | ParticleThreadContext * | ctx, |
struct ListBase * | modifiers, | ||
ChildParticle * | cpa, | ||
ParticleTexture * | ptex, | ||
const float | orco[3], | ||
float | hairmat[4][4], | ||
ParticleCacheKey * | keys, | ||
ParticleCacheKey * | parent_keys, | ||
const float | parent_orco[3] | ||
) |
Definition at line 292 of file particle_child.c.
References check_path_length(), ParticleCacheKey::co, ParticleKey::co, ParticleCacheKey::col, copy_v3_v3(), ParticleChildModifierContext::cpa, do_child_modifiers(), do_kink_spiral(), ParticleSettings::draw_col, ELEM, float(), ParticleSettings::kink, ParticleTexture::length, ParticleThreadContext::ma, mod(), mul_v3_fl(), NULL, ParticleChildModifierContext::orco, ParticleChildModifierContext::par_co, ParticleChildModifierContext::par_orco, ParticleChildModifierContext::par_rot, ParticleChildModifierContext::par_vel, ParticlePathIterator::parent_key, ParticleChildModifierContext::parent_keys, ParticlePathIterator::parent_rotation, ParticleSystem::part, PART_DRAW_COL_MAT, PART_KINK_SPIRAL, ParticleSimulationData::psys, psys_path_iter_get(), ParticleChildModifierContext::ptex, Material::r, ParticleCacheKey::segments, ParticleThreadContext::segments, ParticleThreadContext::sim, ParticleChildModifierContext::sim, sub_v3_v3v3(), ParticleChildModifierContext::thread_ctx, ParticlePathIterator::time, ParticleCacheKey::vel, ParticleKey::vel, and void.
Referenced by psys_thread_create_path().
|
static |
Definition at line 30 of file particle_child.c.
References BLI_assert, copy_qt_qt(), float(), ParticlePathIterator::index, ParticlePathIterator::key, mul_qt_qtqt(), NULL, ParticlePathIterator::parent_key, ParticlePathIterator::parent_rotation, ParticleCacheKey::rot, ParticlePathIterator::time, and unit_qt().
Referenced by do_kink_spiral(), and psys_apply_child_modifiers().
|
static |
Definition at line 715 of file particle_child.c.
References clamp_i(), ParticleCacheKey::co, Material::index, ParticleChildModifierContext::parent_keys, sub_v3_v3v3(), time, and twist_num_segments().
Referenced by do_twist().
|
static |
Definition at line 709 of file particle_child.c.
References ParticleSettings::draw_step, NULL, ParticleSystem::part, ParticleSimulationData::psys, ParticleThreadContext::segments, ParticleChildModifierContext::sim, and ParticleChildModifierContext::thread_ctx.
Referenced by do_twist(), and twist_get_axis().