Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
softbody.c File Reference
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_collection.h"
#include "BKE_collision.h"
#include "BKE_curve.h"
#include "BKE_deform.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "BKE_softbody.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.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
 

Macros

#define MID_PRESERVE   1
 
#define SOFTGOALSNAP   0.999f
 
#define HEUNWARNLIMIT   1 /* 500 would be fine i think for detecting severe *stiff* stuff */
 
#define BSF_INTERSECT   1 /* edge intersects collider face */
 
#define SBF_DOFUZZY   1 /* Bodypoint do fuzzy. */
 
#define SBF_OUTOFCOLLISION   2 /* Bodypoint does not collide. */
 
#define BFF_INTERSECT   1 /* collider edge intrudes face. */
 
#define BFF_CLOSEVERT   2 /* collider vertex repulses face. */
 

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 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_Meshccd_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_single (GHash *hash, Object *ob)
 
static void ccd_build_deflector_hash (Depsgraph *depsgraph, Collection *collection, Object *vertexowner, GHash *hash)
 
static void ccd_update_deflector_hash_single (GHash *hash, Object *ob)
 
static void ccd_update_deflector_hash (Depsgraph *depsgraph, Collection *collection, 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 (Object *ob, int totpoint, int totspring)
 
static void free_softbody_baked (SoftBody *sb)
 
static void free_scratch (SoftBody *sb)
 
static int query_external_colliders (Depsgraph *depsgraph, Collection *collection)
 
static int sb_detect_aabb_collisionCached (float UNUSED(force[3]), struct Object *vertexowner, float UNUSED(time))
 
static int sb_detect_face_pointCached (const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, float force[3], struct Object *vertexowner, float time)
 
static int sb_detect_face_collisionCached (const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, float force[3], struct Object *vertexowner, float time)
 
static void scan_for_ext_face_forces (Object *ob, float timenow)
 
static int sb_detect_edge_collisionCached (const float edge_v1[3], const float edge_v2[3], float *damp, float force[3], struct Object *vertexowner, float time)
 
static void _scan_for_ext_spring_forces (Scene *scene, Object *ob, float timenow, int ifirst, int ilast, struct ListBase *effectors)
 
static voidexec_scan_for_ext_spring_forces (void *data)
 
static void sb_sfesf_threads_run (struct Depsgraph *depsgraph, 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], 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))
 
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 *effectors, int do_deflector, float fieldfactor, float windfactor)
 
static voidexec_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 *effectors, int do_deflector, float fieldfactor, float windfactor)
 
static void softbody_calc_forces (struct Depsgraph *depsgraph, Scene *scene, Object *ob, float forcetime, float timenow)
 
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 springs_from_mesh (Object *ob)
 
