Upgrade structure of code base
This commit is contained in:
@@ -6,11 +6,11 @@ namespace Enigmos.Modules.TerminalModules.TestingModules;
|
||||
|
||||
public partial class R2Reader : Control
|
||||
{
|
||||
private AnimatedSprite2D Direction { get; set; }
|
||||
private AnimatedSprite2D Magnitude { get; set; }
|
||||
public R2 UnderlyingVector { get; set; }
|
||||
private double TargetPhase() => Math.Atan2(UnderlyingVector[2], UnderlyingVector[1]);
|
||||
private double TargetLength() => UnderlyingVector.Magnitude;
|
||||
private AnimatedSprite2D? Direction { get; set; }
|
||||
private AnimatedSprite2D? Magnitude { get; set; }
|
||||
public R2? UnderlyingVector { get; set; }
|
||||
private double TargetPhase() => Math.Atan2(UnderlyingVector![2], UnderlyingVector![1]);
|
||||
private double TargetLength() => UnderlyingVector!.Magnitude;
|
||||
|
||||
private int TargetPhaseFrame =>
|
||||
Mathf.FloorToInt((TargetPhase() % (2d * Math.PI) + 2d * Math.PI) % (2d * Math.PI) * 44d / (2d * Math.PI));
|
||||
@@ -19,8 +19,8 @@ public partial class R2Reader : Control
|
||||
Mathf.FloorToInt(TargetLength().DoubleCut() * 9d);
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
Magnitude.SpeedScale = (TargetLengthFrame - Magnitude.Frame) / 7f;
|
||||
var debug = new[] { TargetPhaseFrame - Direction.Frame, TargetPhaseFrame + 44 - Direction.Frame };
|
||||
Magnitude!.SpeedScale = (TargetLengthFrame - Magnitude.Frame) / 7f;
|
||||
var debug = new[] { TargetPhaseFrame - Direction!.Frame, TargetPhaseFrame + 44 - Direction.Frame };
|
||||
Direction.SpeedScale = debug.MinBy(Math.Abs) / 25f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user