Blender V5.0
BKE_effect.h File Reference

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)
#define _VA_SIM_DEBUG_HASH2(a, b)
#define _VA_SIM_DEBUG_HASH3(a, b, c)
#define _VA_SIM_DEBUG_HASH4(a, b, c, d)
#define _VA_SIM_DEBUG_HASH5(a, b, c, d, e)
#define _VA_SIM_DEBUG_HASH6(a, 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(...)
#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(...)

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)
Value:
unsigned int BKE_sim_debug_data_hash(int i)
Definition effect.cc:1199

Definition at line 178 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH2

#define _VA_SIM_DEBUG_HASH2 ( a,
b )
Value:
unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky)
Definition effect.cc:1204
#define _VA_SIM_DEBUG_HASH1(a)
Definition BKE_effect.h:178

Definition at line 179 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH3

#define _VA_SIM_DEBUG_HASH3 ( a,
b,
c )
Value:

Definition at line 181 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH4

#define _VA_SIM_DEBUG_HASH4 ( a,
b,
c,
d )
Value:

Definition at line 183 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH5

#define _VA_SIM_DEBUG_HASH5 ( a,
b,
c,
d,
e )
Value:
#define _VA_SIM_DEBUG_HASH4(a, b, c, d)
Definition BKE_effect.h:183
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e

Definition at line 185 of file BKE_effect.h.

◆ _VA_SIM_DEBUG_HASH6

#define _VA_SIM_DEBUG_HASH6 ( a,
b,
c,
d,
e,
f )
Value:
#define _VA_SIM_DEBUG_HASH5(a, b, c, d, e)
Definition BKE_effect.h:185

Definition at line 187 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)))
#define _VA_SIM_DEBUG_HASH6(a, b, c, d, e, f)
Definition BKE_effect.h:187

Definition at line 189 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:189

Definition at line 192 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:211
#define SIM_DEBUG_HASH(...)
Definition BKE_effect.h:196
ATTR_WARN_UNUSED_RESULT const BMVert * v2

Definition at line 245 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:210

Definition at line 238 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:212

Definition at line 252 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:214
#define str(s)

Definition at line 264 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:213

Definition at line 258 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 ( ...)
Value:
void BKE_sim_debug_data_remove_element(unsigned int hash)
Definition effect.cc:1350

Definition at line 270 of file BKE_effect.h.

◆ PE_USE_NORMAL_DATA

#define PE_USE_NORMAL_DATA   4

Definition at line 166 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 169 of file BKE_effect.h.

Referenced by BKE_effectors_apply().

◆ PE_WIND_AS_SPEED

#define PE_WIND_AS_SPEED   1

Definition at line 165 of file BKE_effect.h.

Referenced by BKE_effectors_apply(), and pd_point_from_soft().

◆ SIM_DEBUG_HASH

#define SIM_DEBUG_HASH ( ...)
Value:
VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__)
#define VA_NARGS_CALL_OVERLOAD(name,...)

Definition at line 196 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 209 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.

References depsgraph, and state.

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

◆ BKE_effector_relations_free()

void BKE_effector_relations_free ( struct ListBase * lb)

Definition at line 239 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 1360 of file effect.cc.

References _sim_debug_data, BLI_ghash_clear(), and debug_element_free().

◆ 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 1271 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 1199 of file effect.cc.

References BLI_ghashutil_uinthash(), and i.

◆ BKE_sim_debug_data_hash_combine()

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

Definition at line 1204 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()

◆ pd_point_from_particle()

◆ pd_point_from_soft()

Variable Documentation

◆ _sim_debug_data