Skip to content

Commit 324f17f

Browse files
✨ Generic Item Component
1 parent 1318e68 commit 324f17f

File tree

7 files changed

+24
-0
lines changed

7 files changed

+24
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
Animated Woman by Quaternius (https://poly.pizza/m/qJ2gsTUBHL)
2+
3+
Shelf Tall by Quaternius (https://poly.pizza/m/TDgvIuorcX)
4+
5+
Table by Quaternius (https://poly.pizza/m/gQFkiM8PlM)
6+
7+
Chair by Quaternius (https://poly.pizza/m/iMNqRzPwwe)
8+
9+
Couch Small by Quaternius (https://poly.pizza/m/ZOPP3KzNIk)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

r3f-socketio-sims-multiplayer/client/src/compontents/Experience.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useAtom } from 'jotai';
99
import { charactersAtom, socket } from './SocketManager';
1010
import { AnimatedWoman } from './AnimatedWoman';
1111
import { useState } from 'react';
12+
import Item from './Item';
1213

1314
const Experience = () => {
1415
const [characters] = useAtom(charactersAtom);
@@ -38,6 +39,13 @@ const Experience = () => {
3839
<meshStandardMaterial color="#f0f0f0" />
3940
</mesh>
4041

42+
{/* ITEMS */}
43+
<Item name={'Chair'} />
44+
<Item name={'Couch Small'} />
45+
<Item name={'Shelf Tall'} />
46+
<Item name={'Table'} />
47+
48+
{/* CHARACTERS */}
4149
{characters.map((character) => {
4250
return (
4351
<AnimatedWoman
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { useGLTF } from '@react-three/drei';
2+
3+
const Item = ({ name }) => {
4+
const { scene } = useGLTF(`models/items/${name}.glb`);
5+
return <primitive object={scene} />;
6+
};
7+
8+
export default Item;

0 commit comments

Comments
 (0)