111 const struct Scene *scene,
153 float surface_nor[3],
154 float surface_vel[3]);
163 struct EffectorPoint *point,
166 struct EffectorPoint *point,
171#define PE_WIND_AS_SPEED 1
172#define PE_USE_NORMAL_DATA 4
175#define PE_VELOCITY_TO_IMPULSE 1
184#define _VA_SIM_DEBUG_HASH1(a) (BKE_sim_debug_data_hash(a))
185#define _VA_SIM_DEBUG_HASH2(a, b) \
186 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b)))
187#define _VA_SIM_DEBUG_HASH3(a, b, c) \
188 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH2(b, c)))
189#define _VA_SIM_DEBUG_HASH4(a, b, c, d) \
190 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH3(b, c, d)))
191#define _VA_SIM_DEBUG_HASH5(a, b, c, d, e) \
192 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH4(b, c, d, e)))
193#define _VA_SIM_DEBUG_HASH6(a, b, c, d, e, f) \
194 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH5(b, c, d, e, f)))
195#define _VA_SIM_DEBUG_HASH7(a, b, c, d, e, f, g) \
196 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), \
197 _VA_SIM_DEBUG_HASH6(b, c, d, e, f, g)))
198#define _VA_SIM_DEBUG_HASH8(a, b, c, d, e, f, g, h) \
199 (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), \
200 _VA_SIM_DEBUG_HASH7(b, c, d, e, f, g, h)))
202#define SIM_DEBUG_HASH(...) VA_NARGS_CALL_OVERLOAD(_VA_SIM_DEBUG_HASH, __VA_ARGS__)
240 const char *category,
244#define BKE_sim_debug_data_add_dot(p, r, g, b, category, ...) \
246 const float v2[3] = {0.0f, 0.0f, 0.0f}; \
247 BKE_sim_debug_data_add_element( \
248 SIM_DEBUG_ELEM_DOT, p, v2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
251#define BKE_sim_debug_data_add_circle(p, radius, r, g, b, category, ...) \
253 const float v2[3] = {radius, 0.0f, 0.0f}; \
254 BKE_sim_debug_data_add_element( \
255 SIM_DEBUG_ELEM_CIRCLE, p, v2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
258#define BKE_sim_debug_data_add_line(p1, p2, r, g, b, category, ...) \
260 BKE_sim_debug_data_add_element( \
261 SIM_DEBUG_ELEM_LINE, p1, p2, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
264#define BKE_sim_debug_data_add_vector(p, d, r, g, b, category, ...) \
266 BKE_sim_debug_data_add_element( \
267 SIM_DEBUG_ELEM_VECTOR, p, d, NULL, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
270#define BKE_sim_debug_data_add_string(p, str, r, g, b, category, ...) \
272 BKE_sim_debug_data_add_element( \
273 SIM_DEBUG_ELEM_STRING, p, NULL, str, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
276#define BKE_sim_debug_data_remove(...) \
277 BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__))
unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky)
void BKE_sim_debug_data_clear_category(const char *category)
void BKE_partdeflect_free(struct PartDeflect *pd)
SimDebugData * _sim_debug_data
struct GuideEffectorData GuideEffectorData
struct ListBase * BKE_effector_relations_create(struct Depsgraph *depsgraph, const struct Scene *scene, struct ViewLayer *view_layer, struct Collection *collection)
struct PartDeflect * BKE_partdeflect_new(int type)
struct EffectorWeights * BKE_effector_add_weights(struct Collection *collection)
struct SimDebugElement SimDebugElement
bool BKE_sim_debug_data_get_enabled(void)
float effector_falloff(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights)
void BKE_effectors_free(struct ListBase *lb)
struct EffectorCache EffectorCache
struct EffectedPoint EffectedPoint
void BKE_sim_debug_data_remove_element(unsigned int hash)
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_sim_debug_data_set_enabled(bool enable)
void pd_point_from_soft(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
bool get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity)
void BKE_sim_debug_data_clear(void)
bool closest_point_on_surface(struct SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3])
void BKE_sim_debug_data_free(void)
void BKE_effector_relations_free(struct ListBase *lb)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
unsigned int BKE_sim_debug_data_hash(int i)
struct EffectorRelation EffectorRelation
struct EffectorData EffectorData
struct SimDebugData SimDebugData
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 pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
struct PartDeflect * BKE_partdeflect_copy(const struct PartDeflect *pd_src)
void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
static void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
struct ParticleSystem * psys
struct ParticleSystem * psys
struct EffectorCache * prev
struct SurfaceModifierData * surmd
struct GuideEffectorData * guide_data
struct EffectorCache * next
struct Depsgraph * depsgraph
struct EffectorRelation * next
struct ParticleSystem * psys
struct EffectorRelation * prev
unsigned int category_hash