Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_lattice_types.h"
#include "DNA_curve_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_ghash.h"
#include "BLI_threads.h"
#include "BKE_curve.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_modifier.h"
#include "BKE_softbody.h"
#include "BKE_DerivedMesh.h"
#include "BKE_pointcache.h"
#include "BKE_deform.h"
#include "PIL_time.h"
Go to the source code of this file.
Classes | |
struct | BodySpring |
struct | BodyFace |
struct | ReferenceVert |
struct | ReferenceState |
struct | SBScratch |
struct | SB_thread_context |
struct | ccdf_minmax |
struct | ccd_Mesh |
Defines | |
#define | NLF_BUILD 1 |
#define | NLF_SOLVE 2 |
#define | MID_PRESERVE 1 |
#define | SOFTGOALSNAP 0.999f |
#define | HEUNWARNLIMIT 1 |
#define | BSF_INTERSECT 1 |
#define | SBF_DOFUZZY 1 |
#define | SBF_OUTOFCOLLISION 2 |
#define | BFF_INTERSECT 1 |
#define | BFF_CLOSEVERT 2 |
Typedefs | |
typedef struct BodySpring | BodySpring |
typedef struct BodyFace | BodyFace |
typedef struct ReferenceVert | ReferenceVert |
typedef struct ReferenceState | ReferenceState |
typedef struct SBScratch | SBScratch |
typedef struct SB_thread_context | SB_thread_context |
typedef struct ccdf_minmax | ccdf_minmax |
typedef struct ccd_Mesh | ccd_Mesh |
Enumerations | |
enum | type_spring { SB_EDGE = 1, SB_BEND = 2, SB_STIFFQUAD = 3, SB_HANDLE = 4 } |
Functions | |
static void | free_softbody_intern (SoftBody *sb) |
static void | Vec3PlusStVec (float *v, float s, float *v1) |
static float | sb_grav_force_scale (Object *UNUSED(ob)) |
static float | sb_fric_force_scale (Object *UNUSED(ob)) |
static float | sb_time_scale (Object *ob) |
static float | _final_goal (Object *ob, BodyPoint *bp) |
static float | _final_mass (Object *ob, BodyPoint *bp) |
static ccd_Mesh * | ccd_mesh_make (Object *ob) |
static void | ccd_mesh_update (Object *ob, ccd_Mesh *pccd_M) |
static void | ccd_mesh_free (ccd_Mesh *ccdm) |
static void | ccd_build_deflector_hash (Scene *scene, Object *vertexowner, GHash *hash) |
static void | ccd_update_deflector_hash (Scene *scene, Object *vertexowner, GHash *hash) |
static int | count_mesh_quads (Mesh *me) |
static void | add_mesh_quad_diag_springs (Object *ob) |
static void | add_2nd_order_roller (Object *ob, float UNUSED(stiffness), int *counter, int addsprings) |
static void | add_2nd_order_springs (Object *ob, float stiffness) |
static void | add_bp_springlist (BodyPoint *bp, int springID) |
static void | build_bps_springlist (Object *ob) |
static void | calculate_collision_balls (Object *ob) |
static void | renew_softbody (Scene *scene, Object *ob, int totpoint, int totspring) |
static void | free_softbody_baked (SoftBody *sb) |
static void | free_scratch (SoftBody *sb) |
static int | are_there_deflectors (Scene *scene, unsigned int layer) |
static int | query_external_colliders (Scene *scene, Object *me) |
static int | sb_detect_aabb_collisionCached (float UNUSED(force[3]), unsigned int UNUSED(par_layer), struct Object *vertexowner, float UNUSED(time)) |
static int | sb_detect_face_pointCached (float face_v1[3], float face_v2[3], float face_v3[3], float *damp, float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time) |
static int | sb_detect_face_collisionCached (float face_v1[3], float face_v2[3], float face_v3[3], float *damp, float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time) |
static void | scan_for_ext_face_forces (Object *ob, float timenow) |
static int | sb_detect_edge_collisionCached (float edge_v1[3], float edge_v2[3], float *damp, float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time) |
static void | _scan_for_ext_spring_forces (Scene *scene, Object *ob, float timenow, int ifirst, int ilast, struct ListBase *do_effector) |
static void | scan_for_ext_spring_forces (Scene *scene, Object *ob, float timenow) |
static void * | exec_scan_for_ext_spring_forces (void *data) |
static void | sb_sfesf_threads_run (Scene *scene, struct Object *ob, float timenow, int totsprings, int *UNUSED(ptr_to_break_func(void))) |
static int | choose_winner (float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc) |
static int | sb_detect_vertex_collisionCached (float opco[3], float facenormal[3], float *damp, float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time, float vel[3], float *intrusion) |
static int | sb_deflect_face (Object *ob, float *actpos, float *facenormal, float *force, float *cf, float time, float *vel, float *intrusion) |
static void | sb_spring_force (Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime), int nl_flags) |
static int | _softbody_calc_forces_slice_in_a_thread (Scene *scene, Object *ob, float forcetime, float timenow, int ifirst, int ilast, int *UNUSED(ptr_to_break_func(void)), ListBase *do_effector, int do_deflector, float fieldfactor, float windfactor) |
static void * | exec_softbody_calc_forces (void *data) |
static void | sb_cf_threads_run (Scene *scene, Object *ob, float forcetime, float timenow, int totpoint, int *UNUSED(ptr_to_break_func(void)), struct ListBase *do_effector, int do_deflector, float fieldfactor, float windfactor) |
static void | softbody_calc_forcesEx (Scene *scene, Object *ob, float forcetime, float timenow, int UNUSED(nl_flags)) |
static void | softbody_calc_forces (Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags) |
static void | softbody_apply_forces (Object *ob, float forcetime, int mode, float *err, int mid_flags) |
static void | softbody_restore_prev_step (Object *ob) |
static void | softbody_apply_goalsnap (Object *ob) |
static void | apply_spring_memory (Object *ob) |
static void | interpolate_exciter (Object *ob, int timescale, int time) |
static void | get_scalar_from_vertexgroup (Object *ob, int vertID, short groupindex, float *target) |
static void | springs_from_mesh (Object *ob) |
static void | mesh_to_softbody (Scene *scene, Object *ob) |
static void | mesh_faces_to_scratch (Object *ob) |
static void | reference_to_scratch (Object *ob) |
static float | globallen (float *v1, float *v2, Object *ob) |
static void | makelatticesprings (Lattice *lt, BodySpring *bs, int dostiff, Object *ob) |
static void | lattice_to_softbody (Scene *scene, Object *ob) |
static void | curve_surf_to_softbody (Scene *scene, Object *ob) |
static void | softbody_to_object (Object *ob, float(*vertexCos)[3], int numVerts, int local) |
static void | sb_new_scratch (SoftBody *sb) |
SoftBody * | sbNew (Scene *scene) |
void | sbFree (SoftBody *sb) |
void | sbFreeSimulation (SoftBody *sb) |
void | sbObjectToSoftbody (Object *ob) |
static int | object_has_edges (Object *ob) |
void | sbSetInterruptCallBack (int(*f)(void)) |
static void | softbody_update_positions (Object *ob, SoftBody *sb, float(*vertexCos)[3], int numVerts) |
void | SB_estimate_transform (Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]) |
static void | softbody_reset (Object *ob, SoftBody *sb, float(*vertexCos)[3], int numVerts) |
static void | softbody_step (Scene *scene, Object *ob, SoftBody *sb, float dtime) |
void | sbObjectStep (Scene *scene, Object *ob, float cfra, float(*vertexCos)[3], int numVerts) |
Variables | |
static int(* | SB_localInterruptCallBack )(void) = NULL |
static float | SoftHeunTol = 1.0f |
static const int | CCD_SAVETY = 190561 |
Definition in file softbody.c.
#define BFF_CLOSEVERT 2 |
Definition at line 165 of file softbody.c.
Referenced by scan_for_ext_face_forces().
#define BFF_INTERSECT 1 |
Definition at line 164 of file softbody.c.
Referenced by scan_for_ext_face_forces().
#define BSF_INTERSECT 1 |
Definition at line 157 of file softbody.c.
Referenced by _scan_for_ext_spring_forces(), _softbody_calc_forces_slice_in_a_thread(), and softbody_calc_forces().
#define HEUNWARNLIMIT 1 |
Definition at line 154 of file softbody.c.
Referenced by softbody_step().
#define MID_PRESERVE 1 |
Definition at line 148 of file softbody.c.
Referenced by softbody_apply_forces(), and softbody_step().
#define NLF_BUILD 1 |
Definition at line 145 of file softbody.c.
Referenced by sb_spring_force(), and softbody_calc_forces().
#define NLF_SOLVE 2 |
Definition at line 146 of file softbody.c.
Referenced by softbody_calc_forces().
#define SBF_DOFUZZY 1 |
Definition at line 160 of file softbody.c.
Referenced by _softbody_calc_forces_slice_in_a_thread(), softbody_apply_forces(), softbody_calc_forces(), and softbody_step().
#define SBF_OUTOFCOLLISION 2 |
Definition at line 161 of file softbody.c.
Referenced by _softbody_calc_forces_slice_in_a_thread(), and curve_surf_to_softbody().
#define SOFTGOALSNAP 0.999f |
Definition at line 150 of file softbody.c.
Referenced by _softbody_calc_forces_slice_in_a_thread(), interpolate_exciter(), sb_spring_force(), softbody_apply_forces(), softbody_apply_goalsnap(), and softbody_calc_forces().
typedef struct BodySpring BodySpring |
typedef struct ccdf_minmax ccdf_minmax |
typedef struct ReferenceState ReferenceState |
typedef struct ReferenceVert ReferenceVert |
typedef struct SB_thread_context SB_thread_context |
enum type_spring |
Definition at line 92 of file softbody.c.
Definition at line 226 of file softbody.c.
References ABS, BodyPoint::goal, SoftBody::maxgoal, SoftBody::mingoal, OB_SB_GOAL, pow(), Object::soft, and Object::softflag.
Referenced by _softbody_calc_forces_slice_in_a_thread(), interpolate_exciter(), softbody_apply_forces(), softbody_apply_goalsnap(), and softbody_calc_forces().
Definition at line 243 of file softbody.c.
References BodyPoint::mass, SoftBody::nodemass, and Object::soft.
Referenced by _softbody_calc_forces_slice_in_a_thread(), reference_to_scratch(), softbody_apply_forces(), and softbody_calc_forces().
static void _scan_for_ext_spring_forces | ( | Scene * | scene, |
Object * | ob, | ||
float | timenow, | ||
int | ifirst, | ||
int | ilast, | ||
struct ListBase * | do_effector | ||
) | [static] |
Definition at line 1557 of file softbody.c.
References ABS, add_v3_v3(), add_v3_v3v3(), SoftBody::aeroedge, SoftBody::bpoint, BSF_INTERSECT, SoftBody::bspring, BodySpring::cf, SoftBody::choke, dot_v3v3(), SoftBody::effector_weights, BodySpring::ext_force, BodySpring::flag, Object::lay, mid_v3_v3v3(), mul_v3_fl(), normalize_v3(), NULL, OB_SB_AERO_ANGLE, OB_SB_EDGECOLL, pd_point_from_soft(), pdDoEffectors(), BodyPoint::pos, project_v3_v3v3(), sb_detect_edge_collisionCached(), SB_EDGE, Object::soft, Object::softflag, BodySpring::springtype, sub_v3_v3(), sub_v3_v3v3(), SoftBody::totspring, BodySpring::v1, BodySpring::v2, BodyPoint::vec, and Vec3PlusStVec().
Referenced by exec_scan_for_ext_spring_forces(), and scan_for_ext_spring_forces().
static int _softbody_calc_forces_slice_in_a_thread | ( | Scene * | scene, |
Object * | ob, | ||
float | forcetime, | ||
float | timenow, | ||
int | ifirst, | ||
int | ilast, | ||
int * | UNUSEDptr_to_break_func(void), | ||
ListBase * | do_effector, | ||
int | do_deflector, | ||
float | fieldfactor, | ||
float | windfactor | ||
) | [static] |
Definition at line 2170 of file softbody.c.
References _final_goal(), _final_mass(), ABS, add_v3_v3(), add_v3_v3v3(), SoftBody::aeroedge, SoftBody::balldamp, SoftBody::ballstiff, SoftBody::bpoint, BSF_INTERSECT, SoftBody::bspring, BodySpring::cf, SoftBody::choke, BodyPoint::choke, BodyPoint::choke2, BodyPoint::colball, compare(), copy_v3_v3(), distance(), SoftBody::effector_weights, BodySpring::ext_force, BodySpring::flag, SBScratch::flag, PhysicsSettings::flag, BodyPoint::force, EffectorWeights::global_gravity, SoftBody::goalfrict, SoftBody::goalspring, PhysicsSettings::gravity, SoftBody::inspring, BodyPoint::loc_flag, SoftBody::mediafrict, mid_v3_v3v3(), mul_v3_fl(), BodyPoint::nofsprings, normalize_v3(), NULL, OB_SB_EDGECOLL, OB_SB_EDGES, OB_SB_GOAL, OB_SB_SELF, BodyPoint::origE, BodyPoint::origS, BodyPoint::origT, pd_point_from_soft(), pdDoEffectors(), PHYS_GLOBAL_GRAVITY, Scene::physics_settings, BodyPoint::pos, sb_deflect_face(), sb_fric_force_scale(), sb_grav_force_scale(), sb_spring_force(), SBF_DOFUZZY, SBF_OUTOFCOLLISION, SoftBody::scratch, Object::soft, Object::softflag, SOFTGOALSNAP, BodyPoint::springs, sub_v3_v3v3(), SoftBody::totpoint, BodySpring::v1, BodySpring::v2, BodyPoint::vec, and Vec3PlusStVec().
Referenced by exec_softbody_calc_forces().
static void add_2nd_order_roller | ( | Object * | ob, |
float | UNUSEDstiffness, | ||
int * | counter, | ||
int | addsprings | ||
) | [static] |
Definition at line 663 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, BodyPoint::nofsprings, NULL, SB_BEND, Object::soft, BodyPoint::springs, BodySpring::springtype, SoftBody::totpoint, SoftBody::totspring, BodySpring::v1, and BodySpring::v2.
Referenced by add_2nd_order_springs().
static void add_2nd_order_springs | ( | Object * | ob, |
float | stiffness | ||
) | [static] |
Definition at line 725 of file softbody.c.
References add_2nd_order_roller(), SoftBody::bspring, MEM_callocN(), MEM_freeN(), Object::soft, and SoftBody::totspring.
Referenced by mesh_to_softbody().
static void add_bp_springlist | ( | BodyPoint * | bp, |
int | springID | ||
) | [static] |
Definition at line 746 of file softbody.c.
References MEM_callocN(), MEM_freeN(), BodyPoint::nofsprings, NULL, and BodyPoint::springs.
Referenced by build_bps_springlist().
static void add_mesh_quad_diag_springs | ( | Object * | ob | ) | [static] |
Definition at line 615 of file softbody.c.
References SoftBody::bspring, count_mesh_quads(), Object::data, MEM_callocN(), MEM_freeN(), Mesh::mface, SB_STIFFQUAD, Object::soft, BodySpring::springtype, Mesh::totface, SoftBody::totspring, MFace::v1, BodySpring::v1, MFace::v2, BodySpring::v2, MFace::v3, and MFace::v4.
Referenced by mesh_to_softbody().
static void apply_spring_memory | ( | Object * | ob | ) | [static] |
Definition at line 3136 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, BodySpring::len, len_v3v3(), SoftBody::plastic, BodyPoint::pos, Object::soft, SoftBody::totspring, BodySpring::v1, and BodySpring::v2.
Referenced by softbody_step().
static int are_there_deflectors | ( | Scene * | scene, |
unsigned int | layer | ||
) | [static] |
Definition at line 993 of file softbody.c.
References Scene::base, PartDeflect::deflect, ListBase::first, Base::lay, Base::next, Base::object, and Object::pd.
Referenced by query_external_colliders().
static void build_bps_springlist | ( | Object * | ob | ) | [static] |
Definition at line 768 of file softbody.c.
References add_bp_springlist(), SoftBody::bpoint, SoftBody::bspring, MEM_freeN(), NULL, Object::soft, BodyPoint::springs, SoftBody::totpoint, SoftBody::totspring, BodySpring::v1, and BodySpring::v2.
Referenced by curve_surf_to_softbody(), lattice_to_softbody(), and mesh_to_softbody().
static void calculate_collision_balls | ( | Object * | ob | ) | [static] |
Definition at line 795 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, SoftBody::colball, BodyPoint::colball, BodySpring::len, max, MAX2, min, MIN2, BodyPoint::nofsprings, NULL, SB_EDGE, SoftBody::sbc_mode, SBC_MODE_AVG, SBC_MODE_AVGMINMAX, SBC_MODE_MANUAL, SBC_MODE_MAX, SBC_MODE_MIN, Object::soft, BodyPoint::springs, BodySpring::springtype, and SoftBody::totpoint.
Referenced by curve_surf_to_softbody(), and mesh_to_softbody().
Definition at line 541 of file softbody.c.
References Scene::base, BLI_ghash_insert(), BLI_ghash_lookup(), ccd_mesh_make(), PartDeflect::deflect, ListBase::first, Object::lay, Base::lay, Base::next, NULL, OB_MESH, Base::object, Object::pd, and Object::type.
Referenced by softbody_step().
static void ccd_mesh_free | ( | ccd_Mesh * | ccdm | ) | [static] |
Definition at line 529 of file softbody.c.
References MEM_freeN(), ccd_Mesh::mface, ccd_Mesh::mima, ccd_Mesh::mprevvert, ccd_Mesh::mvert, NULL, and ccd_Mesh::savety.
Referenced by free_scratch().
Definition at line 291 of file softbody.c.
References ccd_Mesh::bbmax, ccd_Mesh::bbmin, CCD_SAVETY, MVert::co, copy_v3_v3(), eModifierType_Collision, i, MAX2, ccdf_minmax::maxx, ccdf_minmax::maxy, ccdf_minmax::maxz, MEM_dupallocN(), MEM_mallocN(), ccd_Mesh::mface, CollisionModifierData::mfaces, ccd_Mesh::mima, MIN2, ccdf_minmax::minx, ccdf_minmax::miny, ccdf_minmax::minz, modifiers_findByType(), ccd_Mesh::mprevvert, ccd_Mesh::mvert, NULL, CollisionModifierData::numfaces, CollisionModifierData::numverts, Object::pd, PartDeflect::pdef_sbift, PartDeflect::pdef_sboft, ccd_Mesh::savety, ccd_Mesh::totface, ccd_Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and CollisionModifierData::xnew.
Referenced by ccd_build_deflector_hash().
Definition at line 389 of file softbody.c.
References ccd_Mesh::bbmax, ccd_Mesh::bbmin, MVert::co, copy_v3_v3(), eModifierType_Collision, i, MAX2, ccdf_minmax::maxx, ccdf_minmax::maxy, ccdf_minmax::maxz, MEM_dupallocN(), MEM_freeN(), ccd_Mesh::mface, ccd_Mesh::mima, MIN2, ccdf_minmax::minx, ccdf_minmax::miny, ccdf_minmax::minz, modifiers_findByType(), ccd_Mesh::mprevvert, ccd_Mesh::mvert, NULL, CollisionModifierData::numfaces, CollisionModifierData::numverts, Object::pd, PartDeflect::pdef_sbift, PartDeflect::pdef_sboft, ccd_Mesh::totface, ccd_Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and CollisionModifierData::xnew.
Referenced by ccd_update_deflector_hash().
static void ccd_update_deflector_hash | ( | Scene * | scene, |
Object * | vertexowner, | ||
GHash * | hash | ||
) | [static] |
Definition at line 568 of file softbody.c.
References Scene::base, BLI_ghash_lookup(), ccd_mesh_update(), PartDeflect::deflect, ListBase::first, Object::lay, Base::lay, Base::next, OB_MESH, Base::object, Object::pd, and Object::type.
Referenced by softbody_step().
static int choose_winner | ( | float * | w, |
float * | pos, | ||
float * | a, | ||
float * | b, | ||
float * | c, | ||
float * | ca, | ||
float * | cb, | ||
float * | cc | ||
) | [static] |
Definition at line 1710 of file softbody.c.
References ABS, copy_v3_v3(), and dot_v3v3().
Referenced by sb_detect_vertex_collisionCached().
static int count_mesh_quads | ( | Mesh * | me | ) | [static] |
Definition at line 602 of file softbody.c.
References Mesh::mface, Mesh::totface, and MFace::v4.
Referenced by add_mesh_quad_diag_springs().
Definition at line 3550 of file softbody.c.
References Nurb::bezt, BLI_countlist(), Nurb::bp, SoftBody::bpoint, SoftBody::bspring, build_bps_springlist(), calculate_collision_balls(), count_curveverts(), curindex, Object::data, ListBase::first, globallen(), BodyPoint::goal, BodySpring::len, Nurb::next, Curve::nurb, OB_CURVE, OB_SB_EDGES, OB_SB_GOAL, OB_SB_SELF, Nurb::pntsv, renew_softbody(), SB_EDGE, SB_HANDLE, SBF_OUTOFCOLLISION, Object::soft, Object::softflag, BodySpring::springtype, Object::type, BodySpring::v1, BodySpring::v2, BPoint::vec, BezTriple::vec, BPoint::weight, and BezTriple::weight.
Referenced by sbObjectStep().
static void* exec_scan_for_ext_spring_forces | ( | void * | data | ) | [static] |
Definition at line 1641 of file softbody.c.
References _scan_for_ext_spring_forces(), SB_thread_context::do_effector, SB_thread_context::ifirst, SB_thread_context::ilast, NULL, SB_thread_context::ob, SB_thread_context::scene, and SB_thread_context::timenow.
Referenced by sb_sfesf_threads_run().
static void* exec_softbody_calc_forces | ( | void * | data | ) | [static] |
Definition at line 2374 of file softbody.c.
References _softbody_calc_forces_slice_in_a_thread(), SB_thread_context::do_deflector, SB_thread_context::do_effector, SB_thread_context::fieldfactor, SB_thread_context::forcetime, SB_thread_context::ifirst, SB_thread_context::ilast, NULL, SB_thread_context::ob, SB_thread_context::scene, SB_thread_context::timenow, and SB_thread_context::windfactor.
Referenced by sb_cf_threads_run().
static void free_scratch | ( | SoftBody * | sb | ) | [static] |
Definition at line 906 of file softbody.c.
References BLI_ghash_free(), SBScratch::bodyface, ccd_mesh_free(), SBScratch::colliderhash, ReferenceState::ivert, MEM_freeN(), NULL, SBScratch::Ref, and SoftBody::scratch.
Referenced by free_softbody_intern(), and softbody_reset().
static void free_softbody_baked | ( | SoftBody * | sb | ) | [static] |
Definition at line 892 of file softbody.c.
References SoftBody::keys, MEM_freeN(), NULL, and SoftBody::totkey.
Referenced by free_softbody_intern().
static void free_softbody_intern | ( | SoftBody * | sb | ) | [static] |
Definition at line 928 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, free_scratch(), free_softbody_baked(), MEM_freeN(), NULL, BodyPoint::springs, SoftBody::totpoint, and SoftBody::totspring.
Referenced by renew_softbody(), sbFree(), sbFreeSimulation(), and sbObjectToSoftbody().
static void get_scalar_from_vertexgroup | ( | Object * | ob, |
int | vertID, | ||
short | groupindex, | ||
float * | target | ||
) | [static] |
Definition at line 3189 of file softbody.c.
References Object::data, MDeformWeight::def_nr, Lattice::dvert, Mesh::dvert, MDeformVert::dw, i, NULL, OB_LATTICE, OB_MESH, MDeformVert::totweight, Object::type, and MDeformWeight::weight.
Referenced by mesh_to_softbody().
static float globallen | ( | float * | v1, |
float * | v2, | ||
Object * | ob | ||
) | [static] |
Definition at line 3415 of file softbody.c.
References copy_v3_v3(), len_v3v3(), mul_m4_v3(), and Object::obmat.
Referenced by curve_surf_to_softbody(), and makelatticesprings().
static void interpolate_exciter | ( | Object * | ob, |
int | timescale, | ||
int | time | ||
) | [static] |
Definition at line 3160 of file softbody.c.
References _final_goal(), SoftBody::bpoint, BodyPoint::origE, BodyPoint::origS, BodyPoint::origT, Object::soft, SOFTGOALSNAP, SoftBody::totpoint, and BodyPoint::vec.
Referenced by softbody_step().
Definition at line 3506 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, build_bps_springlist(), Object::data, Lattice::def, makelatticesprings(), OB_SB_EDGES, OB_SB_GOAL, OB_SB_QUADS, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, renew_softbody(), Object::soft, Object::softflag, and BPoint::weight.
Referenced by sbObjectStep().
static void makelatticesprings | ( | Lattice * | lt, |
BodySpring * | bs, | ||
int | dostiff, | ||
Object * | ob | ||
) | [static] |
Definition at line 3425 of file softbody.c.
References Lattice::def, globallen(), BodySpring::len, NULL, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, SB_BEND, SB_EDGE, BodySpring::springtype, BodySpring::v1, BodySpring::v2, and simple_enum_gen::w.
Referenced by lattice_to_softbody().
static void mesh_faces_to_scratch | ( | Object * | ob | ) | [static] |
Definition at line 3367 of file softbody.c.
References SBScratch::bodyface, Object::data, BodyFace::ext_force, BodyFace::flag, MEM_mallocN(), Mesh::mface, SoftBody::scratch, Object::soft, Mesh::totface, SBScratch::totface, BodyFace::v1, BodyFace::v2, BodyFace::v3, and BodyFace::v4.
Referenced by softbody_reset().
Definition at line 3262 of file softbody.c.
References add_2nd_order_springs(), add_mesh_quad_diag_springs(), SoftBody::bpoint, SoftBody::bspring, build_bps_springlist(), calculate_collision_balls(), Object::data, SoftBody::defgoal, defgroup_name_index(), get_scalar_from_vertexgroup(), BodyPoint::goal, BodyPoint::mass, Mesh::medge, SoftBody::namedVG_Mass, SoftBody::namedVG_Spring_K, OB_SB_EDGES, OB_SB_GOAL, OB_SB_QUADS, OB_SB_SELF, renew_softbody(), SB_EDGE, SoftBody::secondspring, Object::soft, Object::softflag, springs_from_mesh(), BodySpring::springtype, BodyPoint::springweight, Mesh::totedge, Mesh::totvert, MEdge::v1, BodySpring::v1, MEdge::v2, BodySpring::v2, and SoftBody::vertgroup.
Referenced by sbObjectStep().
static int object_has_edges | ( | Object * | ob | ) | [static] |
Definition at line 3760 of file softbody.c.
References Object::data, OB_LATTICE, OB_MESH, and Object::type.
Referenced by sbObjectStep().
Definition at line 1006 of file softbody.c.
References are_there_deflectors(), and Object::lay.
Referenced by softbody_calc_forces(), softbody_calc_forcesEx(), and softbody_step().
static void reference_to_scratch | ( | Object * | ob | ) | [static] |
Definition at line 3389 of file softbody.c.
References _final_mass(), add_v3_v3(), SoftBody::bpoint, ReferenceState::com, copy_v3_v3(), ReferenceState::ivert, MEM_mallocN(), mul_v3_fl(), BodyPoint::pos, SBScratch::Ref, SoftBody::scratch, Object::soft, and SoftBody::totpoint.
Referenced by softbody_reset().
Definition at line 845 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, BodyPoint::choke, BodyPoint::choke2, BodyPoint::colball, SoftBody::defgoal, free_softbody_intern(), BodyPoint::frozen, BodyPoint::goal, i, BodyPoint::loc_flag, BodyPoint::mass, MEM_mallocN(), BodyPoint::nofsprings, NULL, OB_SB_GOAL, sbNew(), Object::soft, Object::softflag, BodyPoint::springs, BodyPoint::springweight, SoftBody::totpoint, and SoftBody::totspring.
Referenced by curve_surf_to_softbody(), lattice_to_softbody(), mesh_to_softbody(), and sbObjectStep().
static void sb_cf_threads_run | ( | Scene * | scene, |
Object * | ob, | ||
float | forcetime, | ||
float | timenow, | ||
int | totpoint, | ||
int * | UNUSEDptr_to_break_func(void), | ||
struct ListBase * | do_effector, | ||
int | do_deflector, | ||
float | fieldfactor, | ||
float | windfactor | ||
) | [static] |
Definition at line 2381 of file softbody.c.
References BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), BLI_system_thread_count(), SB_thread_context::do_deflector, SB_thread_context::do_effector, exec_softbody_calc_forces(), SB_thread_context::fieldfactor, SB_thread_context::forcetime, i, SB_thread_context::ifirst, SB_thread_context::ilast, left(), MEM_callocN(), MEM_freeN(), RenderData::mode, SB_thread_context::nr, SB_thread_context::ob, Scene::r, R_FIXED_THREADS, SB_thread_context::scene, RenderData::threads, threads, SB_thread_context::timenow, SB_thread_context::tot, and SB_thread_context::windfactor.
Referenced by softbody_calc_forcesEx().
static int sb_deflect_face | ( | Object * | ob, |
float * | actpos, | ||
float * | facenormal, | ||
float * | force, | ||
float * | cf, | ||
float | time, | ||
float * | vel, | ||
float * | intrusion | ||
) | [static] |
Definition at line 2028 of file softbody.c.
References copy_v3_v3(), Object::lay, and sb_detect_vertex_collisionCached().
Referenced by _softbody_calc_forces_slice_in_a_thread(), and softbody_calc_forces().
static int sb_detect_aabb_collisionCached | ( | float | UNUSEDforce[3], |
unsigned int | UNUSEDpar_layer, | ||
struct Object * | vertexowner, | ||
float | UNUSEDtime | ||
) | [static] |
Definition at line 1014 of file softbody.c.
References SBScratch::aabbmax, SBScratch::aabbmin, ccd_Mesh::bbmax, ccd_Mesh::bbmin, BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), SBScratch::colliderhash, copy_v3_v3(), PartDeflect::deflect, hash, ccd_Mesh::mface, ccd_Mesh::mima, ccd_Mesh::mprevvert, ccd_Mesh::mvert, NULL, Object::pd, SoftBody::scratch, Object::soft, and ccd_Mesh::totface.
Referenced by softbody_calc_forces(), and softbody_calc_forcesEx().
static int sb_detect_edge_collisionCached | ( | float | edge_v1[3], |
float | edge_v2[3], | ||
float * | damp, | ||
float | force[3], | ||
unsigned int | UNUSEDpar_layer, | ||
struct Object * | vertexowner, | ||
float | time | ||
) | [static] |
Definition at line 1408 of file softbody.c.
References ccd_Mesh::bbmax, ccd_Mesh::bbmin, BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), MVert::co, SBScratch::colliderhash, copy_v3_v3(), cross_v3_v3v3(), PartDeflect::deflect, dot_v3v3(), hash, isect_line_tri_v3(), len_v3v3(), MAX2, ccdf_minmax::maxx, ccdf_minmax::maxy, ccdf_minmax::maxz, ccd_Mesh::mface, ccd_Mesh::mima, MIN2, ccdf_minmax::minx, ccdf_minmax::miny, ccdf_minmax::minz, ccd_Mesh::mprevvert, mul_v3_fl(), ccd_Mesh::mvert, normalize_v3(), NULL, Object::pd, PartDeflect::pdef_sbdamp, SoftBody::scratch, Object::soft, sub_v3_v3v3(), ccd_Mesh::totface, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and Vec3PlusStVec().
Referenced by _scan_for_ext_spring_forces().
static int sb_detect_face_collisionCached | ( | float | face_v1[3], |
float | face_v2[3], | ||
float | face_v3[3], | ||
float * | damp, | ||
float | force[3], | ||
unsigned int | UNUSEDpar_layer, | ||
struct Object * | vertexowner, | ||
float | time | ||
) | [static] |
Definition at line 1182 of file softbody.c.
References ccd_Mesh::bbmax, ccd_Mesh::bbmin, BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), MVert::co, SBScratch::colliderhash, copy_v3_v3(), cross_v3_v3v3(), PartDeflect::deflect, hash, isect_line_tri_v3(), MAX3(), ccdf_minmax::maxx, ccdf_minmax::maxy, ccdf_minmax::maxz, ccd_Mesh::mface, ccd_Mesh::mima, MIN3, ccdf_minmax::minx, ccdf_minmax::miny, ccdf_minmax::minz, ccd_Mesh::mprevvert, mul_v3_fl(), ccd_Mesh::mvert, normalize_v3(), NULL, Object::pd, PartDeflect::pdef_sbdamp, SoftBody::scratch, Object::soft, sub_v3_v3v3(), ccd_Mesh::totface, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and Vec3PlusStVec().
Referenced by scan_for_ext_face_forces().
static int sb_detect_face_pointCached | ( | float | face_v1[3], |
float | face_v2[3], | ||
float | face_v3[3], | ||
float * | damp, | ||
float | force[3], | ||
unsigned int | UNUSEDpar_layer, | ||
struct Object * | vertexowner, | ||
float | time | ||
) | [static] |
Definition at line 1084 of file softbody.c.
References ABS, ccd_Mesh::bbmax, ccd_Mesh::bbmin, BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), co, SBScratch::colliderhash, copy_v3_v3(), cross_v3_v3v3(), PartDeflect::deflect, dot_v3v3(), KDL::exp(), hash, isect_point_tri_prism_v3(), MAX3(), MIN3, ccd_Mesh::mprevvert, mul_v3_fl(), ccd_Mesh::mvert, normalize_v3(), NULL, Object::pd, PartDeflect::pdef_sbdamp, PartDeflect::pdef_sboft, SoftBody::scratch, Object::soft, sub_v3_v3(), sub_v3_v3v3(), ccd_Mesh::totvert, and Vec3PlusStVec().
Referenced by scan_for_ext_face_forces().
static int sb_detect_vertex_collisionCached | ( | float | opco[3], |
float | facenormal[3], | ||
float * | damp, | ||
float | force[3], | ||
unsigned int | UNUSEDpar_layer, | ||
struct Object * | vertexowner, | ||
float | time, | ||
float | vel[3], | ||
float * | intrusion | ||
) | [static] |
Definition at line 1737 of file softbody.c.
References add_v3_v3(), ccd_Mesh::bbmax, ccd_Mesh::bbmin, BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), choose_winner(), closest_to_line_segment_v3(), MVert::co, SBScratch::colliderhash, copy_v3_v3(), cross_v3_v3v3(), PartDeflect::deflect, dot_v3v3(), KDL::exp(), G, hash, isect_point_tri_prism_v3(), ccdf_minmax::maxx, ccdf_minmax::maxy, ccdf_minmax::maxz, ccd_Mesh::mface, ccd_Mesh::mima, ccdf_minmax::minx, ccdf_minmax::miny, ccdf_minmax::minz, ccd_Mesh::mprevvert, mul_v3_fl(), ccd_Mesh::mvert, normalize_v3(), normalize_v3_v3(), NULL, Object::pd, PartDeflect::pdef_sbdamp, PartDeflect::pdef_sbift, PartDeflect::pdef_sboft, SoftBody::scratch, Object::soft, sub_v3_v3v3(), ccd_Mesh::totface, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and Vec3PlusStVec().
Referenced by sb_deflect_face().
void SB_estimate_transform | ( | Object * | ob, |
float | lloc[3], | ||
float | lrot[3][3], | ||
float | lscale[3][3] | ||
) |
Definition at line 3816 of file softbody.c.
References SoftBody::bpoint, copy_m3_m3(), copy_v3_v3(), ReferenceState::ivert, SoftBody::lcom, SoftBody::lrot, SoftBody::lscale, MEM_callocN(), MEM_freeN(), NULL, BodyPoint::pos, ReferenceVert::pos, SBScratch::Ref, SoftBody::scratch, Object::soft, SoftBody::totpoint, and vcloud_estimate_transform().
Referenced by softbody_reset(), and softbody_to_object().
static float sb_fric_force_scale | ( | Object * | UNUSEDob | ) | [static] |
Definition at line 187 of file softbody.c.
Referenced by _softbody_calc_forces_slice_in_a_thread(), sb_spring_force(), and softbody_calc_forces().
static float sb_grav_force_scale | ( | Object * | UNUSEDob | ) | [static] |
Definition at line 179 of file softbody.c.
Referenced by _softbody_calc_forces_slice_in_a_thread(), and softbody_calc_forces().
static void sb_new_scratch | ( | SoftBody * | sb | ) | [static] |
Definition at line 3667 of file softbody.c.
References SBScratch::aabbmax, SBScratch::aabbmin, BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), SBScratch::bodyface, SBScratch::colliderhash, ReferenceState::ivert, MEM_callocN(), NULL, SBScratch::Ref, SoftBody::scratch, and SBScratch::totface.
Referenced by sbNew(), and softbody_reset().
static void sb_sfesf_threads_run | ( | Scene * | scene, |
struct Object * | ob, | ||
float | timenow, | ||
int | totsprings, | ||
int * | UNUSEDptr_to_break_func(void) | ||
) | [static] |
Definition at line 1648 of file softbody.c.
References BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), BLI_system_thread_count(), SB_thread_context::do_deflector, SB_thread_context::do_effector, SoftBody::effector_weights, exec_scan_for_ext_spring_forces(), SB_thread_context::fieldfactor, SB_thread_context::forcetime, i, SB_thread_context::ifirst, SB_thread_context::ilast, left(), MEM_callocN(), MEM_freeN(), RenderData::mode, SB_thread_context::nr, NULL, SB_thread_context::ob, pdEndEffectors(), pdInitEffectors(), Scene::r, R_FIXED_THREADS, SB_thread_context::scene, Object::soft, RenderData::threads, threads, SB_thread_context::timenow, SB_thread_context::tot, and SB_thread_context::windfactor.
Referenced by softbody_calc_forcesEx().
static void sb_spring_force | ( | Object * | ob, |
int | bpi, | ||
BodySpring * | bs, | ||
float | iks, | ||
float | UNUSEDforcetime, | ||
int | nl_flags | ||
) | [static] |
Definition at line 2073 of file softbody.c.
References SoftBody::bpoint, distance(), dot_v3v3(), BodyPoint::force, BodyPoint::goal, SoftBody::infrict, SoftBody::inpush, SoftBody::inspring, BodySpring::len, NLF_BUILD, normalize_v3(), BodyPoint::pos, SB_BEND, SB_EDGE, sb_fric_force_scale(), SB_HANDLE, SB_STIFFQUAD, SoftBody::secondspring, SoftBody::shearstiff, Object::soft, SOFTGOALSNAP, BodySpring::springtype, BodyPoint::springweight, sub_v3_v3v3(), BodySpring::v1, BodySpring::v2, BodyPoint::vec, and Vec3PlusStVec().
Referenced by _softbody_calc_forces_slice_in_a_thread(), and softbody_calc_forces().
static float sb_time_scale | ( | Object * | ob | ) | [static] |
Definition at line 195 of file softbody.c.
References SoftBody::physics_speed, and Object::soft.
Referenced by softbody_apply_forces().
void sbFree | ( | SoftBody * | sb | ) |
Definition at line 3737 of file softbody.c.
References BKE_ptcache_free_list(), SoftBody::effector_weights, free_softbody_intern(), MEM_freeN(), NULL, SoftBody::pointcache, and SoftBody::ptcaches.
Referenced by copy_attr(), free_object(), object_free_softbody(), and object_modifier_remove().
void sbFreeSimulation | ( | SoftBody * | sb | ) |
Definition at line 3747 of file softbody.c.
References free_softbody_intern().
Referenced by BKE_ptcache_id_reset().
Definition at line 3684 of file softbody.c.
References SoftBody::balldamp, SoftBody::ballstiff, BKE_add_effector_weights(), BKE_ptcache_add(), SoftBody::choke, SoftBody::colball, SoftBody::defgoal, SoftBody::effector_weights, RenderData::efra, SoftBody::efra, SoftBody::goalfrict, SoftBody::goalspring, SoftBody::grav, SoftBody::infrict, SoftBody::inpush, SoftBody::inspring, SoftBody::interval, SoftBody::last_frame, SoftBody::maxgoal, SoftBody::maxloops, SoftBody::mediafrict, MEM_callocN(), MINFRAME, SoftBody::mingoal, SoftBody::minloops, SoftBody::nodemass, NULL, SoftBody::physics_speed, SoftBody::pointcache, SoftBody::ptcaches, Scene::r, SoftBody::rklimit, sb_new_scratch(), SoftBody::sbc_mode, SBSO_OLDERR, RenderData::sfra, SoftBody::sfra, SoftBody::shearstiff, and SoftBody::solverflags.
Referenced by ED_object_modifier_add(), and renew_softbody().
Definition at line 4048 of file softbody.c.
References BKE_ptcache_get_continue_physics(), BKE_ptcache_id_from_softbody(), BKE_ptcache_id_reset(), BKE_ptcache_id_time(), BKE_ptcache_invalidate(), BKE_ptcache_read(), BKE_ptcache_validate(), BKE_ptcache_write(), SoftBody::bpoint, SoftBody::bspring, curve_surf_to_softbody(), PointCache::flag, PointCache::last_exact, SoftBody::last_frame, lattice_to_softbody(), SoftBody::local, mesh_to_softbody(), NULL, OB_CURVE, OB_LATTICE, OB_MESH, OB_SB_EDGES, OB_SURF, object_has_edges(), SoftBody::pointcache, PTCACHE_BAKED, PTCACHE_OUTDATED, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED, PTCACHE_READ_OLD, PTCACHE_REDO_NEEDED, PTCACHE_RESET_OUTDATED, renew_softbody(), PointCache::simframe, Object::soft, softbody_reset(), softbody_step(), softbody_to_object(), softbody_update_positions(), Object::softflag, SoftBody::totpoint, and Object::type.
Referenced by deformVerts().
void sbObjectToSoftbody | ( | Object * | ob | ) |
Definition at line 3753 of file softbody.c.
References free_softbody_intern(), and Object::soft.
void sbSetInterruptCallBack | ( | int(*)(void) | f | ) |
Definition at line 3774 of file softbody.c.
References SB_localInterruptCallBack.
static void scan_for_ext_face_forces | ( | Object * | ob, |
float | timenow | ||
) | [static] |
Definition at line 1320 of file softbody.c.
References BFF_CLOSEVERT, BFF_INTERSECT, SBScratch::bodyface, SoftBody::bpoint, BodyPoint::choke2, BodyFace::ext_force, BodyFace::flag, BodyPoint::force, Object::lay, MAX2, MIN2, BodyPoint::pos, sb_detect_face_collisionCached(), sb_detect_face_pointCached(), SoftBody::scratch, Object::soft, SBScratch::totface, BodyFace::v1, BodyFace::v2, BodyFace::v3, BodyFace::v4, and Vec3PlusStVec().
Referenced by softbody_calc_forces(), and softbody_calc_forcesEx().
Definition at line 1631 of file softbody.c.
References _scan_for_ext_spring_forces(), SoftBody::effector_weights, NULL, pdEndEffectors(), pdInitEffectors(), Object::soft, and SoftBody::totspring.
Referenced by softbody_calc_forces().
static void softbody_apply_forces | ( | Object * | ob, |
float | forcetime, | ||
int | mode, | ||
float * | err, | ||
int | mid_flags | ||
) | [static] |
Definition at line 2893 of file softbody.c.
References _final_goal(), _final_mass(), SBScratch::aabbmax, SBScratch::aabbmin, ABS, add_v3_v3(), SoftBody::bpoint, BodyPoint::choke, BodyPoint::choke2, copy_v3_v3(), BodyPoint::force, SoftBody::fuzzyness, BodyPoint::loc_flag, MAX2, MID_PRESERVE, MIN2, mul_v3_fl(), BodyPoint::pos, BodyPoint::prevdv, BodyPoint::prevdx, BodyPoint::prevpos, BodyPoint::prevvec, sb_time_scale(), SBF_DOFUZZY, SBSO_OLDERR, SoftBody::scratch, Object::soft, SOFTGOALSNAP, SoftBody::solverflags, SoftBody::totpoint, and BodyPoint::vec.
Referenced by softbody_step().
static void softbody_apply_goalsnap | ( | Object * | ob | ) | [static] |
Definition at line 3121 of file softbody.c.
References _final_goal(), SoftBody::bpoint, copy_v3_v3(), BodyPoint::origT, BodyPoint::pos, BodyPoint::prevpos, Object::soft, SOFTGOALSNAP, and SoftBody::totpoint.
Referenced by softbody_step().
static void softbody_calc_forces | ( | Scene * | scene, |
Object * | ob, | ||
float | forcetime, | ||
float | timenow, | ||
int | nl_flags | ||
) | [static] |
Definition at line 2486 of file softbody.c.
References _final_goal(), _final_mass(), ABS, add_v3_v3(), add_v3_v3v3(), SoftBody::aeroedge, SoftBody::balldamp, SoftBody::ballstiff, SoftBody::bpoint, BSF_INTERSECT, SoftBody::bspring, BodySpring::cf, SoftBody::choke, BodyPoint::choke, BodyPoint::choke2, BodyPoint::colball, compare(), copy_v3_v3(), distance(), SoftBody::effector_weights, BodySpring::ext_force, BodySpring::flag, SBScratch::flag, PhysicsSettings::flag, BodyPoint::force, G, EffectorWeights::global_gravity, SoftBody::goalfrict, SoftBody::goalspring, PhysicsSettings::gravity, BodyPoint::impdv, SoftBody::inspring, Object::lay, BodyPoint::loc_flag, madd_v3_v3fl(), SoftBody::mediafrict, mid_v3_v3v3(), mul_v3_fl(), NL_MATRIX, NL_SYSTEM, nlEnd(), NLF_BUILD, NLF_SOLVE, nlGetVariable(), nlPrintMatrix(), nlRightHandSideSet(), nlSolveAdvanced(), BodyPoint::nofsprings, normalize_v3(), NULL, OB_SB_EDGECOLL, OB_SB_EDGES, OB_SB_FACECOLL, OB_SB_GOAL, OB_SB_SELF, BodyPoint::origE, BodyPoint::origS, BodyPoint::origT, pd_point_from_soft(), pdDoEffectors(), pdEndEffectors(), pdInitEffectors(), PHYS_GLOBAL_GRAVITY, Scene::physics_settings, BodyPoint::pos, query_external_colliders(), sb_deflect_face(), sb_detect_aabb_collisionCached(), sb_fric_force_scale(), sb_grav_force_scale(), sb_spring_force(), SBF_DOFUZZY, scan_for_ext_face_forces(), scan_for_ext_spring_forces(), SoftBody::scratch, Object::soft, softbody_calc_forcesEx(), Object::softflag, SOFTGOALSNAP, BodyPoint::springs, sub_v3_v3v3(), SoftBody::totpoint, BodySpring::v1, BodySpring::v2, BodyPoint::vec, and Vec3PlusStVec().
Referenced by softbody_step().
static void softbody_calc_forcesEx | ( | Scene * | scene, |
Object * | ob, | ||
float | forcetime, | ||
float | timenow, | ||
int | UNUSEDnl_flags | ||
) | [static] |
Definition at line 2439 of file softbody.c.
References SoftBody::aeroedge, SoftBody::effector_weights, Object::lay, NULL, OB_SB_EDGECOLL, OB_SB_EDGES, OB_SB_FACECOLL, pdEndEffectors(), pdInitEffectors(), query_external_colliders(), sb_cf_threads_run(), sb_detect_aabb_collisionCached(), sb_sfesf_threads_run(), scan_for_ext_face_forces(), Object::soft, Object::softflag, SoftBody::totpoint, and SoftBody::totspring.
Referenced by softbody_calc_forces().
static void softbody_reset | ( | Object * | ob, |
SoftBody * | sb, | ||
float(*) | vertexCos[3], | ||
int | numVerts | ||
) | [static] |
Definition at line 3849 of file softbody.c.
References SoftBody::bpoint, copy_v3_v3(), free_scratch(), SoftBody::lcom, SoftBody::lrot, SoftBody::lscale, mesh_faces_to_scratch(), mul_m4_v3(), SBScratch::needstobuildcollider, NULL, OB_CURVE, OB_LATTICE, OB_MESH, OB_SB_FACECOLL, OB_SURF, Object::obmat, BodyPoint::origE, BodyPoint::origS, BodyPoint::origT, BodyPoint::pos, BodyPoint::prevdv, BodyPoint::prevdx, BodyPoint::prevpos, BodyPoint::prevvec, reference_to_scratch(), SB_estimate_transform(), sb_new_scratch(), SoftBody::scratch, Object::softflag, Object::type, unit_m3(), BodyPoint::vec, and zero_v3().
Referenced by sbObjectStep().
static void softbody_restore_prev_step | ( | Object * | ob | ) | [static] |
Definition at line 3028 of file softbody.c.
References SoftBody::bpoint, copy_v3_v3(), BodyPoint::pos, BodyPoint::prevpos, BodyPoint::prevvec, Object::soft, SoftBody::totpoint, and BodyPoint::vec.
Referenced by softbody_step().
Definition at line 3911 of file softbody.c.
References ABS, apply_spring_memory(), ccd_build_deflector_hash(), ccd_update_deflector_hash(), SBScratch::colliderhash, err, SBScratch::flag, G, G_DEBUG, HEUNWARNLIMIT, Object::id, interpolate_exciter(), MAX2, SoftBody::maxloops, MID_PRESERVE, MIN2, SoftBody::minloops, ID::name, SBScratch::needstobuildcollider, NULL, PIL_check_seconds_timer(), SoftBody::plastic, query_external_colliders(), SoftBody::rklimit, SB_localInterruptCallBack, SBF_DOFUZZY, SBSO_MONITOR, SoftBody::scratch, softbody_apply_forces(), softbody_apply_goalsnap(), softbody_calc_forces(), softbody_restore_prev_step(), SoftHeunTol, SoftBody::solver_ID, and SoftBody::solverflags.
Referenced by sbObjectStep().
static void softbody_to_object | ( | Object * | ob, |
float(*) | vertexCos[3], | ||
int | numVerts, | ||
int | local | ||
) | [static] |
Definition at line 3648 of file softbody.c.
References SoftBody::bpoint, copy_v3_v3(), Object::imat, invert_m4_m4(), SoftBody::lcom, SoftBody::lrot, SoftBody::lscale, mul_m4_v3(), Object::obmat, BodyPoint::pos, SB_estimate_transform(), SBSO_ESTIMATEIPO, Object::soft, and SoftBody::solverflags.
Referenced by sbObjectStep().
static void softbody_update_positions | ( | Object * | ob, |
SoftBody * | sb, | ||
float(*) | vertexCos[3], | ||
int | numVerts | ||
) | [static] |
Definition at line 3779 of file softbody.c.
References SoftBody::bpoint, copy_v3_v3(), mul_m4_v3(), Object::obmat, BodyPoint::origE, BodyPoint::origS, and BodyPoint::origT.
Referenced by sbObjectStep().
static void springs_from_mesh | ( | Object * | ob | ) | [static] |
Definition at line 3223 of file softbody.c.
References SoftBody::bpoint, SoftBody::bspring, MVert::co, copy_v3_v3(), Object::data, BodySpring::len, len_v3v3(), mul_m4_v3(), Mesh::mvert, Object::obmat, BodyPoint::origS, Object::soft, SoftBody::springpreload, SoftBody::totspring, Mesh::totvert, BodySpring::v1, and BodySpring::v2.
Referenced by mesh_to_softbody().
static void Vec3PlusStVec | ( | float * | v, |
float | s, | ||
float * | v1 | ||
) | [static] |
Definition at line 984 of file softbody.c.
Referenced by _scan_for_ext_spring_forces(), _softbody_calc_forces_slice_in_a_thread(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), sb_spring_force(), scan_for_ext_face_forces(), and softbody_calc_forces().
const int CCD_SAVETY = 190561 [static] |
Definition at line 268 of file softbody.c.
Referenced by ccd_mesh_make().
int(* SB_localInterruptCallBack)(void) = NULL [static] |
Definition at line 87 of file softbody.c.
Referenced by sbSetInterruptCallBack(), and softbody_step().
float SoftHeunTol = 1.0f [static] |
Definition at line 168 of file softbody.c.
Referenced by softbody_step().