Blender V5.0
particle_child.cc File Reference
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_noise.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "BKE_colortools.hh"
#include "BKE_particle.h"
#include "particle_private.h"

Go to the source code of this file.

Classes

struct  ParticlePathIterator

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, ListBase *, 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, const 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, const 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, const 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 (const 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)

Function Documentation

◆ BKE_curvemapping_integrate_clamped()

float BKE_curvemapping_integrate_clamped ( const CurveMapping * curve,
float start,
float end,
float step )
static

Definition at line 729 of file particle_child.cc.

References BKE_curvemapping_evaluateF(), clamp_f(), step, x, and y.

Referenced by do_twist().

◆ check_path_length()

bool check_path_length ( int k,
ParticleCacheKey * keys,
ParticleCacheKey * key,
float max_length,
float step_length,
float * cur_length,
float dvec[3] )
static

◆ do_child_modifiers()

void do_child_modifiers ( const ParticleChildModifierContext * modifier_ctx,
float mat[4][4],
ParticleKey * state,
float t )

Definition at line 796 of file particle_child.cc.

References ParticleSystem::child, ParticleSettings::child_flag, ParticleSettings::childtype, ParticleTexture::clump, ParticleSettings::clump_noise_size, ParticleSettings::clumpcurve, ParticleThreadContext::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, i, ParticleSettings::kink, ParticleSettings::kink_amp, ParticleTexture::kink_amp, ParticleSettings::kink_amp_clump, ParticleSettings::kink_axis, ParticleSettings::kink_flat, ParticleSettings::kink_freq, ParticleTexture::kink_freq, ParticleSettings::kink_shape, ParticleSimulationData::ob, 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, ParticleSettings::rough1, ParticleTexture::rough1, ParticleSettings::rough1_size, ParticleSettings::rough2, ParticleTexture::rough2, ParticleSettings::rough2_size, ParticleSettings::rough2_thres, ParticleSettings::rough_end, ParticleSettings::rough_end_shape, ParticleSettings::roughcurve, ParticleThreadContext::roughcurve, ParticleTexture::roughe, ParticleChildModifierContext::sim, state, sub_v3_v3v3(), and ParticleChildModifierContext::thread_ctx.

Referenced by do_kink_spiral(), psys_apply_child_modifiers(), psys_get_particle_on_path(), and psys_get_particle_state().

◆ do_clump()

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,
const CurveMapping * clumpcurve )

◆ do_clump_level()

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,
const CurveMapping * clumpcurve )
static

Definition at line 558 of file particle_child.cc.

References BKE_curvemapping_evaluateF(), clamp_f(), float, interp_v3_v3v3(), pow, and result.

Referenced by do_clump().

◆ do_kink()

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,
const float obmat[4][4],
int smooth_start )

◆ do_kink_spiral()

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

◆ do_kink_spiral_deform()

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

◆ do_rough()

void do_rough ( const float loc[3],
const float mat[4][4],
float t,
float fac,
float size,
float thres,
ParticleKey * state )
static

◆ do_rough_curve()

void do_rough_curve ( const float loc[3],
const float mat[4][4],
float time,
float fac,
float size,
CurveMapping * roughcurve,
ParticleKey * state )
static

◆ do_rough_end()

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

Definition at line 660 of file particle_child.cc.

References copy_v2_v2(), float, madd_v3_v3fl(), mul_v2_fl(), pow, and state.

Referenced by do_child_modifiers().

◆ do_twist()

◆ psys_apply_child_modifiers()

◆ psys_path_iter_get()

◆ twist_get_axis()

void twist_get_axis ( const ParticleChildModifierContext * modifier_ctx,
const float time,
float r_axis[3] )
static

◆ twist_num_segments()