diff options
author | Ton Roosendaal <ton@blender.org> | 2005-04-02 17:57:23 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-04-02 17:57:23 +0400 |
commit | bdb86d7c6765724d297e7aa97dec4c0cc7d2bae9 (patch) | |
tree | fd00e10fd560504d58150c8ce13ce9fb11dd5b9a /source/blender/blenkernel/BKE_softbody.h | |
parent | 02d3ad0b34c88be3cd8b581812a7faa08fa16d1b (diff) |
Integration stage of Softbody project
User level notes are in Wiki here;
http://wiki.blender.org/bin/view.pl/Blenderdev/Softbodies
And will be added in blender3d.org CMS later.
Tech level notes are still pending, but here's the most relevant ones;
- made ob->soft struct SoftBody to hold all settings, and read/save in
files
- added (temporal!) conversion for the old settings. So: read old files
with softbody experiments now, and save over!
- cleaned API calls for softbody, which are only 5 of them now:
sbNew()
sbFree()
sbObjectStep() (animation steps)
sbObjectToSoftbody() (full re-initialize data)
sbObjectReset() (only reset motion)
- API calls accepts time in frames now, within softbody.c it converts
Further, internally code was cleaned some (missing tabs etc). Also tried
to keep a well defined structure with hints how to add support for more
objects. Can write notes about that...
Diffstat (limited to 'source/blender/blenkernel/BKE_softbody.h')
-rw-r--r-- | source/blender/blenkernel/BKE_softbody.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h index 24abff44a2b..09be644c9e7 100644 --- a/source/blender/blenkernel/BKE_softbody.h +++ b/source/blender/blenkernel/BKE_softbody.h @@ -46,29 +46,23 @@ typedef struct BodySpring { float len, strength; } BodySpring; -typedef struct SoftBody { - int totpoint, totspring; - - BodyPoint *bpoint; - BodySpring *bspring; - - float ctime; // last time calculated -} SoftBody; +struct Object; +struct SoftBody; -/* temporal data, nothing saved in file */ -extern void free_softbody(SoftBody *sb); +/* allocates and initializes general main data */ +extern struct SoftBody *sbNew(void); -/* makes totally fresh start situation */ -extern void object_to_softbody(Object *ob,float ctime); +/* frees internal data and softbody itself */ +extern void sbFree(struct SoftBody *sb); -/* copy original (but new) situation in softbody, as result of matrices or deform */ -void object_update_softbody(Object *ob); +/* go one step in simulation, copy result in displist vertices */ +extern void sbObjectStep(struct Object *ob, float framnr); -/* copies softbody result back to object (in displist) */ -extern void softbody_to_object(Object *ob); +/* makes totally fresh start situation, resets time */ +extern void sbObjectToSoftbody(struct Object *ob); -/* go one step in simulation */ -extern void object_softbody_step(Object *ob, float ctime); +/* resets all motion and time */ +extern void sbObjectReset(struct Object *ob); #endif |