Skip to content

Commit 93ca795

Browse files
committed
PhysicsSpace: document a non-intuitive quirk of update()
1 parent d51b8e9 commit 93ca795

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/jme3/bullet/PhysicsSpace.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ public void update(float timeInterval, int maxSteps) {
742742
/**
743743
* Update the space, enabling the specified callbacks. This method should be
744744
* invoked on the thread that created the space.
745+
* <p>
746+
* Disabling specific callbacks is an optimization, primarily intended for
747+
* applications with a single physics space. The Bullet variables that
748+
* enable the callbacks are global (shared by all physics spaces), so if
749+
* multiple spaces are updated from different threads, be sure to pass the
750+
* same flags to all invocations of {@code update()}.
745751
*
746752
* @param timeInterval the time interval to simulate (in seconds, &ge;0)
747753
* @param maxSteps the maximum number of steps of size {@code accuracy}
@@ -778,6 +784,12 @@ public void update(float timeInterval, int maxSteps, boolean doEnded,
778784
* (&ge;1) or 0 for a single step of size {@code timeInterval}
779785
* @param stepFlags the desired callbacks, ORed together (default=0x0)
780786
* @see com.jme3.bullet.StepFlag
787+
* <p>
788+
* Disabling specific callbacks is an optimization, primarily intended for
789+
* applications with a single physics space. The Bullet variables that
790+
* enable the callbacks are global (shared by all physics spaces), so if
791+
* multiple spaces are updated from different threads, be sure to pass the
792+
* same flags to all invocations of {@code update()}.
781793
*/
782794
public void update(float timeInterval, int maxSteps, int stepFlags) {
783795
assert Validate.nonNegative(timeInterval, "time interval");

0 commit comments

Comments
 (0)