Blender V4.3
BKE_effect.h File Reference
#include "BLI_utildefines.h"

Go to the source code of this file.

Classes

struct  EffectedPoint
 
struct  GuideEffectorData
 
struct  EffectorData
 
struct  EffectorCache
 
struct  EffectorRelation
 
struct  SimDebugElement
 
struct  SimDebugData
 

Macros

#define PE_WIND_AS_SPEED   1
 
#define PE_USE_NORMAL_DATA   4
 
#define PE_VELOCITY_TO_IMPULSE   1
 
#define _VA_SIM_DEBUG_HASH1(a)   (BKE_sim_debug_data_hash(a))
 
#define _VA_SIM_DEBUG_HASH2(a, b)    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b)))
 
#define _VA_SIM_DEBUG_HASH3(a, b, c)    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH2(b, c)))
 
#define _VA_SIM_DEBUG_HASH4(a, b, c, d)    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH3(b, c, d)))
 
#define _VA_SIM_DEBUG_HASH5(a, b, c, d, e)    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH4(b, c, d, e)))
 
#define _VA_SIM_DEBUG_HASH6(a, b, c, d, e, f)    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH5(b, c, d, e, f)))
 
#define _VA_SIM_DEBUG_HASH7(a, b, c, d, e, f, g)
 
#define _VA_SIM_DEBUG_HASH8(a, b, c, d, e, f, g, h)
 
#define SIM_DEBUG_HASH(...)   VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__)
 
#define BKE_sim_debug_data_add_dot(p, r, g, b, category, ...)
 
#define BKE_sim_debug_data_add_circle(p, radius, r, g, b, category, ...)
 
#define BKE_sim_debug_data_add_line(p1, p2, r, g, b, category, ...)
 
#define BKE_sim_debug_data_add_vector(p, d, r, g, b, category, ...)
 
#define BKE_sim_debug_data_add_string(p, str, r, g, b, category, ...)
 
#define BKE_sim_debug_data_remove(...)    BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__))
 

Typedefs

typedef struct EffectedPoint EffectedPoint
 
typedef struct GuideEffectorData GuideEffectorData
 
typedef struct EffectorData EffectorData
 
typedef struct EffectorCache EffectorCache
 
typedef struct EffectorRelation EffectorRelation
 
typedef struct SimDebugElement SimDebugElement
 
typedef enum eSimDebugElement_Type eSimDebugElement_Type
 
typedef struct SimDebugData SimDebugData
 

Enumerations

enum  eSimDebugElement_Type {
  SIM_DEBUG_ELEM_DOT , SIM_DEBUG_ELEM_CIRCLE , SIM_DEBUG_ELEM_LINE , SIM_DEBUG_ELEM_VECTOR ,
  SIM_DEBUG_ELEM_STRING
}
 

Functions

struct EffectorWeightsBKE_effector_add_weights (struct Collection *collection)
 
struct PartDeflectBKE_partdeflect_new (int type)
 
struct PartDeflectBKE_partdeflect_copy (const struct PartDeflect *pd_src)
 
void BKE_partdeflect_free (struct PartDeflect *pd)
 
struct ListBaseBKE_effector_relations_create (struct Depsgraph *depsgraph, const struct Scene *scene, struct ViewLayer *view_layer, struct Collection *collection)
 
void BKE_effector_relations_free (struct ListBase *lb)
 
struct ListBaseBKE_effectors_create (struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
 
void BKE_effectors_apply (struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
 
void BKE_effectors_free (struct ListBase *lb)
 
void pd_point_from_particle (struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point)
 
void pd_point_from_loc (struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
 
void pd_point_from_soft (struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
 
float effector_falloff (struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights)
 
bool closest_point_on_surface (struct SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3])
 
bool get_effector_data (struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity)
 
unsigned int BKE_sim_debug_data_hash (int i)
 
unsigned int BKE_sim_debug_data_hash_combine (unsigned int kx, unsigned int ky)
 
void BKE_sim_debug_data_set_enabled (bool enable)
 
bool BKE_sim_debug_data_get_enabled (void)
 
void BKE_sim_debug_data_free (void)
 
void BKE_sim_debug_data_add_element (int type, const float v1[3], const float v2[3], const char *str, float r, float g, float b, const char *category, unsigned int hash)
 
void BKE_sim_debug_data_remove_element (unsigned int hash)
 
void BKE_sim_debug_data_clear (void)
 
void BKE_sim_debug_data_clear_category (const char *category)
 

Variables

SimDebugData_sim_debug_data
 

Macro Definition Documentation

◆ _VA_SIM_DEBUG_HASH1

#define _VA_SIM_DEBUG_HASH1 ( a)    (BKE_sim_debug_data_hash(a))

Definition at line 184 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH2

Definition at line 185 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH3

#define _VA_SIM_DEBUG_HASH3 ( a,
b,
c )    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH2(b, c)))

