Blender V5.0
effect.cc File Reference
#include <algorithm>
#include <cmath>
#include <cstdarg>
#include <cstddef>
#include <cstdlib>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_listBase.h"
#include "DNA_mesh_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math_base_safe.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_noise.h"
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BKE_anim_path.h"
#include "BKE_bvhutils.hh"
#include "BKE_collection.hh"
#include "BKE_collision.h"
#include "BKE_curve.hh"
#include "BKE_displist.h"
#include "BKE_effect.h"
#include "BKE_fluid.h"
#include "BKE_global.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_particle.h"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_physics.hh"
#include "DEG_depsgraph_query.hh"
#include "RE_texture.h"

Go to the source code of this file.

Macros

#define rot(x, k)

Functions

EffectorWeightsBKE_effector_add_weights (Collection *collection)
PartDeflectBKE_partdeflect_new (int type)
PartDeflectBKE_partdeflect_copy (const PartDeflect *pd_src)
void BKE_partdeflect_free (PartDeflect *pd)
static void precalculate_effector (Depsgraph *depsgraph, EffectorCache *eff)
static void add_effector_relation (ListBase *relations, Object *ob, ParticleSystem *psys, PartDeflect *pd)
static void add_effector_evaluation (ListBase **effectors, Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys, PartDeflect *pd)
ListBaseBKE_effector_relations_create (Depsgraph *depsgraph, const Scene *scene, ViewLayer *view_layer, Collection *collection)
void BKE_effector_relations_free (ListBase *lb)
static bool is_effector_enabled (PartDeflect *pd, bool use_rotation)
static bool is_effector_nonzero_strength (PartDeflect *pd)
static bool is_effector_relevant (PartDeflect *pd, EffectorWeights *weights, bool use_rotation)
ListBaseBKE_effectors_create (Depsgraph *depsgraph, Object *ob_src, ParticleSystem *psys_src, EffectorWeights *weights, bool use_rotation)
void BKE_effectors_free (ListBase *lb)
void pd_point_from_particle (ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, EffectedPoint *point)
void pd_point_from_loc (Scene *scene, float *loc, float *vel, int index, EffectedPoint *point)
void pd_point_from_soft (Scene *scene, float *loc, float *vel, int index, EffectedPoint *point)
static void eff_tri_ray_hit (void *, int, const BVHTreeRay *, BVHTreeRayHit *hit)
static float eff_calc_visibility (ListBase *colliders, EffectorCache *eff, EffectorData *efd, EffectedPoint *point)
static float wind_func (RNG *rng, float strength)
static float falloff_func (float fac, int usemin, float mindist, int usemax, float maxdist, float power)
static float falloff_func_dist (PartDeflect *pd, float fac)
static float falloff_func_rad (PartDeflect *pd, float fac)
float effector_falloff (EffectorCache *eff, EffectorData *efd, EffectedPoint *, EffectorWeights *weights)
bool closest_point_on_surface (SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3])
bool get_effector_data (EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int real_velocity)
static void get_effector_tot (EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int *tot, int *p, int *step)
static void do_texture_effector (EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
static void do_physical_effector (EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
void BKE_effectors_apply (ListBase *effectors, ListBase *colliders, EffectorWeights *weights, EffectedPoint *point, float *force, float *wind_force, float *impulse)
uint BKE_sim_debug_data_hash (int i)
uint BKE_sim_debug_data_hash_combine (uint kx, uint ky)
static uint debug_element_hash (const void *key)
static bool debug_element_compare (const void *a, const void *b)
static void debug_element_free (void *val)
void BKE_sim_debug_data_set_enabled (bool enable)
bool BKE_sim_debug_data_get_enabled ()
void BKE_sim_debug_data_free ()
static void debug_data_insert (SimDebugData *debug_data, SimDebugElement *elem)
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, uint hash)
void BKE_sim_debug_data_remove_element (uint hash)
void BKE_sim_debug_data_clear ()
void BKE_sim_debug_data_clear_category (const char *category)

Variables

SimDebugData_sim_debug_data = nullptr

Macro Definition Documentation

◆ rot

#define rot ( x,
k )
Value:
(((x) << (k)) | ((x) >> (32 - (k))))

