Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | BodyPoint |
Typedefs | |
typedef struct BodyPoint | BodyPoint |
Functions | |
struct SoftBody * | sbNew (void) |
void | sbFree (struct Object *ob) |
void | sbFreeSimulation (struct SoftBody *sb) |
void | sbObjectStep (struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float cfra, float(*vertexCos)[3], int numVerts) |
void | sbObjectToSoftbody (struct Object *ob) |
void | sbSetInterruptCallBack (int(*f)(void)) |
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.
ob | Any object that can do soft-body e.g. mesh, lattice, curve. |
lloc | Output of the calculated location (or NULL). |
lrot | Output of the calculated rotation (or NULL). |
lscale | Output 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().
Frees internal data and soft-body itself.
Definition at line 3148 of file softbody.c.
References BKE_ptcache_free_list(), SoftBody::effector_weights, free_softbody_intern(), Object::id, LIB_TAG_COPIED_ON_WRITE, MEM_freeN, NULL, SoftBody_Shared::pointcache, SoftBody_Shared::ptcaches, SoftBody::shared, Object::soft, and ID::tag.
Referenced by BKE_object_free_softbody(), object_free_data(), and object_modifier_remove().
Frees simulation data to reset simulation.
Definition at line 3173 of file softbody.c.
References free_softbody_intern().
Referenced by BKE_ptcache_id_reset().
Allocates and initializes general main data.
Definition at line 3099 of file softbody.c.
References SoftBody::balldamp, SoftBody::ballstiff, BKE_effector_add_weights(), BKE_ptcache_add(), SoftBody::choke, SoftBody::colball, SoftBody::defgoal, SoftBody::effector_weights, SoftBody::goalfrict, SoftBody::goalspring, SoftBody::grav, SoftBody::infrict, SoftBody::inpush, SoftBody::inspring, SoftBody::last_frame, SoftBody::maxgoal, SoftBody::maxloops, SoftBody::mediafrict, MEM_callocN, MINFRAME, SoftBody::mingoal, SoftBody::minloops, SoftBody::nodemass, NULL, SoftBody::physics_speed, SoftBody_Shared::pointcache, SoftBody_Shared::ptcaches, SoftBody::rklimit, sb_new_scratch(), SoftBody::sbc_mode, SBSO_OLDERR, SoftBody::shared, SoftBody::shearstiff, and SoftBody::solverflags.
Referenced by ED_object_modifier_add(), and renew_softbody().
void sbObjectStep | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct Object * | ob, | ||
float | cfra, | ||
float(*) | vertexCos[3], | ||
int | numVerts | ||
) |
Do one simulation step, reading and writing vertex locs from given array.
Definition at line 3492 of file softbody.c.
References 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(), DEG_is_active(), depsgraph, PointCache::flag, PointCache::last_exact, SoftBody::last_frame, lattice_to_softbody(), SoftBody::local, mesh_to_softbody(), NULL, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_SB_EDGES, OB_SURF, object_has_edges(), SoftBody_Shared::pointcache, PTCACHE_BAKED, PTCACHE_OUTDATED, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED, PTCACHE_READ_OLD, PTCACHE_REDO_NEEDED, PTCACHE_RESET_OUTDATED, Scene::r, renew_softbody(), sbStoreLastFrame(), scene, SoftBody::shared, PointCache::simframe, Object::soft, softbody_reset(), softbody_step(), softbody_to_object(), softbody_update_positions(), Object::softflag, RenderData::subframe, SoftBody::totpoint, and Object::type.
Referenced by deformVerts().
Makes totally fresh start situation, resets time.
Definition at line 3178 of file softbody.c.
References free_softbody_intern(), and Object::soft.
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.