mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-01-20 04:35:05 +00:00
move non-Next components out of app folder
This commit is contained in:
parent
fdd27b26d7
commit
beade00727
16
app/page.tsx
16
app/page.tsx
|
|
@ -1,14 +1,14 @@
|
|||
"use client";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Canvas } from "@react-three/fiber";
|
||||
import { Mission } from "./Mission";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { ObserverControls } from "./ObserverControls";
|
||||
import { InspectorControls } from "./InspectorControls";
|
||||
import { SettingsProvider } from "./SettingsProvider";
|
||||
import { EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import { useSearchParams, useRouter } from "next/navigation";
|
||||
import { ObserverCamera } from "./ObserverCamera";
|
||||
import { Canvas } from "@react-three/fiber";
|
||||
import { EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import { Mission } from "@/src/components/Mission";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { ObserverControls } from "@/src/components/ObserverControls";
|
||||
import { InspectorControls } from "@/src/components/InspectorControls";
|
||||
import { SettingsProvider } from "@/src/components/SettingsProvider";
|
||||
import { ObserverCamera } from "@/src/components/ObserverCamera";
|
||||
|
||||
// three.js has its own loaders for textures and models, but we need to load other
|
||||
// stuff too, e.g. missions, terrains, and more. This client is used for those.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getResourceList } from "@/src/manifest";
|
||||
import { getResourceList } from "../manifest";
|
||||
import { useSettings } from "./SettingsProvider";
|
||||
|
||||
const excludeMissions = new Set([
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
import { memo, Suspense, useMemo } from "react";
|
||||
import { Mesh } from "three";
|
||||
import { useGLTF, useTexture } from "@react-three/drei";
|
||||
import { BASE_URL, interiorTextureToUrl, interiorToUrl } from "@/src/loaders";
|
||||
import { BASE_URL, interiorTextureToUrl, interiorToUrl } from "../loaders";
|
||||
import {
|
||||
ConsoleObject,
|
||||
getPosition,
|
||||
getProperty,
|
||||
getRotation,
|
||||
getScale,
|
||||
} from "@/src/mission";
|
||||
import { memo, Suspense, useMemo } from "react";
|
||||
import { Mesh } from "three";
|
||||
import { setupColor } from "@/src/textureUtils";
|
||||
} from "../mission";
|
||||
import { setupColor } from "../textureUtils";
|
||||
|
||||
const FALLBACK_URL = `${BASE_URL}/black.png`;
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { loadMission } from "@/src/loaders";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { loadMission } from "../loaders";
|
||||
import { renderObject } from "./renderObject";
|
||||
|
||||
function useMission(name: string) {
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
import { KeyboardControls } from "@react-three/drei";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Vector3 } from "three";
|
||||
import { useFrame, useThree } from "@react-three/fiber";
|
||||
import { useKeyboardControls } from "@react-three/drei";
|
||||
import { KeyboardControls, useKeyboardControls } from "@react-three/drei";
|
||||
import { PointerLockControls } from "three-stdlib";
|
||||
import { useSettings } from "./SettingsProvider";
|
||||
import { Vector3 } from "three";
|
||||
|
||||
enum Controls {
|
||||
forward = "forward",
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
import React, { useContext, useEffect, useMemo, useState } from "react";
|
||||
import { PerspectiveCamera } from "three";
|
||||
|
||||
const SettingsContext = React.createContext(null);
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { ConsoleObject } from "@/src/mission";
|
||||
import { ConsoleObject } from "../mission";
|
||||
import { renderObject } from "./renderObject";
|
||||
|
||||
export function SimGroup({ object }: { object: ConsoleObject }) {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { ConsoleObject, getProperty } from "@/src/mission";
|
||||
import { useSettings } from "./SettingsProvider";
|
||||
import { Suspense, useMemo, useEffect, useRef } from "react";
|
||||
import { BASE_URL, getUrlForPath, loadDetailMapList } from "@/src/loaders";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useCubeTexture } from "@react-three/drei";
|
||||
import { Color, ShaderMaterial, BackSide } from "three";
|
||||
import { ConsoleObject, getProperty } from "../mission";
|
||||
import { useSettings } from "./SettingsProvider";
|
||||
import { BASE_URL, getUrlForPath, loadDetailMapList } from "../loaders";
|
||||
|
||||
const FALLBACK_URL = `${BASE_URL}/black.png`;
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { ConsoleObject, getProperty } from "@/src/mission";
|
||||
import { useMemo } from "react";
|
||||
import { Color } from "three";
|
||||
import { ConsoleObject, getProperty } from "../mission";
|
||||
|
||||
export function Sun({ object }: { object: ConsoleObject }) {
|
||||
const direction = useMemo(() => {
|
||||
|
|
@ -1,15 +1,5 @@
|
|||
import { uint16ToFloat32 } from "@/src/arrayUtils";
|
||||
import { loadTerrain, terrainTextureToUrl } from "@/src/loaders";
|
||||
import {
|
||||
ConsoleObject,
|
||||
getPosition,
|
||||
getProperty,
|
||||
getRotation,
|
||||
getScale,
|
||||
} from "@/src/mission";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Suspense, useCallback, useMemo } from "react";
|
||||
import { useTexture } from "@react-three/drei";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
DataTexture,
|
||||
RedFormat,
|
||||
|
|
@ -20,11 +10,21 @@ import {
|
|||
UnsignedByteType,
|
||||
PlaneGeometry,
|
||||
} from "three";
|
||||
import { useTexture } from "@react-three/drei";
|
||||
import { uint16ToFloat32 } from "../arrayUtils";
|
||||
import { loadTerrain, terrainTextureToUrl } from "../loaders";
|
||||
import {
|
||||
ConsoleObject,
|
||||
getPosition,
|
||||
getProperty,
|
||||
getRotation,
|
||||
getScale,
|
||||
} from "../mission";
|
||||
import {
|
||||
setupColor,
|
||||
setupMask,
|
||||
updateTerrainTextureShader,
|
||||
} from "@/src/textureUtils";
|
||||
} from "../textureUtils";
|
||||
|
||||
/**
|
||||
* Load a .ter file, used for terrain heightmap and texture info.
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
import { textureToUrl } from "@/src/loaders";
|
||||
import { Suspense, useMemo } from "react";
|
||||
import { useTexture } from "@react-three/drei";
|
||||
import { textureToUrl } from "../loaders";
|
||||
import {
|
||||
ConsoleObject,
|
||||
getPosition,
|
||||
getProperty,
|
||||
getRotation,
|
||||
getScale,
|
||||
} from "@/src/mission";
|
||||
import { setupColor } from "@/src/textureUtils";
|
||||
import { useTexture } from "@react-three/drei";
|
||||
import { Suspense, useMemo } from "react";
|
||||
} from "../mission";
|
||||
import { setupColor } from "../textureUtils";
|
||||
|
||||
export function WaterMaterial({ surfaceTexture }: { surfaceTexture: string }) {
|
||||
const url = textureToUrl(surfaceTexture);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { ConsoleObject } from "@/src/mission";
|
||||
import { ConsoleObject } from "../mission";
|
||||
import { TerrainBlock } from "./TerrainBlock";
|
||||
import { WaterBlock } from "./WaterBlock";
|
||||
import { SimGroup } from "./SimGroup";
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import parser from "@/generated/mission.cjs";
|
||||
import { Quaternion, Vector3 } from "three";
|
||||
import parser from "@/generated/mission.cjs";
|
||||
|
||||
const definitionComment = /^ (DisplayName|MissionTypes) = (.+)$/;
|
||||
const sectionBeginComment = /^--- ([A-Z ]+) BEGIN ---$/;
|
||||
|
|
|
|||
Loading…
Reference in a new issue