aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2025-02-11 23:14:22 -0500
committerLibravatar Silas Bartha <silas@exvacuum.dev>2025-02-11 23:14:22 -0500
commitacf41b45c3345dd8fa12e013b313afdfb0138a6d (patch)
treee5dc92b8e70b36994300a80ed92b9586a5eec453
parentb9509422dd5f4c97d5c0746229037a53712ac7fe (diff)
properly import assets
-rw-r--r--src/components/chatbubble.jsx4
-rw-r--r--src/components/ground.jsx3
-rw-r--r--vite.config.js3
3 files changed, 8 insertions, 2 deletions
diff --git a/src/components/chatbubble.jsx b/src/components/chatbubble.jsx
index a9c0c85..8e1dfd1 100644
--- a/src/components/chatbubble.jsx
+++ b/src/components/chatbubble.jsx
@@ -6,6 +6,8 @@ import { Html } from '@react-three/drei';
import { AppContext } from '../App';
import Color from 'color';
import { Vector3 } from 'three';
+import messageBubbleModelURL from '../../assets/message-bubble.glb';
+import { meta } from '@eslint/js';
export default function ChatBubble({ id, position, text }) {
const meshRef = useRef();
@@ -74,7 +76,7 @@ export default function ChatBubble({ id, position, text }) {
}
}
}, -2);
- const { nodes } = useGLTF('../assets/message-bubble.glb');
+ const { nodes } = useGLTF(messageBubbleModelURL);
let color = Color(active ? everforest.blue : everforest.purple);
if (activatable) {
diff --git a/src/components/ground.jsx b/src/components/ground.jsx
index cc128de..c83aad8 100644
--- a/src/components/ground.jsx
+++ b/src/components/ground.jsx
@@ -1,11 +1,12 @@
import { useRef } from 'react';
+import terrainModelURL from '../../assets/terrain.glb'
import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier';
import { useGLTF } from '@react-three/drei';
export default function Ground() {
const meshRef = useRef();
- const { nodes } = useGLTF('../assets/terrain.glb');
+ const { nodes } = useGLTF(terrainModelURL);
return (
<RigidBody type='fixed' colliders="trimesh">
diff --git a/vite.config.js b/vite.config.js
index df070a7..61356f5 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -9,4 +9,7 @@ export default defineConfig({
'/api': 'http://localhost:5000',
},
},
+ assetsInclude: [
+ '**/*.glb',
+ ],
})