diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2012-05-30 00:30:33 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2012-05-30 00:30:33 +0400 |
commit | 58bc424b3c46ee3ee6644ff578671670c2a1c8ec (patch) | |
tree | 147b691cecd0286e750fd73f0c6a2edad8ab9b90 /release/scripts/startup/bl_ui | |
parent | 1d4ab9daf0ef38066469fb86bed0fc24b2e1bbda (diff) |
BGE #30734: add support for physics linear and angular thresholds and deactivation time from python and GUI.
========================
The linear and angular thresholds set the speed limit (in m/s) and rotation limit (in rad/s)
under which a rigid body will go to sleep (stop moving) if it stays below the limits for a
time equal or longer than the deactivation time (sleeping is disabled is deactivation time is
set to 0).
These settings help reducing the processing spent on Physics during the game.
Previously they were only accessible from python but not working because of a bug.
Now the python functions are working and the settings are available in the Physics panel
of the World settings when using the Blender Game render engine.
Python API:
import PhysicsConstraints
PhysicsConstraints.setDeactivationLinearTreshold(float)
PhysicsConstraints.setDeactivationAngularTreshold(float)
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 857afbd9f09..549e2181a2b 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -622,6 +622,14 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel): col.prop(gs, "logic_step_max", text="Max") col = layout.column() + col.label(text="Physics Deactivation:") + sub = col.row(align=True) + sub.prop(gs, "deactivation_linear_threshold", text="Linear Threshold") + sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold") + sub = col.row() + sub.prop(gs, "deactivation_time", text="Time") + + col = layout.column() col.prop(gs, "use_occlusion_culling", text="Occlusion Culling") sub = col.column() sub.active = gs.use_occlusion_culling |