Skip to content

Commit

Permalink
fix:MUIコンポーネントの適用 #12
Browse files Browse the repository at this point in the history
  • Loading branch information
okaka8080 committed Jun 29, 2023
1 parent 0229779 commit 47b123d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
}
},
"npm.packageManager": "pnpm",
"typescript.tsdk": "node_modules/.pnpm/[email protected]/node_modules/typescript/lib",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
22 changes: 14 additions & 8 deletions src/pages/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { Canvas, MeshProps } from "@react-three/fiber";
import { OrbitControls } from "@react-three/drei";
import { Site } from "../../components/Map/Site/Site";
import { Plane } from "../../components/Map/Plane"
import styles from "../../styles/map.module.css";
import { Physics, useBox } from "@react-three/cannon";
import { useRef } from "react";
import { Mesh } from "three";
import { Box } from "@mui/material";

function Box(props: MeshProps) {
function FallBox(props: MeshProps) {
const [ref, api] = useBox(
() => ({
mass: 1,
Expand All @@ -26,20 +26,26 @@ function Box(props: MeshProps) {

const Map = () => {
return (
<div className={styles.map}>
<Canvas camera={{ position: [0, 2, -1] }} shadows style={{ height: "100%" }} className={styles.canvas}>
<Box component="div" sx={{
position: 'relative',
height: "100vh",
width: "100vw",
p: 0,
m: 0,
}}>
<Canvas camera={{ position: [0, 2, -1] }} shadows >
<Physics
broadphase="SAP"
gravity={[0, -2.6, 0]}
>
<directionalLight position={[0, 10, 0]} castShadow />
<Plane />
<Box />
<FallBox />
<Site />
<OrbitControls target={[0, 0, 0]} />
</Physics>
</Canvas>
</div>
</Physics >
</Canvas >
</Box >
);
};

Expand Down

0 comments on commit 47b123d

Please sign in to comment.