static void mesh_to_softbody (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 (Object *ob)
 
static void curve_surf_to_softbody (Object *ob)
 
static void softbody_to_object (Object *ob, float(*vertexCos)[3], int numVerts, int local)
 
static void sb_new_scratch (SoftBody *sb)
 
SoftBodysbNew (void)
 
void sbFree (Object *ob)
 
void sbFreeSimulation (SoftBody *sb)
 
void sbObjectToSoftbody (Object *ob)
 
static bool object_has_edges (const 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 (struct Depsgraph *depsgraph, Scene *scene, Object *ob, SoftBody *sb, float dtime)
 
static void sbStoreLastFrame (struct Depsgraph *depsgraph, Object *object, float framenr)
 
void sbObjectStep (struct Depsgraph *depsgraph, Scene *scene, Object *ob, float cfra, float(*vertexCos)[3], int numVerts)
 

Variables

static CLG_LogRef LOG = {"bke.softbody"}
 
static int(* SB_localInterruptCallBack )(void) = NULL
 
static float SoftHeunTol = 1.0f
 
static const int CCD_SAFETY = 190561
 

Macro Definition Documentation

◆ BFF_CLOSEVERT

#define BFF_CLOSEVERT   2 /* collider vertex repulses face. */

Definition at line 141 of file softbody.c.

◆ BFF_INTERSECT

#define BFF_INTERSECT   1 /* collider edge intrudes face. */

Definition at line 140 of file softbody.c.

◆ BSF_INTERSECT

#define BSF_INTERSECT   1 /* edge intersects collider face */

Definition at line 134 of file softbody.c.

◆ HEUNWARNLIMIT

#define HEUNWARNLIMIT   1 /* 500 would be fine i think for detecting severe *stiff* stuff */

Definition at line 132 of file softbody.c.

◆ MID_PRESERVE

#define MID_PRESERVE   1

Definition at line 126 of file softbody.c.

◆ SBF_DOFUZZY

#define SBF_DOFUZZY   1 /* Bodypoint do fuzzy. */

Definition at line 137 of file softbody.c.

◆ SBF_OUTOFCOLLISION

#define SBF_OUTOFCOLLISION   2 /* Bodypoint does not collide. */

Definition at line 138 of file softbody.c.

◆ SOFTGOALSNAP

#define SOFTGOALSNAP   0.999f

Definition at line 128 of file softbody.c.

Typedef Documentation

◆ BodyFace

typedef struct BodyFace BodyFace

◆ BodySpring

typedef struct BodySpring BodySpring

◆ ccd_Mesh

typedef struct ccd_Mesh ccd_Mesh

◆ ccdf_minmax

typedef struct ccdf_minmax ccdf_minmax

◆ ReferenceState

◆ ReferenceVert

typedef struct ReferenceVert ReferenceVert

◆ SB_thread_context

◆ SBScratch

typedef struct SBScratch SBScratch

Enumeration Type Documentation

◆ type_spring

Enumerator
SB_EDGE 
SB_BEND 
SB_STIFFQUAD 
SB_HANDLE 

Definition at line 74 of file softbody.c.

Function Documentation

◆ _final_goal()

static float _final_goal ( Object ob,
BodyPoint bp 
)
static

◆ _final_mass()

static float _final_mass ( Object ob,
BodyPoint bp 
)
static

◆ _scan_for_ext_spring_forces()

static void _scan_for_ext_spring_forces ( Scene scene,
Object ob,
float  timenow,
int  ifirst,
int  ilast,
struct ListBase effectors 
)
static

◆ _softbody_calc_forces_slice_in_a_thread()

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 effectors,
int  do_deflector,
float  fieldfactor,
float  windfactor 
)
static

◆ add_2nd_order_roller()

static void add_2nd_order_roller ( Object ob,
float   UNUSEDstiffness,
int *  counter,
int  addsprings 
)
static

◆ add_2nd_order_springs()

static void add_2nd_order_springs ( Object ob,
float  stiffness 
)
static

◆ add_bp_springlist()

static void add_bp_springlist ( BodyPoint bp,
int  springID 
)
static

Definition at line 711 of file softbody.c.

References MEM_callocN, MEM_freeN, BodyPoint::nofsprings, NULL, and BodyPoint::springs.

Referenced by build_bps_springlist().

◆ add_mesh_quad_diag_springs()

static void add_mesh_quad_diag_springs ( Object ob)
static

◆ apply_spring_memory()

static void apply_spring_memory ( Object ob)
static

◆ build_bps_springlist()

static void build_bps_springlist ( Object ob)
static

Do this once when sb is build it is O(N^2) so scanning for springs every iteration is too expensive.

Definition at line 734 of file softbody.c.

References Freestyle::a, add_bp_springlist(), usdtokens::b(), 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().

◆ calculate_collision_balls()

static void calculate_collision_balls ( Object ob)
static

◆ ccd_build_deflector_hash()

static void ccd_build_deflector_hash ( Depsgraph depsgraph,
Collection collection,
Object vertexowner,
GHash hash 
)
static
Note
collection overrides scene when not NULL.

Definition at line 504 of file softbody.c.

References BKE_collision_objects_create(), BKE_collision_objects_free(), ccd_build_deflector_hash_single(), depsgraph, eModifierType_Collision, hash, OB_MESH, and Object::type.

Referenced by softbody_step().

◆ ccd_build_deflector_hash_single()

static void ccd_build_deflector_hash_single ( GHash hash,
Object ob 
)
static

Definition at line 489 of file softbody.c.

References BLI_ghash_ensure_p(), ccd_mesh_make(), PartDeflect::deflect, hash, and Object::pd.

Referenced by ccd_build_deflector_hash().

◆ ccd_mesh_free()

static void ccd_mesh_free ( ccd_Mesh ccdm)
static

◆ ccd_mesh_make()

static ccd_Mesh* ccd_mesh_make ( Object ob)
static

◆ ccd_mesh_update()

static void ccd_mesh_update ( Object ob,
ccd_Mesh pccd_M 
)
static

◆ ccd_update_deflector_hash()

static void ccd_update_deflector_hash ( Depsgraph depsgraph,
Collection collection,
Object vertexowner,
GHash hash 
)
static
Note
collection overrides scene when not NULL.

Definition at line 541 of file softbody.c.

References BKE_collision_objects_create(), BKE_collision_objects_free(), ccd_update_deflector_hash_single(), depsgraph, eModifierType_Collision, hash, OB_MESH, and Object::type.

Referenced by softbody_step().

◆ ccd_update_deflector_hash_single()

static void ccd_update_deflector_hash_single ( GHash hash,
Object ob 
)
static

◆ choose_winner()

static int choose_winner ( float w,
float pos,
float a,
float b,
float c,
float ca,
float cb,
float cc 
)
static

◆ count_mesh_quads()

static int count_mesh_quads ( Mesh me)
static

Definition at line 567 of file softbody.c.

References Freestyle::a, Mesh::mpoly, result, MPoly::totloop, and Mesh::totpoly.

Referenced by add_mesh_quad_diag_springs().

◆ curve_surf_to_softbody()

static void curve_surf_to_softbody ( Object ob)
static

◆ exec_scan_for_ext_spring_forces()

static void* exec_scan_for_ext_spring_forces ( void data)
static

◆ exec_softbody_calc_forces()

static void* exec_softbody_calc_forces ( void data)
static

◆ free_scratch()

static void free_scratch ( SoftBody sb)
static

◆ free_softbody_baked()

static void free_softbody_baked ( SoftBody sb)
static

Definition at line 867 of file softbody.c.

References SoftBody::keys, MEM_freeN, MEM_SAFE_FREE, and SoftBody::totkey.

Referenced by free_softbody_intern().

◆ free_softbody_intern()

static void free_softbody_intern ( SoftBody sb)
static

◆ globallen()

static float globallen ( float v1,
float v2,
Object ob 
)
static

Definition at line 2802 of file softbody.c.

References copy_v3_v3(), len_v3v3(), mul_m4_v3(), Object::obmat, v1, and v2.

Referenced by curve_surf_to_softbody(), and makelatticesprings().

◆ interpolate_exciter()

static void interpolate_exciter ( Object ob,
int  timescale,
int  time 
)
static

◆ lattice_to_softbody()

static void lattice_to_softbody ( Object ob)
static

◆ makelatticesprings()

static void makelatticesprings ( Lattice lt,
BodySpring bs,
int  dostiff,
Object ob 
)
static

◆ mesh_faces_to_scratch()

static void mesh_faces_to_scratch ( Object ob)
static

◆ mesh_to_softbody()

static void mesh_to_softbody ( Object ob)
static

◆ object_has_edges()

static bool object_has_edges ( const Object ob)
static

Definition at line 3185 of file softbody.c.

References Object::data, OB_LATTICE, OB_MESH, and Object::type.

Referenced by sbObjectStep().

◆ query_external_colliders()

static int query_external_colliders ( Depsgraph depsgraph,
Collection collection 
)
static
Note
collection overrides scene when not NULL.

Definition at line 964 of file softbody.c.

References BKE_collision_objects_create(), BKE_collision_objects_free(), depsgraph, eModifierType_Collision, and NULL.

Referenced by softbody_calc_forces().

◆ reference_to_scratch()

static void reference_to_scratch ( Object ob)
static

◆ renew_softbody()

static void renew_softbody ( Object ob,
int  totpoint,
int  totspring 
)
static

◆ sb_cf_threads_run()

static void sb_cf_threads_run ( Scene scene,
Object ob,
float  forcetime,
float  timenow,
int  totpoint,
int *  UNUSEDptr_to_break_func(void),
struct ListBase effectors,
int  do_deflector,
float  fieldfactor,
float  windfactor 
)
static

◆ sb_deflect_face()

static int sb_deflect_face ( Object ob,
float actpos,
float facenormal,
float force,
float cf,
float  time,
float vel,
float intrusion 
)
static

◆ sb_detect_aabb_collisionCached()

static int sb_detect_aabb_collisionCached ( float   UNUSEDforce[3],
struct Object vertexowner,
float   UNUSEDtime 
)
static

◆ sb_detect_edge_collisionCached()

static int sb_detect_edge_collisionCached ( const float  edge_v1[3],
const float  edge_v2[3],
float damp,
float  force[3],
struct Object vertexowner,
float  time 
)
static

◆ sb_detect_face_collisionCached()

static int sb_detect_face_collisionCached ( const float  face_v1[3],
const float  face_v2[3],
const float  face_v3[3],
float damp,
float  force[3],
struct Object vertexowner,
float  time 
)
static

◆ sb_detect_face_pointCached()

static int sb_detect_face_pointCached ( const float  face_v1[3],
const float  face_v2[3],
const float  face_v3[3],
float damp,
float  force[3],
struct Object vertexowner,
float  time 
)
static

◆ sb_detect_vertex_collisionCached()

static int sb_detect_vertex_collisionCached ( float  opco[3],
float  facenormal[3],
float damp,
float  force[3],
struct Object vertexowner,
float  time,
float  vel[3],
float intrusion 
)
static

◆ SB_estimate_transform()

void SB_estimate_transform ( Object ob,
float  lloc[3],
float  lrot[3][3],
float  lscale[3][3] 
)

A precise position vector denoting the motion of the center of mass give a rotation/scale matrix using averaging method, that's why estimate and not calculate see: this is kind of reverse engineering: having to states of a point cloud and recover what happened our advantage here we know the identity of the vertex there are others methods giving other results.

Parameters
obAny object that can do soft-body e.g. mesh, lattice, curve.
llocOutput of the calculated location (or NULL).
lrotOutput of the calculated rotation (or NULL).
lscaleOutput for the calculated scale (or NULL).

For velocity & 2nd order stuff see: vcloud_estimate_transform_v3.

Definition at line 3227 of file softbody.c.

References Freestyle::a, SoftBody::bpoint, copy_m3_m3(), copy_v3_v3(), float(), 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_v3().

Referenced by softbody_reset(), and softbody_to_object().

◆ sb_fric_force_scale()

static float sb_fric_force_scale ( Object UNUSEDob)
static

Re-scaling unit of drag [1 / sec] to somehow reasonable put it to a function here, so we can add user options later without touching simulation code.

Definition at line 166 of file softbody.c.

Referenced by _softbody_calc_forces_slice_in_a_thread(), and sb_spring_force().

◆ sb_grav_force_scale()

static float sb_grav_force_scale ( Object UNUSEDob)
static

Since unit of g is [m/sec^2] and F = mass * g we re-scale unit mass of node to 1 gram put it to a function here, so we can add user options later without touching simulation code.

Definition at line 157 of file softbody.c.

Referenced by _softbody_calc_forces_slice_in_a_thread().

◆ sb_new_scratch()

static void sb_new_scratch ( SoftBody sb)
static

◆ sb_sfesf_threads_run()

static void sb_sfesf_threads_run ( struct Depsgraph depsgraph,
Scene scene,
struct Object ob,
float  timenow,
int  totsprings,
int *  UNUSEDptr_to_break_func(void) 
)
static

◆ sb_spring_force()

static void sb_spring_force ( Object ob,
int  bpi,
BodySpring bs,
float  iks,
float   UNUSEDforcetime 
)
static

◆ sb_time_scale()

static float sb_time_scale ( Object ob)
static

Defining the frames to real time relation.

Definition at line 174 of file softbody.c.

References SoftBody::physics_speed, and Object::soft.

Referenced by softbody_apply_forces().

◆ sbFree()

void sbFree ( struct Object ob)

◆ sbFreeSimulation()

void sbFreeSimulation ( struct SoftBody sb)

Frees simulation data to reset simulation.

Definition at line 3173 of file softbody.c.

References free_softbody_intern().

Referenced by BKE_ptcache_id_reset().

◆ sbNew()

SoftBody* sbNew ( void  )

◆ sbObjectStep()

void sbObjectStep ( struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob,
float  cfra,
float(*)  vertexCos[3],
int  numVerts 
)

◆ sbObjectToSoftbody()

void sbObjectToSoftbody ( struct Object ob)

Makes totally fresh start situation, resets time.

Definition at line 3178 of file softbody.c.

References free_softbody_intern(), and Object::soft.

◆ sbSetInterruptCallBack()

void sbSetInterruptCallBack ( int(*)(void f)

Soft-body global visible functions. Links the soft-body module to a 'test for Interrupt' function, pass NULL to clear the callback.

Definition at line 3197 of file softbody.c.

References SB_localInterruptCallBack.

◆ sbStoreLastFrame()

static void sbStoreLastFrame ( struct Depsgraph depsgraph,
Object object,
float  framenr 
)
static

◆ scan_for_ext_face_forces()

static void scan_for_ext_face_forces ( Object ob,
float  timenow 
)
static

◆ softbody_apply_forces()

static void softbody_apply_forces ( Object ob,
float  forcetime,
int  mode,
float err,
int  mid_flags 
)
static

So here is:

(v)' = a(cceleration) =
    sum(F_springs)/m + gravitation + some friction forces + more forces.

The ( ... )' operator denotes derivate respective time.

The euler step for velocity then becomes:

v(t + dt) = v(t) + a(t) * dt

Definition at line 2310 of file softbody.c.

References _final_goal(), _final_mass(), Freestyle::a, SBScratch::aabbmax, SBScratch::aabbmin, add_v3_v3(), SoftBody::bpoint, BodyPoint::choke, BodyPoint::choke2, copy_v3_v3(), dot_v3v3(), err, fabsf, BodyPoint::force, BodyPoint::frozen, SoftBody::fuzzyness, BodyPoint::loc_flag, max_ff(), MID_PRESERVE, min_ff(), minmax_v3v3_v3(), mul_v3_fl(), SoftBody::nodemass, 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().

◆ softbody_apply_goalsnap()

static void softbody_apply_goalsnap ( Object ob)
static

◆ softbody_calc_forces()

static void softbody_calc_forces ( struct Depsgraph depsgraph,
Scene scene,
Object ob,
float  forcetime,
float  timenow 
)
static

◆ softbody_reset()

static void softbody_reset ( Object ob,
SoftBody sb,
float(*)  vertexCos[3],
int  numVerts 
)
static

◆ softbody_restore_prev_step()

static void softbody_restore_prev_step ( Object ob)
static

◆ softbody_step()

static void softbody_step ( struct Depsgraph depsgraph,
Scene scene,
Object ob,
SoftBody sb,
float  dtime 
)
static

◆ softbody_to_object()

static void softbody_to_object ( Object ob,
float(*)  vertexCos[3],
int  numVerts,
int  local 
)
static

◆ softbody_update_positions()

static void softbody_update_positions ( Object ob,
SoftBody sb,
float(*)  vertexCos[3],
int  numVerts 
)
static

◆ springs_from_mesh()

static void springs_from_mesh ( Object ob)
static

Variable Documentation

◆ CCD_SAFETY

const int CCD_SAFETY = 190561
static

Definition at line 250 of file softbody.c.

Referenced by ccd_mesh_free(), and ccd_mesh_make().

◆ LOG

CLG_LogRef LOG = {"bke.softbody"}
static

variables on the UI for now

float mediafrict;  friction to env
float nodemass;    softbody mass of *vertex*
float grav;        softbody amount of gravitation to apply

float goalspring;  softbody goal springs
float goalfrict;   softbody goal springs friction
float mingoal;     quick limits for goal
float maxgoal;

float inspring;    softbody inner springs
float infrict;     softbody inner springs friction

Definition at line 67 of file softbody.c.

Referenced by _final_goal(), _final_mass(), _softbody_calc_forces_slice_in_a_thread(), add_2nd_order_roller(), sb_detect_aabb_collisionCached(), sb_detect_edge_collisionCached(), sb_detect_face_collisionCached(), sb_detect_face_pointCached(), sb_detect_vertex_collisionCached(), sb_spring_force(), and softbody_step().

◆ SB_localInterruptCallBack

int(* SB_localInterruptCallBack) (void) ( void  ) = NULL
static

Definition at line 70 of file softbody.c.

Referenced by sbSetInterruptCallBack(), and softbody_step().

◆ SoftHeunTol

float SoftHeunTol = 1.0f
static

Definition at line 144 of file softbody.c.

Referenced by softbody_step().