Virtual Camera Update

This commit is contained in:
Josef 2024-06-16 18:02:34 +02:00
parent 0e4f09e19c
commit e88bfc81af
2 changed files with 37 additions and 2 deletions

View File

@ -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;

View File

@ -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;