From 0fd4eb6a8bf80861345633aabe6d482c24cb4d70 Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:07:39 -0500 Subject: settings menu --- src/client/views/nodes/PhysicsSimulationBox.tsx | 45 ++++++++-------------- src/client/views/nodes/PhysicsSimulationWeight.tsx | 4 +- 2 files changed, 17 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx index b7f4ed0fb..f0e009deb 100644 --- a/src/client/views/nodes/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsSimulationBox.tsx @@ -361,14 +361,14 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent {this.menuIsOpen && (
-
{this.menuIsOpen = false}}> - +
{this.menuIsOpen = false; this.dataDoc.simulationReset = !this.dataDoc.simulationReset;}} style={{zIndex: 20000}}> +
-

Simulation Settings

+

Simulation Settings

{this.dataDoc.simulationType == "Free Weight" &&
-

Elastic collisions

- {this.dataDoc.elasticCollisions = val}} originalStatus={this.dataDoc.elasticCollisions} /> +

Elastic collisions

+ {this.dataDoc.elasticCollisions = !this.dataDoc.elasticCollisions}}/>
} {/* {this.dataDoc.simulationType == "Inclined Plane" && @@ -376,40 +376,25 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponentInclined plane angle

input field!

- } - {this.dataDoc.simulationType == "Pendulum" && + } */} + {/* {this.dataDoc.simulationType == "Pendulum" &&

Pendulum angle

input field!

- } + } */}
-

Show forces

- - this.dataDoc.showForces = !this.dataDoc.showForces - } - /> +

Show forces

+ {this.dataDoc.showForces = !this.dataDoc.showForces}}/>
-

Show acceleration

- - this.dataDoc.showAcceleration = !this.dataDoc.showAcceleration - } - /> +

Show acceleration

+ {this.dataDoc.showAcceleration = !this.dataDoc.showAcceleration}}/>
-

Show velocity

- - this.dataDoc.showVelocity = !this.dataDoc.showVelocity - } - /> -
*/} +

Show velocity

+ {this.dataDoc.showVelocity = !this.dataDoc.showVelocity}}/> +
)} diff --git a/src/client/views/nodes/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsSimulationWeight.tsx index b9fa14df0..66af645b5 100644 --- a/src/client/views/nodes/PhysicsSimulationWeight.tsx +++ b/src/client/views/nodes/PhysicsSimulationWeight.tsx @@ -769,12 +769,12 @@ export default class Weight extends React.Component { let arrowEndY: number = arrowStartY - Math.abs(force.magnitude) * - 20 * + 10 * Math.sin((force.directionInDegrees * Math.PI) / 180); const arrowEndX: number = arrowStartX + Math.abs(force.magnitude) * - 20 * + 10 * Math.cos((force.directionInDegrees * Math.PI) / 180); let color = "#0d0d0d"; -- cgit v1.2.3-70-g09d2