Merge branch 'master' of https://git.sjkillen.ca/sjkillen/hurrmmm into sjkillen

This commit is contained in:
Spencer Killen 2023-11-11 20:46:29 -07:00
commit 3fa504f25a
Signed by: sjkillen
GPG Key ID: 3AF3117BA6FBB75B
3 changed files with 8 additions and 1 deletions

View File

@ -141,7 +141,7 @@ public partial class TAS_System : Node
public override void _Ready() public override void _Ready()
{ {
this.FrameLength = 0.1; this.FrameLength = 1/60;
this.StartIncrementingFrames(); this.StartIncrementingFrames();
} }

View File

@ -14,6 +14,7 @@ public partial class TASable : Node
// Frame data // Frame data
public Dictionary<int, Vector3> framePositions = new Dictionary<int, Vector3>(); public Dictionary<int, Vector3> framePositions = new Dictionary<int, Vector3>();
public Dictionary<int, Vector3> frameRotations = new Dictionary<int, Vector3>();
public Dictionary<int, Vector3> frameLinearVelocities = new Dictionary<int, Vector3>(); public Dictionary<int, Vector3> frameLinearVelocities = new Dictionary<int, Vector3>();
public Dictionary<int, Vector3> frameAngularVelocities = new Dictionary<int, Vector3>(); public Dictionary<int, Vector3> frameAngularVelocities = new Dictionary<int, Vector3>();
@ -21,6 +22,7 @@ public partial class TASable : Node
public virtual void SaveState(int frame) public virtual void SaveState(int frame)
{ {
this.framePositions[frame] = this.AssignedRigidBody3D.Position; this.framePositions[frame] = this.AssignedRigidBody3D.Position;
this.frameRotations[frame] = this.AssignedRigidBody3D.Rotation;
this.frameLinearVelocities[frame] = this.AssignedRigidBody3D.LinearVelocity; this.frameLinearVelocities[frame] = this.AssignedRigidBody3D.LinearVelocity;
this.frameAngularVelocities[frame] = this.AssignedRigidBody3D.AngularVelocity; this.frameAngularVelocities[frame] = this.AssignedRigidBody3D.AngularVelocity;
} }
@ -28,6 +30,7 @@ public partial class TASable : Node
public virtual void LoadState(int frame) public virtual void LoadState(int frame)
{ {
this.AssignedRigidBody3D.Position = this.framePositions[frame]; this.AssignedRigidBody3D.Position = this.framePositions[frame];
this.AssignedRigidBody3D.Rotation = this.frameRotations[frame];
this.AssignedRigidBody3D.LinearVelocity = this.frameLinearVelocities[frame]; this.AssignedRigidBody3D.LinearVelocity = this.frameLinearVelocities[frame];
this.AssignedRigidBody3D.AngularVelocity = this.frameAngularVelocities[frame]; this.AssignedRigidBody3D.AngularVelocity = this.frameAngularVelocities[frame];
} }

View File

@ -24,4 +24,8 @@ public partial class AdvanceButton : Button
this.Disabled = false; this.Disabled = false;
} }
} }
} }