diff options
author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-05-03 13:06:09 -0400 |
---|---|---|
committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-05-03 13:06:09 -0400 |
commit | 018077581b70483ac2f3453ba813b5f4adb61fd5 (patch) | |
tree | 43ef473356c7e4cc47296e1b59470f8d678f2ce7 /src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx | |
parent | 30068f771a1a6e69c43097948439855dea896e83 (diff) |
debugging
Diffstat (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx')
-rw-r--r-- | src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx | 15 |
1 files changed, 10 insertions, 5 deletions
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} |