38 iter->
key = keys + index;
40 iter->
time = (
float)index / (
float)(totkeys - 1);
72 const float spiral_start[3])
88 const float b = shape * (1.0f +
sqrtf(5.0f)) / (
float)
M_PI * 0.25f;
93 float spiral_axis[3],
rot[3][3];
97 float radius = amplitude *
expf(
b * theta);
100 if (amplitude < 0.0f) {
125 const float parent_orco[3],
136 const int totkeys = ctx->
segments + 1;
151 float spiral_start[3] = {0.0f, 0.0f, 0.0f};
152 float spiral_start_time = 0.0f;
153 float spiral_par_co[3] = {0.0f, 0.0f, 0.0f};
154 float spiral_par_vel[3] = {0.0f, 0.0f, 0.0f};
155 float spiral_par_rot[4] = {1.0f, 0.0f, 0.0f, 0.0f};
158 int start_index = 0, end_index = 0;
166 cut_time = (totkeys - 1) * ptex->
length;
169 for (k = 0, key = keys; k < totkeys - 1; k++, key++) {
170 if ((
float)(k + 1) >= cut_time) {
171 float fac = cut_time - (
float)k;
175 end_index = start_index + extrakeys;
177 spiral_start_time = ((
float)k + fac) / (
float)(totkeys - 1);
197 modifier_ctx.
sim = &ctx->
sim;
198 modifier_ctx.
ptex = ptex;
199 modifier_ctx.
cpa = cpa;
200 modifier_ctx.
orco = orco;
203 for (k = 0, key = keys; k < end_index; k++, key++) {
205 float *par_co, *par_vel, *par_rot;
208 if (k < start_index) {
212 par_time = (
float)k / (
float)(totkeys - 1);
213 par_co = parent_keys[k].
co;
214 par_vel = parent_keys[k].
vel;
215 par_rot = parent_keys[k].
rot;
218 float spiral_time = (
float)(k - start_index) / (
float)(extrakeys - 1);
219 float kink[3], tmp[3];
222 par_time = spiral_start_time;
223 par_co = spiral_par_co;
224 par_vel = spiral_par_vel;
225 par_rot = spiral_par_rot;
251 modifier_ctx.
par_co = par_co;
252 modifier_ctx.
par_vel = par_vel;
253 modifier_ctx.
par_rot = par_rot;
254 modifier_ctx.
par_orco = parent_orco;
261 for (k = 0, key = keys; k < end_index - 1; k++, key++) {
265 *r_totkeys = end_index;
266 *r_max_length = totlen;
279 if (*cur_length + step_length > max_length) {
281 mul_v3_fl(dvec, (max_length - *cur_length) / step_length);
288 *cur_length += step_length;
300 const float parent_orco[3])
319 ctx, ptex, parent_orco, cpa, orco, hairmat, keys, parent_keys, &totkeys, &max_length);
326 modifier_ctx.
sim = &ctx->
sim;
327 modifier_ctx.
ptex = ptex;
328 modifier_ctx.
cpa = cpa;
329 modifier_ctx.
orco = orco;
333 max_length = ptex->
length;
335 for (k = 0, key = keys; k < totkeys; k++, key++) {
345 modifier_ctx.
par_orco = parent_orco;
353 const float step_length = 1.0f / (
float)(totkeys - 1);
354 float cur_length = 0.0f;
356 if (max_length <= 0.0f) {
362 for (k = 0, key = keys; k < totkeys; k++, key++) {
368 if (use_length_check && k > 0) {
371 if (!
check_path_length(k, keys, key, max_length, step_length, &cur_length, dvec)) {
374 if (ma && draw_col_ma) {
380 if (k == totkeys - 1) {
385 if (ma && draw_col_ma) {
395 const float par_co[3],
396 const float par_vel[3],
397 const float par_rot[4],
408 float kink[3] = {1.0f, 0.0f, 0.0f}, par_vec[3],
q1[4] = {1.0f, 0.0f, 0.0f, 0.0f};
432 dt =
sinf(dt / 2.0f);
457 float curl_offset[3];
495 float y_vec[3] = {0.0f, 1.0f, 0.0f};
496 float z_vec[3] = {0.0f, 0.0f, 1.0f};
497 float vec_one[3], state_co[3];
498 float inp_y, inp_z,
length;
517 else if (inp_z > 0.0f) {
543 shape = 2.0f * (
float)
M_PI * (1.0f + shape);
568 const float par_co[3],
583 else if (clumpfac != 0.0f) {
586 if (clumppow < 0.0f) {
587 cpow = 1.0f + clumppow;
590 cpow = 1.0f + 9.0f * clumppow;
593 if (clumpfac < 0.0f) {
607 const float par_co[3],
609 const float orco_offset[3],
613 bool use_clump_noise,
614 float clump_noise_size,
619 if (use_clump_noise && clump_noise_size != 0.0f) {
620 float center[3], noisevec[3];
623 mul_v3_v3fl(noisevec, orco_offset, 1.0f / clump_noise_size);
632 state->co,
state->co, par_co,
time, clumpfac, clumppow, pa_clump, clumpcurve);
638 const float mat[4][4],
649 if (
fabsf((
float)(-1.5f + loc[0] + loc[1] + loc[2])) < 1.5f * thres) {
666 const float loc[3],
const float mat[4][4],
float t,
float fac,
float shape,
ParticleKey *
state)
671 roughfac = fac * (
float)
pow((
double)
t, shape);
673 rough[0] = -1.0f + 2.0f * rough[0];
674 rough[1] = -1.0f + 2.0f * rough[1];
682 const float mat[4][4],
736 float integral = 0.0f;
742 integral +=
y * step;
765 if (part->
twist == 0.0f) {
784 if (twist_curve !=
NULL) {
822 float rough1 = part->
rough1;
823 float rough2 = part->
rough2;
832 rough_end *= ptex->
roughe;
848 float orco_offset[3];
858 ptex ? ptex->
clump : 1.0f,
863 if (kink_freq != 0.0f) {
864 kink_amp *= (1.0f - kink_amp_clump * clump);
896 if (rough_end > 0.0f) {
typedef float(TangentPoint)[2]
bool do_guides(struct Depsgraph *depsgraph, struct ParticleSettings *part, struct ListBase *effectors, ParticleKey *state, int index, float time)
BLI_INLINE void psys_frand_vec(ParticleSystem *psys, unsigned int seed, float vec[3])
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
MINLINE float clamp_f(float value, float min, float max)
MINLINE int clamp_i(int value, int min, int max)
void mul_m3_v3(const float M[3][3], float r[3])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], float angle)
void mul_qt_v3(const float q[4], float r[3])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void copy_qt_qt(float q[4], const float a[4])
void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], float angle)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_noise_voronoi(float x, float y, float z, float *da, float *pa, float me, int dtype)
float BLI_noise_generic_turbulence(float noisesize, float x, float y, float z, int oct, bool hard, int noisebasis)
typedef double(DMatrix)[4][4]
Object is a sort of wrapper for general info.
#define PART_DRAW_COL_MAT
#define PART_CHILD_EFFECT
#define PART_CHILD_PARTICLES
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_CLUMP_NOISE
@ PART_CHILD_USE_ROUGH_CURVE
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static unsigned long seed
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
SyclQueue void void size_t num_bytes void
flat(Type::INT, "resource_index")
ccl_device_inline float3 pow(float3 v, float e)
T length(const vec_base< T, Size > &a)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
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)
struct ParticlePathIterator ParticlePathIterator
static void do_twist(const ParticleChildModifierContext *modifier_ctx, ParticleKey *state, const float time)
static bool check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *key, float max_length, float step_length, float *cur_length, float dvec[3])
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])
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)
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_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)
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])
static void do_rough_end(const float loc[3], const float mat[4][4], float t, float fac, float shape, ParticleKey *state)
static void twist_get_axis(const ParticleChildModifierContext *modifier_ctx, const float time, float r_axis[3])
static void do_rough(const float loc[3], const float mat[4][4], float t, float fac, float size, float thres, ParticleKey *state)
static float BKE_curvemapping_integrate_clamped(CurveMapping *curve, float start, float end, float step)
struct ParticlePathModifier ParticlePathModifier
static void psys_path_iter_get(ParticlePathIterator *iter, ParticleCacheKey *keys, int totkeys, ParticleCacheKey *parent, int index)
static int twist_num_segments(const ParticleChildModifierContext *modifier_ctx)
void do_child_modifiers(const ParticleChildModifierContext *modifier_ctx, float mat[4][4], ParticleKey *state, float t)
static void do_rough_curve(const float loc[3], const float mat[4][4], float time, float fac, float size, CurveMapping *roughcurve, ParticleKey *state)
ParticleThreadContext * thread_ctx
ParticleCacheKey * parent_keys
ParticleSimulationData * sim
ParticleCacheKey * parent_key
struct ParticlePathModifier * next
struct ParticlePathModifier * prev
void(* apply)(ParticleCacheKey *keys, int totkeys, ParticleCacheKey *parent_keys)
struct CurveMapping * clumpcurve
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct Depsgraph * depsgraph
struct ParticleSystem * psys
struct ListBase * effectors
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct CurveMapping * clumpcurve
struct ParticleSimulationData sim
ccl_device_inline int mod(int x, int m)