aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PhysicsSimulationWall.tsx
diff options
context:
space:
mode:
authorbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-01-30 14:14:46 -0500
committerbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-01-30 14:14:46 -0500
commitd5ebbf476aeb7ce3f88e2e4c3961ffed4ed8e61a (patch)
treeea322151d561c4d035c0508004a37f85357b35d0 /src/client/views/nodes/PhysicsSimulationWall.tsx
parentd2b8f997f1786c813ef5a58acef69501e1c523a3 (diff)
start adding physics sim
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationWall.tsx')
-rw-r--r--src/client/views/nodes/PhysicsSimulationWall.tsx35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationWall.tsx b/src/client/views/nodes/PhysicsSimulationWall.tsx
new file mode 100644
index 000000000..c63538cc0
--- /dev/null
+++ b/src/client/views/nodes/PhysicsSimulationWall.tsx
@@ -0,0 +1,35 @@
+import { useState, useEffect } from "react";
+import "./Weight.scss";
+
+export interface Force {
+ magnitude: number;
+ directionInDegrees: number;
+}
+export interface IWallProps {
+ length: number;
+ xPos: number;
+ yPos: number;
+ angleInDegrees: number;
+}
+
+export const Wall = (props: IWallProps) => {
+ const { length, xPos, yPos, angleInDegrees } = props;
+
+ let wallStyle = {
+ width: length + "%",
+ height: 0.5 + "vw",
+ position: "absolute" as "absolute",
+ left: xPos + "%",
+ top: yPos + "%",
+ backgroundColor: "#6c7b8b",
+ zIndex: -1000,
+ margin: 0,
+ padding: 0,
+ };
+ if (angleInDegrees != 0) {
+ wallStyle.width = 0.5 + "vw";
+ wallStyle.height = length + "%";
+ }
+
+ return <div style={wallStyle}></div>;
+};