diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-09-26 12:58:15 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-09-26 12:58:15 +0400 |
commit | c301a059bd59672daf022755181f114ce70a21e9 (patch) | |
tree | 3819a1a1a6f647a1def1279bcd293df8b34d2534 /source/blender/src/buttons_logic.c | |
parent | 5adff90b0868f88050e601092b35628fa3ae132b (diff) | |
parent | 06a5e9b58a0c1281609ee1ddb850fc058fe56c4f (diff) |
svn merge -r 16667:16741 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/src/buttons_logic.c')
-rw-r--r-- | source/blender/src/buttons_logic.c | 70 |
1 files changed, 55 insertions, 15 deletions
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 96949756083..a6f4acb8c68 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -49,6 +49,7 @@ #include "DNA_controller_types.h" #include "DNA_property_types.h" #include "DNA_object_types.h" +#include "DNA_object_force.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_scene_types.h" @@ -2926,9 +2927,9 @@ void buttons_ketsji(uiBlock *block, Object *ob) uiBlockBeginAlign(block); uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 105, 75, 19, &ob->gameflag, 0, 0,0, 0, - "Specify a bounds object for physics"); + "Specify a collision shape bounds type"); if (ob->gameflag & OB_BOUNDS) { - uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Static TriangleMesh %x4", + uiDefButS(block, MENU, REDRAWVIEW3D, "Collision Type%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Concave TriangleMesh %x4", 85, 105, 160, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type"); uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 250,105,100,19, &ob->gameflag, 0, 0, 0, 0, @@ -2979,11 +2980,11 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) { uiBlock *block; Object *ob = arg_ob; - short yco = 65, xco = 0; + short yco = 105, xco = 0; block= uiNewBlock(&curarea->uiblocks, "advanced_bullet_options", UI_EMBOSS, UI_HELV, curarea->win); /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", -5, -10, 255, 100, NULL, 0, 0, 0, 0, ""); + 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, @@ -3008,6 +3009,33 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) xco, yco, 118, 19, &ob->margin, 0.0, 1.0, 1, 0, "Collision margin"); } + if (ob->gameflag & OB_SOFT_BODY) { + if (ob->soft) + { + + uiDefButBitI(block, TOG, OB_SB_GOAL, 0, "Shape matching", + xco+=120, yco, 118, 19, &ob->softflag, 0, 0, 0, 0, + "Enable soft body shape matching goal"); + yco -= 25; + xco = 0; + uiDefButF(block, NUMSLI, 0, "LinStiff ", xco, yco, 238, 19, + &ob->soft->inspring, 0.0, 1.0, 1, 0, + "Linear stiffness of the soft body vertex spring"); + /* + yco -= 25; + uiDefButF(block, NUMSLI, 0, "AngStiff ", xco, yco, 238, 19, + &ob->angularStiffness, 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->volumePreservation, 0.0, 1.0, 1, 0, + "Factor of soft body volume preservation"); + */ + + } + + } + uiBlockSetDirection(block, UI_TOP); @@ -3030,10 +3058,21 @@ void buttons_bullet(uiBlock *block, Object *ob) else ob->body_type = OB_BODY_TYPE_SOFT; - but = uiDefButS(block, MENU, REDRAWVIEW3D, - "Object type%t|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", - 10, 205, 120, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation"); - uiButSetFunc(but, check_body_type, but, ob); + //only enable game soft body if Blender Soft Body exists + if (ob->soft) + { + but = uiDefButS(block, MENU, REDRAWVIEW3D, + "Object type%t|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", + 10, 205, 120, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation"); + uiButSetFunc(but, check_body_type, but, ob); + } else + { + but = uiDefButS(block, MENU, REDRAWVIEW3D, + "Object type%t|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3", + 10, 205, 120, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation"); + uiButSetFunc(but, check_body_type, but, ob); + } + if (ob->gameflag & OB_COLLISION) { @@ -3069,9 +3108,9 @@ void buttons_bullet(uiBlock *block, Object *ob) uiBlockBeginAlign(block); uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 105, 80, 19, &ob->gameflag, 0, 0, 0, 0, - "Specify a bounds object for physics"); + "Specify a collision bounds type"); if (ob->gameflag & OB_BOUNDS) { - uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Static Mesh%x4", + uiDefButS(block, MENU, REDRAWVIEW3D, "Collision Bounds%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Triangle Mesh%x4", //almost ready to enable this one: uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4|Dynamic Mesh %x5|", 90, 105, 150, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type"); uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, @@ -3347,24 +3386,25 @@ void logic_buts(void) /* first show the state */ uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 40, 19, "Object state menu: store and retrieve initial state"); + uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, 19, "Object state menu: store and retrieve initial state"); uiBlockSetEmboss(block, UI_EMBOSS); if (!ob->state) ob->state = 1; for (offset=0; offset<15; offset+=5) { uiBlockBeginAlign(block); for (stbit=0; stbit<5; stbit++) { - but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+35+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+31+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); uiButSetFunc(but, check_state_mask, but, &(ob->state)); } for (stbit=0; stbit<5; stbit++) { - but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+31+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); uiButSetFunc(but, check_state_mask, but, &(ob->state)); } } uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+235), yco-10, 25, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); - uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+260), yco-10, 25, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); + uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, 19, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); uiBlockEndAlign(block); yco-=35; |