Revision: 16776
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16776
Author:   erwin
Date:     2008-09-28 05:07:13 +0200 (Sun, 28 Sep 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/bullet.c
    trunk/blender/source/blender/makesdna/DNA_object_force.h
    trunk/blender/source/blender/src/buttons_logic.c
    trunk/blender/source/blender/src/space.c
    trunk/blender/source/creator/creator.c
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
    trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
    trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

Modified: trunk/blender/source/blender/blenkernel/intern/bullet.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bullet.c     2008-09-28 
02:17:05 UTC (rev 16775)
+++ trunk/blender/source/blender/blenkernel/intern/bullet.c     2008-09-28 
03:07:13 UTC (rev 16776)
@@ -45,10 +45,43 @@
        
        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;
 }
 

Modified: trunk/blender/source/blender/makesdna/DNA_object_force.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_force.h    2008-09-28 
02:17:05 UTC (rev 16775)
+++ trunk/blender/source/blender/makesdna/DNA_object_force.h    2008-09-28 
03:07:13 UTC (rev 16776)
@@ -85,15 +85,57 @@
 } 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 */
 

Modified: trunk/blender/source/blender/src/buttons_logic.c
===================================================================
--- trunk/blender/source/blender/src/buttons_logic.c    2008-09-28 02:17:05 UTC 
(rev 16775)
+++ trunk/blender/source/blender/src/buttons_logic.c    2008-09-28 03:07:13 UTC 
(rev 16776)
@@ -2970,6 +2970,9 @@
                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 @@
        /* 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_SOFT_BODY) {
 
-       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");
-       }
-       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);
 

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c    2008-09-28 02:17:05 UTC (rev 
16775)
+++ trunk/blender/source/blender/src/space.c    2008-09-28 03:07:13 UTC (rev 
16776)
@@ -388,7 +388,11 @@
        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);

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c      2008-09-28 02:17:05 UTC (rev 
16775)
+++ trunk/blender/source/creator/creator.c      2008-09-28 03:07:13 UTC (rev 
16776)
@@ -219,6 +219,7 @@
        printf ("\nMisc options:\n");
        printf ("  -d\t\tTurn debugging on\n");
        printf ("  -noaudio\tDisable audio on systems that support audio\n");
+       printf ("  -nojoystick\tDisable joystick support\n");
        printf ("  -h\t\tPrint this help text\n");
        printf ("  -y\t\tDisable automatic python script execution 
(scriptlinks, pydrivers, pyconstraints, pynodes)\n");
        printf ("  -P <filename>\tRun the given Python script (filename or 
Blender Text)\n");
@@ -493,6 +494,14 @@
                                                audio = 0;
                                                if (G.f & G_DEBUG) 
printf("setting audio to: %d\n", audio);
                                        }
+                                       if (BLI_strcasecmp(argv[a], 
"-nojoystick") == 0) {
+                                               /**

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to