Definition at line 187 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH4

#define _VA_SIM_DEBUG_HASH4 ( a,
b,
c,
d )    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH3(b, c, d)))

Definition at line 189 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH5

#define _VA_SIM_DEBUG_HASH5 ( a,
b,
c,
d,
e )    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH4(b, c, d, e)))

Definition at line 191 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH6

#define _VA_SIM_DEBUG_HASH6 ( a,
b,
c,
d,
e,
f )    (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH5(b, c, d, e, f)))

Definition at line 193 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH7

#define _VA_SIM_DEBUG_HASH7 ( a,
b,
c,
d,
e,
f,
g )
Value:
_VA_SIM_DEBUG_HASH6(b, c, d, e, f, g)))
unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky)
Definition effect.cc:1208
#define _VA_SIM_DEBUG_HASH6(a, b, c, d, e, f)
Definition BKE_effect.h:193
unsigned int BKE_sim_debug_data_hash(int i)
Definition effect.cc:1203
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
local_group_size(16, 16) .push_constant(Type b

Definition at line 195 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH8

#define _VA_SIM_DEBUG_HASH8 ( a,
b,
c,
d,
e,
f,
g,
h )
Value:
_VA_SIM_DEBUG_HASH7(b, c, d, e, f, g, h)))
#define _VA_SIM_DEBUG_HASH7(a, b, c, d, e, f, g)
Definition BKE_effect.h:195

Definition at line 198 of file BKE_effect.h.

◆ BKE_sim_debug_data_add_circle

