diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 23:37:43 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 23:37:43 +0400 |
commit | 15c105c157057d249192b02f438cc60af600f9e6 (patch) | |
tree | 9ed6c9a6dd6a43d0d7986e58e0f527d138699b65 /source/blender/src/buttons_logic.c | |
parent | 533539901b1a50962a5870ee30d7c0d1ba123585 (diff) |
BGE patch: Add damping and clamping option to motion actuator.
This patch introduces two options for the motion actuator:
damping: number of frames to reach the target velocity. It takes
into account the startup velocityin the target velocity direction
and add 1/damping fraction of target velocity until the full
velocity is reached. Works only with linear and angular velocity.
It will be extended to delta and force motion method in a future
release.
clamping: apply the force and torque as long as the target velocity
is not reached. If this option is set, the velocity specified
in linV or angV are not applied to the object but used as target
velocity. You should also specify a force in force or torque field:
the force will be applied as long as the velocity along the axis of
the vector set in linV or angV is not reached. Works best in low
friction environment.
Diffstat (limited to 'source/blender/src/buttons_logic.c')
-rw-r--r-- | source/blender/src/buttons_logic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index bfa451428c3..ec85952a2f8 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1613,7 +1613,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh { case ACT_OBJECT: { - ysize= 129; + ysize= 152; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); @@ -1651,6 +1651,10 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefButF(block, NUM, 0, "", xco+45+wval, yco-125, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-125, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiDefBut(block, LABEL, 0, "damp", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); + uiDefButI(block, NUM, 0, "", xco+45, yco-148, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); + uiDefButBitI(block, TOG, ACT_CLAMP_VEL, 0, "clamp",xco+45+wval, yco-148, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between SET and CLAMP Velocity"); + uiDefButBitI(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); uiDefButBitI(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); uiDefButBitI(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); |