diff options
| author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-07 12:21:00 -0500 |
|---|---|---|
| committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-07 12:21:00 -0500 |
| commit | 983ffa5e10abd89448e8b3f9be65894c7b775d84 (patch) | |
| tree | 418fb75cdf956133335b865214a1239834e11b9a /src/client/views/nodes/PhysicsSimulationWeight.tsx | |
| parent | 717ffd4dcde6e683ec7feee2720b4cf856ff636f (diff) | |
wall show
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 { |