#define BKE_sim_debug_data_add_circle ( p,
radius,
r,
g,
b,
category,
... )
Value:
{ \
const float v2[3] = {radius, 0.0f, 0.0f}; \
BKE_sim_debug_data_add_element( \
SIM_DEBUG_ELEM_CIRCLE, p, v2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
@ SIM_DEBUG_ELEM_CIRCLE
Definition BKE_effect.h:217
#define SIM_DEBUG_HASH(...)
Definition BKE_effect.h:202
ATTR_WARN_UNUSED_RESULT const BMVert * v2
#define NULL

Definition at line 251 of file BKE_effect.h.

Referenced by cloth_continuum_step(), and SIM_hair_volume_solve_divergence().

◆ BKE_sim_debug_data_add_dot

#define BKE_sim_debug_data_add_dot ( p,
r,
g,
b,
category,
... )
Value:
{ \
const float v2[3] = {0.0f, 0.0f, 0.0f}; \
BKE_sim_debug_data_add_element( \
SIM_DEBUG_ELEM_DOT, p, v2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
@ SIM_DEBUG_ELEM_DOT
Definition BKE_effect.h:216

Definition at line 244 of file BKE_effect.h.

Referenced by cloth_calc_spring_force(), cloth_continuum_step(), and SIM_hair_volume_solve_divergence().

◆ BKE_sim_debug_data_add_line

#define BKE_sim_debug_data_add_line ( p1,
p2,
r,
g,
b,
category,
... )
Value:
{ \
BKE_sim_debug_data_add_element( \
SIM_DEBUG_ELEM_LINE, p1, p2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
@ SIM_DEBUG_ELEM_LINE
Definition BKE_effect.h:218

Definition at line 258 of file BKE_effect.h.

Referenced by cloth_calc_spring_force().

◆ BKE_sim_debug_data_add_string

#define BKE_sim_debug_data_add_string ( p,
str,
r,
g,
b,
category,
... )
Value:
{ \
BKE_sim_debug_data_add_element( \
SIM_DEBUG_ELEM_STRING, p, NULL, str, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
@ SIM_DEBUG_ELEM_STRING
Definition BKE_effect.h:220
#define str(s)

Definition at line 270 of file BKE_effect.h.

◆ BKE_sim_debug_data_add_vector

#define BKE_sim_debug_data_add_vector ( p,
d,
r,
g,
b,
category,
... )
Value:
{ \
BKE_sim_debug_data_add_element( \
SIM_DEBUG_ELEM_VECTOR, p, d, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
@ SIM_DEBUG_ELEM_VECTOR
Definition BKE_effect.h:219

Definition at line 264 of file BKE_effect.h.

Referenced by cloth_calc_spring_force(), cloth_continuum_step(), and SIM_hair_volume_solve_divergence().

◆ BKE_sim_debug_data_remove

#define BKE_sim_debug_data_remove ( ...)     BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__))

Definition at line 276 of file BKE_effect.h.

◆ PE_USE_NORMAL_DATA

#define PE_USE_NORMAL_DATA   4

Definition at line 172 of file BKE_effect.h.

Referenced by get_effector_data(), and precalculate_effector().

◆ PE_VELOCITY_TO_IMPULSE

#define PE_VELOCITY_TO_IMPULSE   1

Definition at line 175 of file BKE_effect.h.

Referenced by BKE_effectors_apply().

◆ PE_WIND_AS_SPEED

#define PE_WIND_AS_SPEED   1

Definition at line 171 of file BKE_effect.h.

Referenced by BKE_effectors_apply(), and pd_point_from_soft().

◆ SIM_DEBUG_HASH

#define SIM_DEBUG_HASH ( ...)    VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__)

Definition at line 202 of file BKE_effect.h.

Typedef Documentation

◆ EffectedPoint

typedef struct EffectedPoint EffectedPoint

◆ EffectorCache

typedef struct EffectorCache EffectorCache

◆ EffectorData

typedef struct EffectorData EffectorData

◆ EffectorRelation

typedef struct EffectorRelation EffectorRelation

◆ eSimDebugElement_Type

◆ GuideEffectorData

typedef struct GuideEffectorData GuideEffectorData

◆ SimDebugData

typedef struct SimDebugData SimDebugData

◆ SimDebugElement

typedef struct SimDebugElement SimDebugElement

Enumeration Type Documentation

◆ eSimDebugElement_Type

Enumerator
SIM_DEBUG_ELEM_DOT 
SIM_DEBUG_ELEM_CIRCLE 
SIM_DEBUG_ELEM_LINE 
SIM_DEBUG_ELEM_VECTOR 
SIM_DEBUG_ELEM_STRING 

Definition at line 215 of file BKE_effect.h.

Function Documentation

◆ BKE_effector_add_weights()

◆ BKE_effector_relations_create()

struct ListBase * BKE_effector_relations_create ( struct Depsgraph * depsgraph,
const struct Scene * scene,
struct ViewLayer * view_layer,
struct Collection * collection )

Create list of effector relations in the collection or entire scene. This is used by the depsgraph to build relations, as well as faster lookup of effectors during evaluation.

Referenced by blender::deg::build_effector_relations().

◆ BKE_effector_relations_free()

void BKE_effector_relations_free ( struct ListBase * lb)

Definition at line 242 of file effect.cc.

References BLI_freelistN(), and MEM_freeN().

Referenced by blender::deg::clear_physics_relations().

◆ BKE_effectors_apply()

◆ BKE_effectors_create()

◆ BKE_effectors_free()

◆ BKE_partdeflect_copy()

struct PartDeflect * BKE_partdeflect_copy ( const struct PartDeflect * pd_src)

◆ BKE_partdeflect_free()

void BKE_partdeflect_free ( struct PartDeflect * pd)

Definition at line 119 of file effect.cc.

References MEM_freeN().

Referenced by object_free_data(), and particle_settings_free_data().

◆ BKE_partdeflect_new()

◆ BKE_sim_debug_data_add_element()

◆ BKE_sim_debug_data_clear()

void BKE_sim_debug_data_clear ( void )

Definition at line 1366 of file effect.cc.

References _sim_debug_data, BLI_ghash_clear(), debug_element_free(), and SimDebugData::gh.

◆ BKE_sim_debug_data_clear_category()

◆ BKE_sim_debug_data_free()

void BKE_sim_debug_data_free ( void )

◆ BKE_sim_debug_data_get_enabled()

bool BKE_sim_debug_data_get_enabled ( void )

Definition at line 1276 of file effect.cc.

References _sim_debug_data.

◆ BKE_sim_debug_data_hash()

unsigned int BKE_sim_debug_data_hash ( int i)

Definition at line 1203 of file effect.cc.

References BLI_ghashutil_uinthash().

◆ BKE_sim_debug_data_hash_combine()

unsigned int BKE_sim_debug_data_hash_combine ( unsigned int kx,
unsigned int ky )

Definition at line 1208 of file effect.cc.

References b, and rot.

◆ BKE_sim_debug_data_remove_element()

void BKE_sim_debug_data_remove_element ( unsigned int hash)

◆ BKE_sim_debug_data_set_enabled()

void BKE_sim_debug_data_set_enabled ( bool enable)

◆ closest_point_on_surface()

◆ effector_falloff()

◆ get_effector_data()

◆ pd_point_from_loc()

void pd_point_from_loc ( struct Scene * scene,
float * loc,
float * vel,
int index,
struct EffectedPoint * point )

Definition at line 417 of file effect.cc.

References float.

Referenced by cloth_calc_force(), and dynamic_paint_prepare_effect_cb().

◆ pd_point_from_particle()

◆ pd_point_from_soft()

void pd_point_from_soft ( struct Scene * scene,
float * loc,
float * vel,
int index,
struct EffectedPoint * point )

Definition at line 432 of file effect.cc.

References float, and PE_WIND_AS_SPEED.

Referenced by _scan_for_ext_spring_forces(), and _softbody_calc_forces_slice_in_a_thread().

Variable Documentation

◆ _sim_debug_data