-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from Thorium-Sim/fd-starmap
Flight Director Interstellar Starmap
- Loading branch information
Showing
31 changed files
with
597 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {ReactNode} from "react"; | ||
import { | ||
UNSAFE_LocationContext, | ||
UNSAFE_NavigationContext, | ||
UNSAFE_RouteContext, | ||
} from "react-router-dom"; | ||
import {Canvas} from "@react-three/fiber"; | ||
|
||
import {useContextBridge} from "@react-three/drei"; | ||
|
||
import {useQueryClient, QueryClientProvider} from "react-query"; | ||
import {ThoriumContext} from "client/src/context/ThoriumContext"; | ||
|
||
const FAR = 1e27; | ||
|
||
export default function StarmapCanvas({children}: {children: ReactNode}) { | ||
const client = useQueryClient(); | ||
|
||
const ContextBridge = useContextBridge(ThoriumContext); | ||
const Location = useContextBridge(UNSAFE_LocationContext); | ||
const Navigation = useContextBridge(UNSAFE_NavigationContext); | ||
const RouteContext = useContextBridge(UNSAFE_RouteContext); | ||
|
||
return ( | ||
<Canvas | ||
onContextMenu={e => { | ||
e.preventDefault(); | ||
}} | ||
gl={{antialias: true, logarithmicDepthBuffer: true}} | ||
camera={{fov: 45, far: FAR}} | ||
mode="concurrent" | ||
> | ||
<Navigation> | ||
<Location> | ||
<RouteContext> | ||
<ContextBridge> | ||
<QueryClientProvider client={client}> | ||
{children} | ||
</QueryClientProvider> | ||
</ContextBridge> | ||
</RouteContext> | ||
</Location> | ||
</Navigation> | ||
</Canvas> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.