Save rotations and shorter frame length
This commit is contained in:
		
							parent
							
								
									35f9476c3d
								
							
						
					
					
						commit
						86b29ec476
					
				
					 3 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
					@ -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();
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,4 +24,8 @@ public partial class AdvanceButton : Button
 | 
				
			||||||
			this.Disabled = false;
 | 
								this.Disabled = false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue