File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
src/main/java/com/simsilica/sim Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ buildscript {
1414apply plugin : ' java'
1515apply plugin : ' maven'
1616
17- version= ' 1.2.0'
17+ version= ' 1.2.0-SNAPSHOT '
1818group= ' com.simsilica'
1919
2020ext. jmeVersion = " 3.2.1-stable"
Original file line number Diff line number Diff line change 11
2- Version 1.2.0 (latest )
2+ Version 1.2.0 (unreleased )
33--------------
44* Fixed a SimTime initialization problem where the first tpf would be
55 huge.
@@ -30,6 +30,8 @@ Version 1.2.0 (latest)
3030 that game time begins counting from the first frame.
3131* Fixed an NPE in CompositeAppState.addChild() when called after the outer state is
3232 attached but before it was initialized. See PR #5 .
33+ * Added SimTime.getUnlockedTime() which will return a SimTime-translated time
34+ between frames, ie: not frame locked.
3335* Set sourceCompatibility to 1.7 and turned on detailed 'unchecked' warnings
3436* Suppressed 'unchecked' warnings in some methods of EntityContainer, EventBus,
3537 and DecaySystem where it is known that the operations are safe or safe-ish,
Original file line number Diff line number Diff line change @@ -64,6 +64,19 @@ public void update( long time ) {
6464 this .time = time ;
6565 }
6666
67+ /**
68+ * Returns the SimTime version of the specified timestamp that
69+ * is compatible with what would normally be provided to update().
70+ * SimTime.getTime() will provide 'frame locked' timestamps that will
71+ * not update during a frame which is what the systems will want 99.99%
72+ * of the time. Rarely it is desirable to get a "real" timestamp that
73+ * is not locked to frames, usually as part of providing matching accurate
74+ * timesource information to something else that is trying to synch.
75+ */
76+ public long getUnlockedTime ( long time ) {
77+ return time - baseTime ;
78+ }
79+
6780 public long toSimTime ( double seconds ) {
6881 return (long )(seconds * invTimeScale );
6982 }
You can’t perform that action at this time.
0 commit comments