From d46f6bd5e4d0c3ad7d483de85538f86965f635b7 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Thu, 4 May 2023 00:24:43 -0400
Subject: start debugging pulley

---
 .../views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx')

diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
index 7407d6fa6..785e40057 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
@@ -95,12 +95,12 @@ export default class Weight extends React.Component<IWeightProps, IState> {
       kineticFriction: false,
       maxPosYConservation: 0,
       timer: 0,
-      updatedStartPosX: this.props.dataDoc['startPosX'] ?? 0,
-      updatedStartPosY: this.props.dataDoc['startPosY'] ?? 0,
+      updatedStartPosX: this.props.startPosX ?? 0,
+      updatedStartPosY: this.props.startPosY ?? 0,
       walls: [],
-      xPosition: this.props.dataDoc['startPosX'] ?? 0,
+      xPosition: this.props.startPosX ?? 0,
       xVelocity: this.props.startVelX ? this.props.startVelX: 0,
-      yPosition: this.props.dataDoc['startPosY'] ?? 0,
+      yPosition: this.props.startPosY ?? 0,
       yVelocity: this.props.startVelY ? this.props.startVelY: 0,
       xAccel: 0,
       yAccel: 0,
@@ -175,10 +175,10 @@ export default class Weight extends React.Component<IWeightProps, IState> {
     this.setYVelDisplay(yVel);
     this.setXVelDisplay(xVel);
     this.props.dataDoc['accelerationYDisplay'] = 
-      (-1 * Math.round(this.getNewAccelerationY(this.props.dataDoc['updatedForces']) * 100)) / 100
+      (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100
     ;
     this.props.dataDoc['accelerationXDisplay'] = 
-      Math.round(this.getNewAccelerationX(this.props.dataDoc['updatedForces']) * 100) / 100
+      Math.round(this.getNewAccelerationX(this.props.dataDoc.updatedForces) * 100) / 100
     ;
   };
 
@@ -468,6 +468,7 @@ export default class Weight extends React.Component<IWeightProps, IState> {
     this.setState({yVelocity: this.props.startVelY ?? 0})
     this.props.dataDoc['pendulumAngle'] = this.props.dataDoc['startPendulumAngle']
     this.props.dataDoc['updatedForces'] = (this.props.dataDoc['startForces'])
+    this.props.dataDoc['updatedForces2'] = (this.props.dataDoc['startForces2'])
     this.props.dataDoc['accelerationXDisplay'] = 0
     this.props.dataDoc['accelerationYDisplay'] = 0
     this.props.dataDoc['positionXDisplay'] = this.state.updatedStartPosX
@@ -722,7 +723,7 @@ export default class Weight extends React.Component<IWeightProps, IState> {
     const newYVel = currentYVel + deltaYVel * dt;
     const newDeltaXPos = newXVel;
     const newDeltaYPos = newYVel;
-    let forces = this.props.dataDoc['updatedForces'];
+    let forces = this.props.updatedForces;
     if (this.props.dataDoc['simulationType'] == "Pendulum") {
       forces = this.getNewPendulumForces(newXPos, newYPos, newXVel, newYVel);
     } else if (this.props.dataDoc['simulationType'] == "Spring") {
-- 
cgit v1.2.3-70-g09d2

