File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public static void TweakFramerate()
3838 {
3939 float scaler = ( float ) ( ForeSight ) ;
4040 scaler -= 0 ;
41- scaler /= 16 ;
41+ scaler /= 32 ;
4242 Time . timeScale = 1 + scaler ;
4343 } else
4444 {
Original file line number Diff line number Diff line change @@ -600,9 +600,11 @@ public void SetVisuals()
600600private void DoSetVisualPosition ( Vector3 pos )
601601{
602602if ( this . CanSetVisualPosition ) {
603+
603604lastVisualPos = PositionalTransform . position ;
604605_visualPosition = pos ;
605606SetPositionBuffer = true ;
607+
606608}
607609}
608610
@@ -621,18 +623,20 @@ private void DoSetVisualRotation(Vector2d rot)
621623
622624public void Visualize ( )
623625{
626+ float lerpTime = PhysicsManager . LerpTime ;
624627if ( CanSetVisualPosition ) {
625628if ( SetPositionBuffer ) {
626- PositionalTransform . position = Vector3 . LerpUnclamped ( lastVisualPos , _visualPosition , PhysicsManager . LerpTime ) ;
627-
629+
630+ PositionalTransform . position = Vector3 . Lerp ( lastVisualPos , _visualPosition , lerpTime ) ;
631+ SetPositionBuffer = lerpTime < 1f ;
628632}
629633}
630634//const float rotationLerpDamping = 1f;
631635if ( CanSetVisualRotation && RotationalTransform != null ) {
632636if ( SetRotationBuffer ) {
633637RotationalTransform . rotation =
634- Quaternion . LerpUnclamped ( lastVisualRot , visualRot , PhysicsManager . LerpTime ) ;
635- SetRotationBuffer = PhysicsManager . LerpTime < 1f ;
638+ Quaternion . Lerp ( lastVisualRot , visualRot , PhysicsManager . LerpTime ) ;
639+ SetRotationBuffer = lerpTime < 1f ;
636640
637641}
638642}
Original file line number Diff line number Diff line change @@ -223,10 +223,13 @@ public static void Deactivate()
223223public static bool Simulated { get ; private set ; }
224224public static double AccumulatedTime { get ; private set ; }
225225public static float LerpTime { get ; private set ; }
226+ public static bool LastLerpOver { get ; private set ; }
226227public static void LateVisualize ( )
227228{
228229if ( Simulated )
230+ {
229231AccumulatedTime = Time . deltaTime ;
232+ }
230233else
231234AccumulatedTime += Time . deltaTime ;
232235LerpTime = ( float ) ( AccumulatedTime / PhysicsManager . FixedDeltaTime ) ;
@@ -240,6 +243,8 @@ public static void LateVisualize()
240243}
241244}
242245
246+ if ( Simulated )
247+ Simulated = false ;
243248}
244249
245250public static float ElapsedTime ;
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ void HandleOnTestData (byte[] obj)
4747
4848protected override void OnSimulate ( )
4949{
50- if ( ! _enabled )
50+ if ( _enabled )
5151return ;
5252ticker ++ ;
5353if ( ticker >= _checkFrameInterval ) {
You can’t perform that action at this time.
0 commit comments