diff options
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationWeight.tsx')
| -rw-r--r-- | src/client/views/nodes/PhysicsSimulationWeight.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |
