mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-15 16:34:49 +00:00
cleanup, fix typo
This commit is contained in:
parent
76e9f68e63
commit
3009273db3
3 changed files with 10 additions and 16 deletions
|
|
@ -9,12 +9,6 @@ function useMission(name: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_LIGHT_ARGS = [
|
|
||||||
"rgba(209, 237, 255, 1)",
|
|
||||||
"rgba(186, 200, 181, 1)",
|
|
||||||
2,
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export function Mission({ name }: { name: string }) {
|
export function Mission({ name }: { name: string }) {
|
||||||
const { data: mission } = useMission(name);
|
const { data: mission } = useMission(name);
|
||||||
|
|
||||||
|
|
@ -24,7 +18,9 @@ export function Mission({ name }: { name: string }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<hemisphereLight args={DEFAULT_LIGHT_ARGS} />
|
<hemisphereLight
|
||||||
|
args={["rgba(209, 237, 255, 1)", "rgba(186, 200, 181, 1)", 2]}
|
||||||
|
/>
|
||||||
{mission.objects.map((object, i) => renderObject(object, i))}
|
{mission.objects.map((object, i) => renderObject(object, i))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
import {
|
import { KeyboardControls, PointerLockControls } from "@react-three/drei";
|
||||||
KeyboardControls,
|
|
||||||
KeyboardControlsEntry,
|
|
||||||
Point,
|
|
||||||
PointerLockControls,
|
|
||||||
} from "@react-three/drei";
|
|
||||||
|
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { useFrame, useThree } from "@react-three/fiber";
|
import { useFrame, useThree } from "@react-three/fiber";
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ import { Color } from "three";
|
||||||
|
|
||||||
const FALLBACK_URL = `${BASE_URL}/black.png`;
|
const FALLBACK_URL = `${BASE_URL}/black.png`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a .dml file, used to list the textures for different faces of a skybox.
|
||||||
|
*/
|
||||||
function useDetailMapList(name: string) {
|
function useDetailMapList(name: string) {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ["detailMapList", name],
|
queryKey: ["detailMapList", name],
|
||||||
|
|
@ -54,9 +57,9 @@ export function Sky({ object }: { object: ConsoleObject }) {
|
||||||
// Fog parameters.
|
// Fog parameters.
|
||||||
// TODO: There can be multiple fog volumes/layers. Render simple fog for now.
|
// TODO: There can be multiple fog volumes/layers. Render simple fog for now.
|
||||||
const fogDistance = useMemo(() => {
|
const fogDistance = useMemo(() => {
|
||||||
const distainceString = getProperty(object, "fogDistance")?.value;
|
const distanceString = getProperty(object, "fogDistance")?.value;
|
||||||
if (distainceString) {
|
if (distanceString) {
|
||||||
return parseFloat(distainceString);
|
return parseFloat(distanceString);
|
||||||
}
|
}
|
||||||
}, [object]);
|
}, [object]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue