From 018077581b70483ac2f3453ba813b5f4adb61fd5 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Wed, 3 May 2023 13:06:09 -0400
Subject: debugging

---
 .../views/nodes/PhysicsBox/PhysicsSimulationBox.tsx       | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

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

diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
index 9a16c5c73..315e64e79 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
@@ -106,11 +106,6 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
   wallPositions: IWallProps[] = [];
 
   componentDidMount() {
-    this.wallPositions.push({ length: 70, xPos: 0, yPos: 0, angleInDegrees: 0 });
-    this.wallPositions.push({ length: 70, xPos: 0, yPos: 70, angleInDegrees: 0 });
-    this.wallPositions.push({ length: 80, xPos: 0, yPos: 0, angleInDegrees: 90 });
-    this.wallPositions.push({ length: 80, xPos: 69.5, yPos: 0, angleInDegrees: 90 });
-
     // Used throughout sims
     this.layoutDoc._width = 1000;
     this.layoutDoc._height = 1000;
@@ -211,6 +206,14 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
 
     // Setup simulation
     this.setupSimulation(this.dataDoc.simulationType, this.dataDoc.mode)
+
+    // Create walls
+    let walls = []
+    walls.push({ length: this.xMax / this.layoutDoc._width * 100, xPos: 0, yPos: 0, angleInDegrees: 0 });
+    walls.push({ length: this.xMax / this.layoutDoc._width * 100, xPos: 0, yPos: this.yMax / this.layoutDoc._height * 100, angleInDegrees: 0 });
+    walls.push({ length: this.yMax / this.layoutDoc._height * 100, xPos: 0, yPos: 0, angleInDegrees: 90 });
+    walls.push({ length: this.yMax / this.layoutDoc._height * 100, xPos: this.xMax / this.layoutDoc._width * 100, yPos: 0, angleInDegrees: 90 });
+    this.wallPositions = walls
   }
 
   componentDidUpdate() {
@@ -1283,6 +1286,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <Weight
               dataDoc={this.dataDoc}
               layoutDoc={this.layoutDoc}
+              wallPositions={this.wallPositions}
               adjustPendulumAngle={this.dataDoc.adjustPendulumAngle}
               gravity={this.dataDoc.gravity}
               circularMotionRadius={this.dataDoc.circularMotionRadius}
@@ -1332,6 +1336,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
               <Weight
                 dataDoc={this.dataDoc}
                 layoutDoc={this.layoutDoc}
+                wallPositions={this.wallPositions}
                 adjustPendulumAngle={this.dataDoc.adjustPendulumAngle}
                 circularMotionRadius={this.dataDoc.circularMotionRadius}
                 gravity={this.dataDoc.gravity}
-- 
cgit v1.2.3-70-g09d2

