diff options
| author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-22 14:38:26 -0500 |
|---|---|---|
| committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-22 14:38:26 -0500 |
| commit | 4c0336f3d7380595f9a5e074ec8c0e31f061a709 (patch) | |
| tree | aa3b1f486f5a48a2b83a6db4b58c1edcb7be706f | |
| parent | 9a5f2e9d098d0ad2db1be90818b6295390a60501 (diff) | |
wedge angle
| -rw-r--r-- | src/client/views/nodes/PhysicsSimulationBox.tsx | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx index 1a64ec795..2db49de3c 100644 --- a/src/client/views/nodes/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsSimulationBox.tsx @@ -194,8 +194,6 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi this.dataDoc.startPosX = xPos; this.dataDoc.startPosY = this.getDisplayYPos(yPos); - console.log('update start pos x') - console.log('update start pos y') this.updateForcesWithFriction( Number(this.dataDoc.coefficientOfStaticFriction), width, @@ -383,7 +381,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi <p>Show velocity</p></div> <div><input type="checkbox" checked={this.dataDoc.showVelocity} onClick={() => {this.dataDoc.showVelocity = !this.dataDoc.showVelocity}}/></div> </div> - <br/> + <hr/> {this.dataDoc.simulationType == "Free Weight" && <div className="mechanicsSimulationSettingsMenuRow"> <div className="mechanicsSimulationSettingsMenuRowDescription"><p>Elastic collisions </p></div> <div><input type="checkbox" checked={this.dataDoc.elasticCollisions} onClick={() => {this.dataDoc.elasticCollisions = !this.dataDoc.elasticCollisions}}/></div> @@ -421,12 +419,29 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi /> </div> </div>} - {/* {this.dataDoc.simulationType == "Inclined Plane" && - <div className="mechanicsSimulationSettingsMenuRow"> - <p>Inclined plane angle </p> - <p>input field!</p> + {this.dataDoc.simulationType == "Inclined Plane" && <div className="mechanicsSimulationSettingsMenuRow"> + <div className="mechanicsSimulationSettingsMenuRowDescription"><p>Inclined plane angle</p></div> + <div> + <input + type="number" + value={this.dataDoc.wedgeAngle} + max={70} + min={0} + step={1} + onInput={(e) => { + let angle = e.target.value ?? 0 + if (angle > 70) { + angle = 70 + } + if (angle < 0) { + angle = 0 + } + this.dataDoc.wedgeAngle = angle + this.changeWedgeBasedOnNewAngle(angle) + }} + /> </div> - } */} + </div>} </div> )} </div> |
