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:
authorErwin Coumans <blender@erwincoumans.com>2008-09-28 07:07:13 +0400
committerErwin Coumans <blender@erwincoumans.com>2008-09-28 07:07:13 +0400
commitf8fb61f9fa0439cbdb6b43d79d82687692daea2f (patch)
tree3adc2d5e30830797bb7b1d41f2bfe26e31851225 /source/blender
parenta765f54b1a20bc8a5d12187b49a6da9652cc6bf6 (diff)
enable -noaudio option, so it actually works (and doesn't get overwritten by a game flag). audio initialization delays startup of game engine 2 seconds
add -nojoystick commandline option: it takes 5 seconds everytime to start the game engine, while there IS no joystick. In other words: blender -noaudio -nojoystick improves workflow turnaround times for P - ESC from 7 seconds to 1 second! Improved Bullet soft body advanced options, still work-in-progress. Make sure to create game Bullet soft bodies from scratch, it is not compatible with last weeks builds.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/bullet.c35
-rw-r--r--source/blender/makesdna/DNA_object_force.h50
-rw-r--r--source/blender/src/buttons_logic.c108
-rw-r--r--source/blender/src/space.c6
4 files changed, 157 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c
index 8e075669819..eeec4d0bd4e 100644
--- a/source/blender/blenkernel/intern/bullet.c
+++ b/source/blender/blenkernel/intern/bullet.c
@@ -45,10 +45,43 @@ BulletSoftBody *bsbNew(void)
bsb= MEM_callocN(sizeof(BulletSoftBody), "bulletsoftbody");
- bsb->flag = OB_BSB_SHAPE_MATCHING;
+ bsb->flag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT;
bsb->linStiff = 0.5f;
bsb->angStiff = 1.0f;
bsb->volume = 1.0f;
+
+
+ bsb->viterations = 0;
+ bsb->piterations = 2;
+ bsb->diterations = 0;
+ bsb->citerations = 4;
+
+ bsb->kSRHR_CL = 0.1f;
+ bsb->kSKHR_CL = 1.f;
+ bsb->kSSHR_CL = 0.5f;
+ bsb->kSR_SPLT_CL = 0.5f;
+
+ bsb->kSK_SPLT_CL = 0.5f;
+ bsb->kSS_SPLT_CL = 0.5f;
+ bsb->kVCF = 1;
+ bsb->kDP = 0;
+
+ bsb->kDG = 0;
+ bsb->kLF = 0;
+ bsb->kPR = 0;
+ bsb->kVC = 0;
+
+ bsb->kDF = 0.2f;
+ bsb->kMT = 0.05;
+ bsb->kCHR = 1.0f;
+ bsb->kKHR = 0.1f;
+
+ bsb->kSHR = 1.0f;
+ bsb->kAHR = 0.7f;
+ bsb->collisionflags = 0;
+ //bsb->collisionflags = OB_BSB_COL_CL_RS + OB_BSB_COL_CL_SS;
+ bsb->numclusteriterations = 64;
+
return bsb;
}
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 081b83c3d02..21c5242a703 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -85,14 +85,56 @@ typedef struct SBVertex {
} SBVertex;
typedef struct BulletSoftBody {
- int flag; /* various boolean options */
- float linStiff; /* linear stiffness 0..1 */
- float angStiff; /* angular stiffness 0..1 */
- float volume; /* volume preservation 0..1 */
+ int flag; /* various boolean options */
+ float linStiff; /* linear stiffness 0..1 */
+ float angStiff; /* angular stiffness 0..1 */
+ float volume; /* volume preservation 0..1 */
+
+ int viterations; /* Velocities solver iterations */
+ int piterations; /* Positions solver iterations */
+ int diterations; /* Drift solver iterations */
+ int citerations; /* Cluster solver iterations */
+
+ float kSRHR_CL; /* Soft vs rigid hardness [0,1] (cluster only) */
+ float kSKHR_CL; /* Soft vs kinetic hardness [0,1] (cluster only) */
+ float kSSHR_CL; /* Soft vs soft hardness [0,1] (cluster only) */
+ float kSR_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
+
+ float kSK_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
+ float kSS_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
+ float kVCF; /* Velocities correction factor (Baumgarte) */
+ float kDP; /* Damping coefficient [0,1] */
+
+ float kDG; /* Drag coefficient [0,+inf] */
+ float kLF; /* Lift coefficient [0,+inf] */
+ float kPR; /* Pressure coefficient [-inf,+inf] */
+ float kVC; /* Volume conversation coefficient [0,+inf] */
+
+ float kDF; /* Dynamic friction coefficient [0,1] */
+ float kMT; /* Pose matching coefficient [0,1] */
+ float kCHR; /* Rigid contacts hardness [0,1] */
+ float kKHR; /* Kinetic contacts hardness [0,1] */
+
+ float kSHR; /* Soft contacts hardness [0,1] */
+ float kAHR; /* Anchors hardness [0,1] */
+ int collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */
+ int numclusteriterations; /* number of iterations to refine collision clusters*/
+
} BulletSoftBody;
/* BulletSoftBody.flag */
#define OB_BSB_SHAPE_MATCHING 2
+#define OB_BSB_UNUSED 4
+#define OB_BSB_BENDING_CONSTRAINTS 8
+#define OB_BSB_AERO_VPOINT 16 /* aero model, Vertex normals are oriented toward velocity*/
+#define OB_BSB_AERO_VTWOSIDE 32 /* aero model, Vertex normals are flipped to match velocity */
+
+/* BulletSoftBody.collisionflags */
+#define OB_BSB_COL_SDF_RS 2 /* SDF based rigid vs soft */
+#define OB_BSB_COL_CL_RS 4 /* Cluster based rigid vs soft */
+#define OB_BSB_COL_CL_SS 8 /* Cluster based soft vs soft */
+#define OB_BSB_COL_VF_SS 16 /* Vertex/Face based soft vs soft */
+
typedef struct SoftBody {
struct ParticleSystem *particles; /* particlesystem softbody */
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
index cec04910de5..dcb0f874210 100644
--- a/source/blender/src/buttons_logic.c
+++ b/source/blender/src/buttons_logic.c
@@ -2970,6 +2970,9 @@ static void check_body_type(void *arg1_but, void *arg2_object)
ob->gameflag |= OB_BOUNDS;
if (ob->boundtype<OB_BOUND_POLYH)
ob->boundtype=OB_BOUND_POLYH;
+ /* create a BulletSoftBody structure if not already existing */
+ if (!ob->bsoft)
+ ob->bsoft = bsbNew();
break;
}
}
@@ -2984,55 +2987,88 @@ static uiBlock *advanced_bullet_menu(void *arg_ob)
/* use this for a fake extra empy space around the buttons */
uiDefBut(block, LABEL, 0, "", -5, -10, 255, 140, NULL, 0, 0, 0, 0, "");
- uiDefButBitI(block, TOG, OB_ACTOR, 0, "Sensor actor",
- xco, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0,
- "Objects that are detected by the Near and Radar sensor");
-
- if (ob->gameflag & OB_DYNAMIC) {
- uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, 0, "No sleeping",
- xco+=120, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0,
- "Disable auto (de)activation");
- }
+ if (ob->gameflag & OB_SOFT_BODY) {
- yco -= 25;
- xco = 0;
- if (ob->gameflag & OB_DYNAMIC) {
- if (ob->margin < 0.001f)
- ob->margin = 0.06f;
- uiDefButF(block, NUM, 0, "Margin",
- xco, yco, 118, 19, &ob->margin, 0.001, 1.0, 1, 0,
- "Collision margin");
- } else {
- uiDefButF(block, NUM, 0, "Margin",
- xco, yco, 118, 19, &ob->margin, 0.0, 1.0, 1, 0,
- "Collision margin");
- }
- if (ob->gameflag & OB_SOFT_BODY) {
- /* create a BulletSoftBody structure if not already existing */
- if (!ob->bsoft)
- ob->bsoft = bsbNew();
if (ob->bsoft)
{
+ xco = 0;
+ uiDefButF(block, NUMSLI, 0, "LinStiff ", xco, yco, 238, 19,
+ &ob->bsoft->linStiff, 0.0, 1.0, 1, 0,
+ "Linear stiffness of the soft body vertex spring");
+ yco -= 25;
+ xco = 0;
+
uiDefButBitI(block, TOG, OB_BSB_SHAPE_MATCHING, 0, "Shape matching",
- xco+=120, yco, 118, 19, &ob->bsoft->flag, 0, 0, 0, 0,
- "Enable soft body shape matching goal");
+ xco, yco, 118, 19, &ob->bsoft->flag, 0, 0, 0, 0,
+ "Enable soft body shape matching goal");
+
+ uiDefButBitI(block, TOG, OB_BSB_BENDING_CONSTRAINTS, 0, "Bending Constraints",
+ xco+=120, yco, 118, 19, &ob->bsoft->flag, 0, 0, 0, 0,
+ "Enable bending constraints");
+
yco -= 25;
xco = 0;
- uiDefButF(block, NUMSLI, 0, "LinStiff ", xco, yco, 238, 19,
- &ob->bsoft->linStiff, 0.0, 1.0, 1, 0,
- "Linear stiffness of the soft body vertex spring");
+ uiDefButBitI(block, TOG, OB_BSB_COL_CL_RS, 0, "Cluster Col. RS",
+ xco, yco, 118, 19, &ob->bsoft->collisionflags, 0, 0, 0, 0,
+ "Enable cluster collision between soft and rigid body");
+ uiDefButBitI(block, TOG, OB_BSB_COL_CL_SS, 0, "Cluster Col. SS",
+ xco+=120, yco, 118, 19, &ob->bsoft->collisionflags, 0, 0, 0, 0,
+ "Enable cluster collision between soft and soft body");
yco -= 25;
+
+ xco = 0;
+/*
+ uiDefButBitI(block, TOG, OB_BSB_AERO_VTWOSIDE, 0, "Aero model",
+ xco, yco, 118, 19, &ob->bsoft->flag, 0, 0, 0, 0,
+ "Enable aero model, vertex normals are flipped to match velocity");
+
+ yco -= 25;
+*/
+
+
+
+ /*
uiDefButF(block, NUMSLI, 0, "AngStiff ", xco, yco, 238, 19,
- &ob->bsoft->angStiff, 0.0, 1.0, 1, 0,
- "Angular stiffness of the soft body vertex spring");
+ &ob->bsoft->angStiff, 0.0, 1.0, 1, 0,
+ "Angular stiffness of the soft body vertex spring");
yco -= 25;
uiDefButF(block, NUMSLI, 0, "Volume ", xco, yco, 238, 19,
- &ob->bsoft->volume, 0.0, 1.0, 1, 0,
- "Factor of soft body volume preservation");
+ &ob->bsoft->volume, 0.0, 1.0, 1, 0,
+ "Factor of soft body volume preservation");
+ */
+
}
- }
+ } else
+ {
+
+ xco = 0;
+
+ uiDefButBitI(block, TOG, OB_ACTOR, 0, "Sensor actor",
+ xco, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0,
+ "Objects that are detected by the Near and Radar sensor");
+
+ if (ob->gameflag & OB_DYNAMIC) {
+ uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, 0, "No sleeping",
+ xco+=120, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0,
+ "Disable auto (de)activation");
+ }
+
+ yco -= 25;
+ xco = 0;
+ if (ob->gameflag & OB_DYNAMIC) {
+ if (ob->margin < 0.001f)
+ ob->margin = 0.06f;
+ uiDefButF(block, NUM, 0, "Margin",
+ xco, yco, 118, 19, &ob->margin, 0.001, 1.0, 1, 0,
+ "Collision margin");
+ } else {
+ uiDefButF(block, NUM, 0, "Margin",
+ xco, yco, 118, 19, &ob->margin, 0.0, 1.0, 1, 0,
+ "Collision margin");
+ }
+ }
uiBlockSetDirection(block, UI_TOP);
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 13e6281de2a..bc5541f1bcf 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -388,7 +388,11 @@ void space_set_commmandline_options(void) {
if ( (syshandle = SYS_GetSystem()) ) {
/* User defined settings */
a= (U.gameflags & USER_DISABLE_SOUND);
- SYS_WriteCommandLineInt(syshandle, "noaudio", a);
+ /* if user already disabled audio at the command-line, don't re-enable it */
+ if (a)
+ {
+ SYS_WriteCommandLineInt(syshandle, "noaudio", a);
+ }
a= (U.gameflags & USER_DISABLE_MIPMAP);
GPU_set_mipmap(!a);