blender/doc/python_api/rst
Arnaud Degroote aae93ae4c6 BGE: Improve clock management
This patch improves clock management in BGE, to be able to accelerate /
slow the time, and also to finely synchronize clock with external
engines. Several new python functions have been added and existence ones
have been improved for that purpose. Now we have:

- getClockTime(): Get the current BGE render time, in seconds. The BGE
render time is the simulation time corresponding to the next scene that
will be rendered.

- getFrameTime(): Get the current BGE frame time, in seconds. The BGE
frame time is the simulation time corresponding to the current call of
the logic system. Generally speaking, it is what the user is interested
in.

- getRealTime(): Get the number of real (system-clock) seconds elapsed
since the beginning of the simulation.

- getTimeScale(): Get the time multiplier between real-time and
simulation time. The default value is 1.0. A value greater than 1.0
means that the simulation is going faster than real-time, a value lower
than 1.0 means that the simulation is going slower than real-time.

- setTimeScale(time_scale): Set the time multiplier between real-time
and simulation time. A value greater than 1.0 means that the simulation
is going faster than real-time, a value lower than 1.0 means that the
simulation is going slower than real-time. Note that a too large value
may lead to some physics instabilities.

- getUseExternalClock(): Get if the BGE use the inner BGE clock, or rely
or on an external clock. The default is to use the inner BGE clock.

- setUseExternalClock(use_external_clock): Set if the BGE use the inner
BGE clock, or rely or on an external clock. If the user selects the use
of an external clock, he should call regularly the setClockTime method.

- setClockTime(new_time): Set the next value of the simulation clock. It
is preferable to use this method from a custom main function in python,
as calling it in the logic block can easily lead to a blocked system (if
the time does not advance enough to run at least the next logic step).

Rationale are described more precisely in the thread
http://lists.blender.org/pipermail/bf-gamedev/2013-November/000165.html.

See also T37640

Reviewers: sybren, panzergame, #game_engine, lordloki, moguri

Reviewed By: sybren, panzergame, #game_engine, lordloki, moguri

Subscribers: moguri, hg1, sybren, panzergame, dfelinto, lordloki

Projects: #game_engine

Maniphest Tasks: T37640

Differential Revision: https://developer.blender.org/D728
2015-12-12 02:46:53 +01:00
..
bge_types BGE: Remove KX_IPOActuator. 2015-11-03 10:31:08 +01:00
bge.app.rst BGE: Fix T43918: adding submodule bge.app including attribute version. 2015-06-15 21:46:56 +02:00
bge.constraints.rst Remove redundant lists, link instead 2015-07-07 21:25:51 +10:00
bge.events.rst BGE doc cleanup: Some small cleanups in the BGE docs: 2014-03-31 22:22:04 -07:00
bge.logic.rst BGE: Improve clock management 2015-12-12 02:46:53 +01:00
bge.render.rst BGE docs fix: link to the correct method name 2015-09-27 17:20:10 +02:00
bge.texture.rst Remove redundant lists, link instead 2015-07-07 21:25:51 +10:00
bge.types.rst BGE: Splitting up the bge.types docs so they are not all on the same page. This should make them much easier to browse. 2013-02-10 06:13:26 +00:00
bgl.rst Doc: PyAPI docs, quiet warnings, fix URL's 2015-09-07 18:23:16 +10:00
change_log.rst update autogenerated changelog. also correct typos in the generator. 2013-05-09 01:58:49 +00:00
gpu.rst 3D View: support non-uniform scaled lamps 2015-10-15 22:36:31 +11:00
include__bmesh.rst BMesh Py API: add bmesh.geometry.intersect_face_point() 2013-12-06 21:15:56 +11:00
info_api_reference.rst update hand written rst docs 2015-06-18 08:00:46 +10:00
info_best_practice.rst update hand written rst docs 2015-06-18 08:00:46 +10:00
info_gotcha.rst Doc fix: rather then -> rather than 2015-08-05 12:48:04 +02:00
info_overview.rst update hand written rst docs 2015-06-18 08:00:46 +10:00
info_quickstart.rst Doc fix: rather then -> rather than 2015-08-05 12:48:04 +02:00
info_tips_and_tricks.rst API Docs: use importlib in examples 2015-11-05 19:08:17 +11:00
info_tutorial_addon.rst update hand written rst docs 2015-06-18 08:00:46 +10:00