diff --git a/Runtime/Logging/RJLog.cs b/Runtime/Logging/RJLog.cs index b158235..75eb009 100644 --- a/Runtime/Logging/RJLog.cs +++ b/Runtime/Logging/RJLog.cs @@ -18,7 +18,15 @@ namespace Rokojori return; } - if ( obj is float || obj is double ) + if ( obj is float ) + { + var floatValue = (float) obj; + var doubleValue = (double) floatValue; + output.Append( RegexUtility.WriteDouble( doubleValue ) ); + return; + } + + if ( obj is double ) { output.Append( RegexUtility.WriteDouble( (double)obj ) ); return; diff --git a/Runtime/VirtualCameras/VirtualCamera3DManager.cs b/Runtime/VirtualCameras/VirtualCamera3DManager.cs index 32b693c..8cc543b 100644 --- a/Runtime/VirtualCameras/VirtualCamera3DManager.cs +++ b/Runtime/VirtualCameras/VirtualCamera3DManager.cs @@ -18,8 +18,16 @@ namespace Rokojori [Export] public bool refreshSlots = false; + [Export] + public bool active = false; + public override void _Process( double delta ) { + if ( ! active ) + { + return; + } + LerpCameras( delta ); } @@ -66,7 +74,26 @@ namespace Rokojori c => { var priority = MathF.Max( 0, c.smoothedPriority ); - var rotation = c.camera.GetCameraRotation(); + var rotation = c.camera.GetCameraRotation(); + + if ( ! rotation.IsFinite() || rotation.Length() == 0 ) + { + rotation = new Quaternion(); + rotation.X = 0; + rotation.Y = 0; + rotation.Z = 0; + rotation.W = 1; + rotation = rotation.Normalized(); + //RJLog.Log( "Rotation was weird" ); + } + else + { + //RJLog.Log( "Rotation is fine" ); + } + + + + //RJLog.Log( rotation.X, rotation.Y, rotation.Z, rotation.W ); var vUp = rotation * Vector3.Up; var vForward = rotation * Vector3.Forward;