diff options
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationBox.tsx')
-rw-r--r-- | src/client/views/nodes/PhysicsSimulationBox.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx index 2db49de3c..d0e854263 100644 --- a/src/client/views/nodes/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsSimulationBox.tsx @@ -271,8 +271,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi this.dataDoc.showVelocity = this.dataDoc.showVelocity ?? false; this.dataDoc.startForces = this.dataDoc.startForces ?? [this.forceOfGravity]; this.dataDoc.startPendulumAngle = this.dataDoc.startPendulumAngle ?? 0; - this.dataDoc.startPosX = this.dataDoc.startPosX ?? 0; - this.dataDoc.startPosY = this.dataDoc.startPosY ?? 0; + this.dataDoc.startPosX = this.dataDoc.startPosX ?? 50; + this.dataDoc.startPosY = this.dataDoc.startPosY ?? 50; this.dataDoc.stepNumber = this.dataDoc.stepNumber ?? 0; this.dataDoc.updateDisplay = this.dataDoc.updateDisplay ?? false; this.dataDoc.updatedForces = this.dataDoc.updatedForces ?? [this.forceOfGravity]; @@ -345,8 +345,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi /> )} </div> - {/* <div> - {this.dataDoc.wallPositions.map((element: { length: number; xPos: number; yPos: number; angleInDegrees: number; }, index: React.Key | null | undefined) => { + <div> + {(this.dataDoc.wallPositions ?? []).map((element: { length: number; xPos: number; yPos: number; angleInDegrees: number; }, index: React.Key | null | undefined) => { return ( <div key={index}> <Wall @@ -358,7 +358,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi </div> ); })} - </div> */} + </div> </div> </div> <div style = {{width: this.layoutDoc._width+'px', height: this.layoutDoc._height+'px'}}> @@ -468,11 +468,13 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi this.addWedge() this.setToWedgeDefault() this.dataDoc.simulationType = "Inclined Plane" + this.dataDoc.elasticCollisions = false } else if (!this.dataDoc.pendulum && this.dataDoc.wedge) { this.setToPendulumDefault() this.addPendulum() this.dataDoc.simulationType = "Pendulum" + this.dataDoc.elasticCollisions = false } else { this.setToWeightDefault() |