Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-04-02 17:57:23 +0400
committerTon Roosendaal <ton@blender.org>2005-04-02 17:57:23 +0400
commitbdb86d7c6765724d297e7aa97dec4c0cc7d2bae9 (patch)
treefd00e10fd560504d58150c8ce13ce9fb11dd5b9a /source/blender/makesdna
parent02d3ad0b34c88be3cd8b581812a7faa08fa16d1b (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/makesdna')
-rw-r--r--source/blender/makesdna/DNA_object_types.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 8c52da30bc0..4addd3ddff0 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -51,7 +51,8 @@ struct BoundBox;
struct Path;
struct Material;
struct bConstraintChannel;
-struct SoftBody;
+struct BodyPoint;
+struct BodySpring;
typedef struct bDeformGroup {
struct bDeformGroup *next, *prev;
@@ -90,6 +91,31 @@ typedef struct PartDeflect {
float f_power; /* The power law - real gravitation is 2 (square) */
} PartDeflect;
+typedef struct SoftBody {
+ /* dynamic data */
+ int totpoint, totspring;
+ struct BodyPoint *bpoint; /* not saved in file */
+ struct BodySpring *bspring; /* not saved in file */
+ float ctime; /* last time calculated */
+
+ /* part of UI: */
+ float nodemass; /* softbody mass of *vertex* */
+ float grav; /* softbody amount of gravitaion to apply */
+ float mediafrict; /* friction to env */
+ float rklimit; /* error limit for ODE solver */
+
+ 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 */
+
+ float pad;
+
+} SoftBody;
+
typedef struct Object {
ID id;
@@ -150,7 +176,7 @@ typedef struct Object {
* For a Sphere, the form factor is by default = 0.4
*/
- float formfactor, softtime; /* springf temp for softbody */
+ float formfactor, softtime; /* softtime temp for softbody, remove it before release! */
float rdamping, sizefac;
char dt, dtx;
@@ -194,7 +220,7 @@ typedef struct Object {
ListBase hooks;
PartDeflect *pd; /* particle deflector/attractor/collision data */
- struct SoftBody *soft; /* only runtime, not saved in file! */
+ struct SoftBody *soft; /* if exists, saved in file */
struct Life *life;
LBuf lbuf;
@@ -387,6 +413,14 @@ extern Object workob;
#define OB_ADDACT 1024
#define OB_SHOWCONT 2048
+/* ob->softflag */
+#define OB_SB_ENABLE 1
+#define OB_SB_GOAL 2
+#define OB_SB_EDGES 4
+#define OB_SB_QUADS 8
+#define OB_SB_POSTDEF 16
+
+
#ifdef __cplusplus
}
#endif