Referenced by blender::io::fbx::add_image_texture(), add_primitive_circle_exec(), add_primitive_cone_exec(), add_primitive_cube_exec(), add_primitive_cylinder_exec(), add_primitive_grid_exec(), add_primitive_icosphere_exec(), add_primitive_monkey_exec(), add_primitive_plane_exec(), add_primitive_uvsphere_exec(), blender::ed::object::add_type(), blender::ed::object::add_type_with_obdata(), btSoftBody::appendDeformableAnchor(), BKE_object_apply_mat4_ex(), BKE_object_tfm_copy(), BKE_object_tfm_protected_backup(), BKE_pchan_apply_mat4(), BKE_pose_rest(), BKE_rigidbody_aftertrans_update(), BKE_sim_debug_data_hash_combine(), blender::math::DualQuaternionBase< float >::BLI_STRUCT_EQUALITY_OPERATORS_5(), KDL::Jacobian::changeBase, cloth_parallel_transport_hair_frame(), IK_QOrientationTask::ComputeJacobian(), convert_pose(), convert_tree(), blender::io::usd::USDMaterialReader::convert_usd_transform_2d(), blender::io::grease_pencil::GreasePencilImporter::create_object(), blender::io::usd::create_transform2d_shader(), curvesurf_prim_add(), diagonalize(), do_kink_spiral(), do_kink_spiral_deform(), btSoftColliders::CollideSDF_RD::DoNode(), btSoftColliders::CollideSDF_RDF::DoNode(), blender::ed::object::effector_add_exec(), explodeMesh(), blender::geometry::extend_curve_curved(), KDL::FrameAcc::FrameAcc(), KDL::FrameVel::FrameVel(), blender::seq::get_auto_filter(), blender::bke::greasepencil::get_stroke_to_texture_matrix(), GetJointRotation(), gizmo_cage2d_modal(), blender::ed::space_node::gizmo_node_box_mask_prop_matrix_get(), blender::ed::space_node::gizmo_node_box_mask_prop_matrix_set(), blender::ed::space_node::gizmo_node_split_prop_matrix_get(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), IK_CreateSegment(), IK_SolverAddGoalOrientation(), init_meta(), blender::ed::object::init_transform_on_add(), btDeformableMultiBodyDynamicsWorld::integrateTransforms(), blender::ed::object::lightprobe_add_exec(), loc_rot_size_to_mat4(), make_prim_init(), mat3_to_rot_size(), mat4_decompose(), mat4_to_loc_rot_size(), Matrix_decompose(), Matrix_to_scale(), modify_mesh(), blender::ed::object::new_primitive_matrix(), blender::io::usd::node_search(), blender::ed::object::object_add_exec(), blender::ed::object::object_add_text_exec(), blender::ed::object::object_armature_add_exec(), blender::ed::object::object_camera_add_exec(), blender::ed::object::object_curves_random_add_exec(), blender::ed::object::object_data_instance_add_exec(), blender::ed::object::object_empty_add_exec(), blender::ed::object::object_grease_pencil_add_exec(), blender::ed::object::object_image_add_exec(), blender::ed::object::object_light_add_exec(), blender::ed::object::object_metaball_add_exec(), blender::ed::object::object_pointcloud_add_exec(), blender::ed::object::object_speaker_add_exec(), blender::ed::object::object_transform_apply_exec(), blender::ed::object::object_volume_add(), blender::ed::transform::ObjectToTransData(), KDL::RotationAcc::operator*, KDL::VectorVel::operator*, KDL::VectorVel::operator*, blender::math::AngleCartesianBase< float >::operator<<, blender::math::AngleFraction< T >::operator<<, blender::math::AngleRadianBase< float >::operator<<, blender::math::AxisAngleBase< float, AngleRadianBase< float > >::operator<<, blender::math::CartesianBasis::operator<<, blender::math::Euler3Base< float >::operator<<, blender::math::EulerXYZBase< float >::operator<<, blender::math::QuaternionBase< float >::operator<<, blender::draw::pack_rotation_aspect_hardness_miter(), pivotcon_evaluate(), psys_cache_edit_paths_iter(), psys_cache_paths(), psys_get_birth_coords(), psys_get_from_key(), psys_interpolate_face(), psys_thread_create_path(), ptcache_particle_interpolate(), radial_control_paint_tex(), RB_body_get_activation_state(), RB_body_new(), RB_body_set_loc_rot(), RB_compound_add_child_shape(), btSoftBody::rotate(), blender::bke::subdiv::rotate_indices(), blender::ed::object::rotation_from_quat(), blender::ed::object::rotation_from_view(), set_plane_exec(), blender::io::usd::USDTransformWriter::set_xform_ops(), setUpVector(), setWorldToBaseRot(), blender::ed::sculpt_paint::pose::solve_ik_chain(), blender::ed::sculpt_paint::pose::solve_roll_chain(), testAngLimits(), transform_evaluate(), txt_add_object(), view3d_collection_drop_copy_external_asset(), view3d_collection_drop_copy_local_id(), wm_gizmo_set_matrix_rotation_from_z_axis__internal(), and wm_xr_navigation_reset_exec().

