From 86b29ec4768e11c758cc1f74acdfec99bf63ef4f Mon Sep 17 00:00:00 2001 From: alex-kumpula Date: Sat, 11 Nov 2023 20:46:11 -0700 Subject: [PATCH] Save rotations and shorter frame length --- godot/TAS_system/TAS_System.cs | 2 +- godot/TAS_system/TASable.cs | 3 +++ godot/UI/TAS UI/AdvanceButton.cs | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/godot/TAS_system/TAS_System.cs b/godot/TAS_system/TAS_System.cs index 574fdb4..5d7dd50 100644 --- a/godot/TAS_system/TAS_System.cs +++ b/godot/TAS_system/TAS_System.cs @@ -141,7 +141,7 @@ public partial class TAS_System : Node public override void _Ready() { - this.FrameLength = 0.1; + this.FrameLength = 1/60; this.StartIncrementingFrames(); } diff --git a/godot/TAS_system/TASable.cs b/godot/TAS_system/TASable.cs index ab4d6ef..046332b 100644 --- a/godot/TAS_system/TASable.cs +++ b/godot/TAS_system/TASable.cs @@ -14,6 +14,7 @@ public partial class TASable : Node // Frame data public Dictionary framePositions = new Dictionary(); + public Dictionary frameRotations = new Dictionary(); public Dictionary frameLinearVelocities = new Dictionary(); public Dictionary frameAngularVelocities = new Dictionary(); @@ -21,6 +22,7 @@ public partial class TASable : Node public virtual void SaveState(int frame) { this.framePositions[frame] = this.AssignedRigidBody3D.Position; + this.frameRotations[frame] = this.AssignedRigidBody3D.Rotation; this.frameLinearVelocities[frame] = this.AssignedRigidBody3D.LinearVelocity; this.frameAngularVelocities[frame] = this.AssignedRigidBody3D.AngularVelocity; } @@ -28,6 +30,7 @@ public partial class TASable : Node public virtual void LoadState(int frame) { this.AssignedRigidBody3D.Position = this.framePositions[frame]; + this.AssignedRigidBody3D.Rotation = this.frameRotations[frame]; this.AssignedRigidBody3D.LinearVelocity = this.frameLinearVelocities[frame]; this.AssignedRigidBody3D.AngularVelocity = this.frameAngularVelocities[frame]; } diff --git a/godot/UI/TAS UI/AdvanceButton.cs b/godot/UI/TAS UI/AdvanceButton.cs index 54918d0..962bd11 100644 --- a/godot/UI/TAS UI/AdvanceButton.cs +++ b/godot/UI/TAS UI/AdvanceButton.cs @@ -24,4 +24,8 @@ public partial class AdvanceButton : Button this.Disabled = false; } } + + + + }