properly import assets

This commit is contained in:
Silas Bartha 2025-02-11 23:14:22 -05:00
parent b9509422dd
commit acf41b45c3
3 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,8 @@ import { Html } from '@react-three/drei';
import { AppContext } from '../App'; import { AppContext } from '../App';
import Color from 'color'; import Color from 'color';
import { Vector3 } from 'three'; import { Vector3 } from 'three';
import messageBubbleModelURL from '../../assets/message-bubble.glb';
import { meta } from '@eslint/js';
export default function ChatBubble({ id, position, text }) { export default function ChatBubble({ id, position, text }) {
const meshRef = useRef(); const meshRef = useRef();
@ -74,7 +76,7 @@ export default function ChatBubble({ id, position, text }) {
} }
} }
}, -2); }, -2);
const { nodes } = useGLTF('../assets/message-bubble.glb'); const { nodes } = useGLTF(messageBubbleModelURL);
let color = Color(active ? everforest.blue : everforest.purple); let color = Color(active ? everforest.blue : everforest.purple);
if (activatable) { if (activatable) {

View File

@ -1,11 +1,12 @@
import { useRef } from 'react'; import { useRef } from 'react';
import terrainModelURL from '../../assets/terrain.glb'
import * as everforest from '../_everforest.module.scss' import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier'; import { RigidBody } from '@react-three/rapier';
import { useGLTF } from '@react-three/drei'; import { useGLTF } from '@react-three/drei';
export default function Ground() { export default function Ground() {
const meshRef = useRef(); const meshRef = useRef();
const { nodes } = useGLTF('../assets/terrain.glb'); const { nodes } = useGLTF(terrainModelURL);
return ( return (
<RigidBody type='fixed' colliders="trimesh"> <RigidBody type='fixed' colliders="trimesh">

View File

@ -9,4 +9,7 @@ export default defineConfig({
'/api': 'http://localhost:5000', '/api': 'http://localhost:5000',
}, },
}, },
assetsInclude: [
'**/*.glb',
],
}) })