From 983ffa5e10abd89448e8b3f9be65894c7b775d84 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Tue, 7 Feb 2023 12:21:00 -0500
Subject: wall show

---
 src/client/views/nodes/PhysicsSimulationWeight.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/nodes/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsSimulationWeight.tsx
index 07ab84bd8..92d65cf3d 100644
--- a/src/client/views/nodes/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsSimulationWeight.tsx
@@ -93,8 +93,8 @@ export default class Weight extends React.Component<IWeightProps, IState> {
     directionInDegrees: 270,
   };
   xMax = 300;
-  xMin = 0;
   yMax = 300;
+  xMin = 0;
   yMin = 0;
 
   // Var
@@ -397,6 +397,7 @@ export default class Weight extends React.Component<IWeightProps, IState> {
                 this.setState({xPosition: wallX+5});
               }
               collision = true;
+              console.log('collision with wall')
             }
           } else {
             if (maxX >= wallX) {
@@ -407,6 +408,7 @@ export default class Weight extends React.Component<IWeightProps, IState> {
                 this.setState({xPosition: wallX - 2 * this.props.radius + 5});
               }
               collision = true;
+              console.log('collision with wall')
             }
           }
         }
@@ -421,8 +423,9 @@ export default class Weight extends React.Component<IWeightProps, IState> {
     if (this.state.yVelocity > 0) {
       this.props.walls.forEach((wall) => {
         if (wall.angleInDegrees == 0) {
-          const groundY = (wall.yPos / 100) * 300;
+          const groundY = (wall.yPos / 100) * this.yMax;
           if (maxY >= groundY) {
+            console.log('collision with ground ', wall, maxY)
             if (this.props.elasticCollisions) {
               this.setState({yVelocity: -this.state.yVelocity})
             } else {
-- 
cgit v1.2.3-70-g09d2