Function Documentation

◆ add_effector_evaluation()

void add_effector_evaluation ( ListBase ** effectors,
Depsgraph * depsgraph,
Scene * scene,
Object * ob,
ParticleSystem * psys,
PartDeflect * pd )
static

◆ add_effector_relation()

void add_effector_relation ( ListBase * relations,
Object * ob,
ParticleSystem * psys,
PartDeflect * pd )
static

◆ BKE_effector_add_weights()

◆ BKE_effector_relations_create()

◆ BKE_effector_relations_free()

void BKE_effector_relations_free ( 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()

PartDeflect * BKE_partdeflect_copy ( const PartDeflect * pd_src)

Definition at line 110 of file effect.cc.

References MEM_dupallocN().

◆ BKE_partdeflect_free()

void BKE_partdeflect_free ( 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()

uint 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()

uint BKE_sim_debug_data_hash_combine ( uint kx,
uint 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 ( uint hash)

◆ BKE_sim_debug_data_set_enabled()

void BKE_sim_debug_data_set_enabled ( bool enable)

◆ closest_point_on_surface()

◆ debug_data_insert()

void debug_data_insert ( SimDebugData * debug_data,
SimDebugElement * elem )
static

◆ debug_element_compare()

bool debug_element_compare ( const void * a,
const void * b )
static

Definition at line 1240 of file effect.cc.

References b, and SimDebugElement::hash.

Referenced by BKE_sim_debug_data_set_enabled().

◆ debug_element_free()

void debug_element_free ( void * val)
static

◆ debug_element_hash()

uint debug_element_hash ( const void * key)
static

Definition at line 1234 of file effect.cc.

References SimDebugElement::hash.

Referenced by BKE_sim_debug_data_set_enabled().

◆ do_physical_effector()

◆ do_texture_effector()

◆ eff_calc_visibility()

◆ eff_tri_ray_hit()

void eff_tri_ray_hit ( void * ,
int ,
const BVHTreeRay * ,
BVHTreeRayHit * hit )
static

Definition at line 450 of file effect.cc.

References BVHTreeRayHit::dist, and BVHTreeRayHit::index.

Referenced by eff_calc_visibility().

◆ effector_falloff()

◆ falloff_func()

float falloff_func ( float fac,
int usemin,
float mindist,
int usemax,
float maxdist,
float power )
static

Definition at line 547 of file effect.cc.

References pow, and power().

Referenced by falloff_func_dist(), and falloff_func_rad().

◆ falloff_func_dist()

float falloff_func_dist ( PartDeflect * pd,
float fac )
static

◆ falloff_func_rad()

float falloff_func_rad ( PartDeflect * pd,
float fac )
static

◆ get_effector_data()

◆ get_effector_tot()

◆ is_effector_enabled()

bool is_effector_enabled ( PartDeflect * pd,
bool use_rotation )
static

◆ is_effector_nonzero_strength()

◆ is_effector_relevant()

bool is_effector_relevant ( PartDeflect * pd,
EffectorWeights * weights,
bool use_rotation )
static

◆ pd_point_from_loc()

◆ pd_point_from_particle()

◆ pd_point_from_soft()

◆ precalculate_effector()

◆ wind_func()

float wind_func ( RNG * rng,
float strength )
static

Definition at line 529 of file effect.cc.

References BLI_rng_get_float(), BLI_rng_get_int(), float, random(), ret, and sign().

Referenced by do_physical_effector().

Variable Documentation

◆ _sim_debug_data