gaesup-world 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +267 -263
- package/dist/GrassDriver-5qlyynpq.cjs +725 -0
- package/dist/GrassDriver-D3C3nNuR.js +9872 -0
- package/dist/PhysicsEntity-CP_HUQG-.cjs +1 -0
- package/dist/PhysicsEntity-CfUR6qfV.js +3844 -0
- package/dist/api-B58jaq5T.cjs +1 -0
- package/dist/api-BRV101Zn.js +40 -0
- package/dist/assetStore-2bI2BPCn.js +232 -0
- package/dist/assetStore-BuE4mh1C.cjs +1 -0
- package/dist/assets.cjs +1 -0
- package/dist/assets.d.ts +1 -0
- package/dist/assets.js +14 -0
- package/dist/blueprints-editor.cjs +1 -1
- package/dist/blueprints-editor.js +14 -12
- package/dist/blueprints.cjs +1 -1
- package/dist/blueprints.js +2 -2
- package/dist/core/animation/hooks/useAnimationBridge.d.ts +1 -1
- package/dist/core/assets/api.d.ts +12 -0
- package/dist/core/assets/building.d.ts +5 -0
- package/dist/core/assets/components/AssetPreviewCanvas/index.d.ts +7 -0
- package/dist/core/assets/data/seedAssets.d.ts +2 -0
- package/dist/core/assets/index.d.ts +7 -0
- package/dist/core/assets/stores/assetStore.d.ts +20 -0
- package/dist/core/assets/types.d.ts +30 -0
- package/dist/core/building/catalog/index.d.ts +1 -0
- package/dist/core/building/catalog/objects.d.ts +12 -0
- package/dist/core/building/components/BlockSystem/index.d.ts +1 -1
- package/dist/core/building/components/BlockSystem/types.d.ts +1 -0
- package/dist/core/building/components/BuildingUI/index.d.ts +1 -0
- package/dist/core/building/components/TileSystem/index.d.ts +1 -1
- package/dist/core/building/components/TileSystem/types.d.ts +1 -0
- package/dist/core/building/components/WallSystem/index.d.ts +3 -1
- package/dist/core/building/components/WallSystem/types.d.ts +2 -0
- package/dist/core/building/components/mesh/fire/index.d.ts +1 -0
- package/dist/core/building/components/mesh/grass/assets.d.ts +11 -0
- package/dist/core/building/components/mesh/model/index.d.ts +11 -0
- package/dist/core/building/components/mesh/sand.d.ts +5 -1
- package/dist/core/building/components/mesh/snowfield.d.ts +5 -1
- package/dist/core/building/core/MaterialManager.d.ts +1 -0
- package/dist/core/building/hooks/useBuildingEditor.d.ts +4 -1
- package/dist/core/building/index.d.ts +1 -0
- package/dist/core/building/plugin.d.ts +2 -0
- package/dist/core/building/render/core.d.ts +1 -0
- package/dist/core/building/render/culling.d.ts +2 -1
- package/dist/core/building/render/draw.d.ts +1 -1
- package/dist/core/building/stores/buildingStore.d.ts +23 -1
- package/dist/core/building/stores/persistence.d.ts +19 -0
- package/dist/core/building/types/index.d.ts +23 -1
- package/dist/core/camera/bridge/BaseCameraSystem.d.ts +1 -0
- package/dist/core/camera/bridge/types.d.ts +9 -0
- package/dist/core/camera/controllers/BaseController.d.ts +1 -0
- package/dist/core/camera/controllers/FirstPersonController.d.ts +1 -0
- package/dist/core/camera/controllers/TopDownController.d.ts +5 -0
- package/dist/core/camera/core/CameraSystem.d.ts +2 -2
- package/dist/core/camera/core/constants.d.ts +4 -0
- package/dist/core/camera/core/types.d.ts +9 -0
- package/dist/core/camera/index.d.ts +1 -0
- package/dist/core/camera/plugin.d.ts +48 -0
- package/dist/core/camera/utils/camera.d.ts +4 -3
- package/dist/core/character/index.d.ts +2 -0
- package/dist/core/character/resolveParts.d.ts +11 -0
- package/dist/core/character/stores/characterStore.d.ts +3 -2
- package/dist/core/character/types.d.ts +8 -2
- package/dist/core/content/exporter.d.ts +17 -0
- package/dist/core/content/index.d.ts +4 -0
- package/dist/core/content/loader.d.ts +9 -0
- package/dist/core/content/types.d.ts +57 -0
- package/dist/core/editor/components/Editor/types.d.ts +2 -0
- package/dist/core/editor/components/EditorLayout/types.d.ts +12 -0
- package/dist/core/editor/components/panels/BuildingPanel/index.d.ts +3 -0
- package/dist/core/editor/components/panels/CharacterAssetPanel/index.d.ts +3 -0
- package/dist/core/editor/components/panels/GameplayEventPanel/index.d.ts +12 -0
- package/dist/core/editor/components/panels/StudioPanel/index.d.ts +7 -0
- package/dist/core/editor/components/panels/index.d.ts +3 -0
- package/dist/core/editor/index.d.ts +3 -1
- package/dist/core/editor/shell.d.ts +31 -0
- package/dist/core/gameplay/events/data/seedEvents.d.ts +2 -0
- package/dist/core/gameplay/events/engine.d.ts +17 -0
- package/dist/core/gameplay/events/index.d.ts +5 -0
- package/dist/core/gameplay/events/registry.d.ts +11 -0
- package/dist/core/gameplay/events/types.d.ts +138 -0
- package/dist/core/gameplay/index.d.ts +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/interactions/core/adapter.d.ts +9 -0
- package/dist/core/interactions/core/index.d.ts +1 -0
- package/dist/core/motions/entities/types.d.ts +2 -0
- package/dist/core/motions/hooks/usePhysicsBridge.d.ts +2 -0
- package/dist/core/motions/index.d.ts +1 -0
- package/dist/core/motions/plugin.d.ts +50 -0
- package/dist/core/networks/adapter/MockNetworkAdapter.d.ts +10 -0
- package/dist/core/networks/adapter/index.d.ts +3 -0
- package/dist/core/networks/adapter/types.d.ts +51 -0
- package/dist/core/networks/index.d.ts +1 -0
- package/dist/core/ops/index.d.ts +2 -0
- package/dist/core/ops/rbac.d.ts +4 -0
- package/dist/core/ops/types.d.ts +44 -0
- package/dist/core/platform/index.d.ts +2 -0
- package/dist/core/platform/snapshot.d.ts +35 -0
- package/dist/core/plugins/ExtensionRegistry.d.ts +1 -0
- package/dist/core/plugins/PluginRegistry.d.ts +1 -0
- package/dist/core/plugins/types.d.ts +4 -0
- package/dist/core/runtime/createGaesupRuntime.d.ts +2 -0
- package/dist/core/runtime/index.d.ts +2 -0
- package/dist/core/runtime/types.d.ts +24 -0
- package/dist/core/save/core/SaveSystem.d.ts +4 -2
- package/dist/core/save/types.d.ts +8 -0
- package/dist/core/world/components/WorldContainer/types.d.ts +11 -2
- package/dist/core/world/stores/persistenceSlice.d.ts +11 -6
- package/dist/defaultConfig-COlgACOY.js +2126 -0
- package/dist/defaultConfig-CiF9wN96.cjs +1 -0
- package/dist/editor.cjs +1 -0
- package/dist/editor.d.ts +5 -0
- package/dist/editor.js +208 -0
- package/dist/eventsStore-Cipkf938.cjs +1 -0
- package/dist/eventsStore-DqmXNVEb.js +244 -0
- package/dist/gaesupStore-BUvjyYKz.cjs +1 -0
- package/dist/gaesupStore-c2IZvvF8.js +1345 -0
- package/dist/gltf/props/LICENSE.txt +70 -0
- package/dist/index-BCc8fuy2.cjs +1 -0
- package/dist/index-BEDIGqAu.js +706 -0
- package/dist/index-BJmo08pc.cjs +1 -0
- package/dist/index-C-ViQFGa.js +100 -0
- package/dist/index-C4JG_j3y.js +386 -0
- package/dist/index-CQH04fpl.cjs +1 -0
- package/dist/index-DCa_lUwq.cjs +1 -0
- package/dist/index-DKypFCSV.js +328 -0
- package/dist/index-DLPhCgI6.js +547 -0
- package/dist/index-Dgc3RSmz.cjs +1 -0
- package/dist/index-Dj5aHiJD.cjs +1 -0
- package/dist/index-gzJaPL5R.js +69 -0
- package/dist/index.cjs +2 -726
- package/dist/index.css +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +4183 -15725
- package/dist/network.cjs +1 -0
- package/dist/network.d.ts +1 -0
- package/dist/network.js +2067 -0
- package/dist/postprocessing.cjs +1 -1
- package/dist/postprocessing.js +24 -23
- package/dist/rbac-Bjx9pTbU.js +42 -0
- package/dist/rbac-N7h7zNl3.cjs +1 -0
- package/dist/{registerComponents-CYCKQxA1.js → registerComponents-CGbbVhvf.js} +2 -2
- package/dist/{registerComponents-DBQpZm-r.cjs → registerComponents-UboG7NXy.cjs} +1 -1
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +1350 -0
- package/dist/seedEvents-Dmms48tb.cjs +1 -0
- package/dist/seedEvents-v6aCLQE7.js +723 -0
- package/dist/server-contracts.cjs +1 -0
- package/dist/server-contracts.d.ts +5 -0
- package/dist/server-contracts.js +28 -0
- package/dist/sfe-CRsG1dTW.js +10 -0
- package/dist/sfe-CpgzdMyB.cjs +1 -0
- package/dist/snapshot-DRqZrbCu.cjs +1 -0
- package/dist/snapshot-OExk53wq.js +75 -0
- package/dist/timeStore-BRw0mdde.js +96 -0
- package/dist/timeStore-CDN035t4.cjs +1 -0
- package/dist/types-Ck0ueY4N.js +40 -0
- package/dist/types-DgS5FYTs.cjs +1 -0
- package/dist/useSpawnFromBlueprint-DUJ0eO6H.js +366 -0
- package/dist/useSpawnFromBlueprint-hqIkXXNv.cjs +1 -0
- package/dist/weatherStore-1unmwIen.cjs +1 -0
- package/dist/weatherStore-CzG5N441.js +49 -0
- package/package.json +226 -175
- package/public/gltf/props/LICENSE.txt +70 -0
- package/public/gltf/props/bed.glb +0 -0
- package/public/gltf/props/chair.glb +0 -0
- package/public/gltf/props/crafting.glb +0 -0
- package/public/gltf/props/door.glb +0 -0
- package/public/gltf/props/fence.glb +0 -0
- package/public/gltf/props/lamp.glb +0 -0
- package/public/gltf/props/mailbox.glb +0 -0
- package/public/gltf/props/shop-stall.glb +0 -0
- package/public/gltf/props/storage.glb +0 -0
- package/public/gltf/props/table.glb +0 -0
- package/public/gltf/props/window.glb +0 -0
- package/dist/index-B-02XaUy.js +0 -3436
- package/dist/index-CZLbaLYT.cjs +0 -1
- package/dist/useSpawnFromBlueprint-Cxb3C2ch.js +0 -1665
- package/dist/useSpawnFromBlueprint-D5j-98Q8.cjs +0 -1
- package/dist/weatherStore-C2_1d8hn.cjs +0 -1
- package/dist/weatherStore-ZW3thKj6.js +0 -142
package/README.md
CHANGED
|
@@ -1,263 +1,267 @@
|
|
|
1
|
-
# Gaesup World
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/gaesup-world)
|
|
4
|
-
[](https://www.npmjs.com/package/gaesup-world)
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
`Gaesup World`는 `React Three Fiber`, `Three.js`, `Rapier`, `Zustand` 기반으로 만든 웹 3D 월드/게임 라이브러리입니다. 캐릭터 이동, 카메라, 상호작용, 건설, 애니메이션, 네트워크, 인벤토리, 퀘스트, 날씨, 타운 시스템처럼 월드 게임에 필요한 기능을 도메인 단위로 제공합니다.
|
|
9
|
-
|
|
10
|
-
이 저장소는 두 가지 역할을 함께 가집니다.
|
|
11
|
-
|
|
12
|
-
- `src/`: 실제 배포되는 라이브러리 코드
|
|
13
|
-
- `examples/`: 라이브러리를 사용하는 데모 앱
|
|
14
|
-
|
|
15
|
-
## 현재 상태
|
|
16
|
-
|
|
17
|
-
- 패키지명: `gaesup-world`
|
|
18
|
-
- 문서 기준 import 엔트리: `gaesup-world`
|
|
19
|
-
- 라이브러리 ESM 빌드: 확인 완료
|
|
20
|
-
- 데모 Vite 빌드: 확인 완료
|
|
21
|
-
- Jest 테스트: 통과
|
|
22
|
-
- TypeScript
|
|
23
|
-
|
|
24
|
-
즉,
|
|
25
|
-
|
|
26
|
-
## 설치
|
|
27
|
-
|
|
28
|
-
프로젝트에서 사용할 때는 `gaesup-world`와 React Three Fiber 계열 의존성을 함께 설치하면 됩니다.
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
또는
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
yarn add gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
또는
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
pnpm add gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## 빠른 시작
|
|
47
|
-
|
|
48
|
-
가장 기본적인 사용 예시는 아래와 같습니다.
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
import { Canvas } from '@react-three/fiber';
|
|
52
|
-
import { Physics } from '@react-three/rapier';
|
|
53
|
-
import { GaesupController, GaesupWorld } from 'gaesup-world';
|
|
54
|
-
|
|
55
|
-
const CHARACTER_URL = 'https://your-cdn.example.com/character.glb';
|
|
56
|
-
|
|
57
|
-
export default function App() {
|
|
58
|
-
return (
|
|
59
|
-
<GaesupWorld
|
|
60
|
-
urls={{ characterUrl: CHARACTER_URL }}
|
|
61
|
-
mode={{ type: 'character', controller: 'keyboard', control: 'thirdPerson' }}
|
|
62
|
-
>
|
|
63
|
-
<Canvas shadows camera={{ position: [0, 6, 10], fov: 50 }}>
|
|
64
|
-
<Physics>
|
|
65
|
-
<GaesupController />
|
|
66
|
-
</Physics>
|
|
67
|
-
</Canvas>
|
|
68
|
-
</GaesupWorld>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## 핵심 개념
|
|
74
|
-
|
|
75
|
-
### 월드 설정
|
|
76
|
-
|
|
77
|
-
`GaesupWorld`는 월드 관련 설정을 store에 주입하는 루트 컴포넌트입니다.
|
|
78
|
-
|
|
79
|
-
- `urls`: 캐릭터/차량/비행기 모델 URL
|
|
80
|
-
- `mode`: 플레이어 타입, 입력 방식, 카메라 제어 방식
|
|
81
|
-
- `cameraOption`: 카메라 세부 옵션
|
|
82
|
-
|
|
83
|
-
내부적으로는 `WorldContainer` 또는 `WorldConfigProvider` 역할을 감싼 공개 API입니다.
|
|
84
|
-
|
|
85
|
-
### 플레이어 제어
|
|
86
|
-
|
|
87
|
-
`GaesupController`는 캐릭터/엔티티 조작을 담당하는 기본 컨트롤러입니다.
|
|
88
|
-
|
|
89
|
-
- 키보드 이동
|
|
90
|
-
- 클릭 이동
|
|
91
|
-
- 상호작용 시스템 연결
|
|
92
|
-
- 이동/상태 브리지 연결
|
|
93
|
-
|
|
94
|
-
### 도메인 기반 구조
|
|
95
|
-
|
|
96
|
-
주요 기능은 도메인 단위로 분리되어 있습니다.
|
|
97
|
-
|
|
98
|
-
- `animation`
|
|
99
|
-
- `camera`
|
|
100
|
-
- `motions`
|
|
101
|
-
- `interactions`
|
|
102
|
-
- `world`
|
|
103
|
-
- `building`
|
|
104
|
-
- `networks`
|
|
105
|
-
- `time`
|
|
106
|
-
- `save`
|
|
107
|
-
- `inventory`
|
|
108
|
-
- `items`
|
|
109
|
-
- `quests`
|
|
110
|
-
- `weather`
|
|
111
|
-
- `town`
|
|
112
|
-
- `audio`
|
|
113
|
-
- `npc`
|
|
114
|
-
- `blueprints`
|
|
115
|
-
- `admin`
|
|
116
|
-
|
|
117
|
-
## 자주 쓰는 공개 API
|
|
118
|
-
|
|
119
|
-
대표적으로 아래 항목들을 루트 엔트리에서 바로 import 할 수 있습니다.
|
|
120
|
-
|
|
121
|
-
```tsx
|
|
122
|
-
import {
|
|
123
|
-
GaesupWorld,
|
|
124
|
-
GaesupController,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
corepack pnpm
|
|
201
|
-
corepack pnpm
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
`
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
- `/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
최근
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
- [
|
|
246
|
-
- [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
- [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
- [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
1
|
+
# Gaesup World
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/gaesup-world)
|
|
4
|
+
[](https://www.npmjs.com/package/gaesup-world)
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
`Gaesup World`는 `React Three Fiber`, `Three.js`, `Rapier`, `Zustand` 기반으로 만든 웹 3D 월드/게임 라이브러리입니다. 캐릭터 이동, 카메라, 상호작용, 건설, 애니메이션, 네트워크, 인벤토리, 퀘스트, 날씨, 타운 시스템처럼 월드 게임에 필요한 기능을 도메인 단위로 제공합니다.
|
|
9
|
+
|
|
10
|
+
이 저장소는 두 가지 역할을 함께 가집니다.
|
|
11
|
+
|
|
12
|
+
- `src/`: 실제 배포되는 라이브러리 코드
|
|
13
|
+
- `examples/`: 라이브러리를 사용하는 데모 앱
|
|
14
|
+
|
|
15
|
+
## 현재 상태
|
|
16
|
+
|
|
17
|
+
- 패키지명: `gaesup-world`
|
|
18
|
+
- 문서 기준 import 엔트리: `gaesup-world`
|
|
19
|
+
- 라이브러리 ESM 빌드: 확인 완료
|
|
20
|
+
- 데모 Vite 빌드: 확인 완료
|
|
21
|
+
- Jest 테스트: 통과
|
|
22
|
+
- TypeScript declaration build: 통과
|
|
23
|
+
|
|
24
|
+
즉, 런타임, 번들, 타입 선언 빌드 기준으로는 사용 가능한 상태입니다.
|
|
25
|
+
|
|
26
|
+
## 설치
|
|
27
|
+
|
|
28
|
+
프로젝트에서 사용할 때는 `gaesup-world`와 React Three Fiber 계열 의존성을 함께 설치하면 됩니다.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
또는
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn add gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
또는
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm add gaesup-world three react react-dom @react-three/fiber @react-three/drei @react-three/rapier
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 빠른 시작
|
|
47
|
+
|
|
48
|
+
가장 기본적인 사용 예시는 아래와 같습니다.
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { Canvas } from '@react-three/fiber';
|
|
52
|
+
import { Physics } from '@react-three/rapier';
|
|
53
|
+
import { GaesupController, GaesupWorld } from 'gaesup-world';
|
|
54
|
+
|
|
55
|
+
const CHARACTER_URL = 'https://your-cdn.example.com/character.glb';
|
|
56
|
+
|
|
57
|
+
export default function App() {
|
|
58
|
+
return (
|
|
59
|
+
<GaesupWorld
|
|
60
|
+
urls={{ characterUrl: CHARACTER_URL }}
|
|
61
|
+
mode={{ type: 'character', controller: 'keyboard', control: 'thirdPerson' }}
|
|
62
|
+
>
|
|
63
|
+
<Canvas shadows camera={{ position: [0, 6, 10], fov: 50 }}>
|
|
64
|
+
<Physics>
|
|
65
|
+
<GaesupController />
|
|
66
|
+
</Physics>
|
|
67
|
+
</Canvas>
|
|
68
|
+
</GaesupWorld>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 핵심 개념
|
|
74
|
+
|
|
75
|
+
### 월드 설정
|
|
76
|
+
|
|
77
|
+
`GaesupWorld`는 월드 관련 설정을 store에 주입하는 루트 컴포넌트입니다.
|
|
78
|
+
|
|
79
|
+
- `urls`: 캐릭터/차량/비행기 모델 URL
|
|
80
|
+
- `mode`: 플레이어 타입, 입력 방식, 카메라 제어 방식
|
|
81
|
+
- `cameraOption`: 카메라 세부 옵션
|
|
82
|
+
|
|
83
|
+
내부적으로는 `WorldContainer` 또는 `WorldConfigProvider` 역할을 감싼 공개 API입니다.
|
|
84
|
+
|
|
85
|
+
### 플레이어 제어
|
|
86
|
+
|
|
87
|
+
`GaesupController`는 캐릭터/엔티티 조작을 담당하는 기본 컨트롤러입니다.
|
|
88
|
+
|
|
89
|
+
- 키보드 이동
|
|
90
|
+
- 클릭 이동
|
|
91
|
+
- 상호작용 시스템 연결
|
|
92
|
+
- 이동/상태 브리지 연결
|
|
93
|
+
|
|
94
|
+
### 도메인 기반 구조
|
|
95
|
+
|
|
96
|
+
주요 기능은 도메인 단위로 분리되어 있습니다.
|
|
97
|
+
|
|
98
|
+
- `animation`
|
|
99
|
+
- `camera`
|
|
100
|
+
- `motions`
|
|
101
|
+
- `interactions`
|
|
102
|
+
- `world`
|
|
103
|
+
- `building`
|
|
104
|
+
- `networks`
|
|
105
|
+
- `time`
|
|
106
|
+
- `save`
|
|
107
|
+
- `inventory`
|
|
108
|
+
- `items`
|
|
109
|
+
- `quests`
|
|
110
|
+
- `weather`
|
|
111
|
+
- `town`
|
|
112
|
+
- `audio`
|
|
113
|
+
- `npc`
|
|
114
|
+
- `blueprints`
|
|
115
|
+
- `admin`
|
|
116
|
+
|
|
117
|
+
## 자주 쓰는 공개 API
|
|
118
|
+
|
|
119
|
+
대표적으로 아래 항목들을 루트 엔트리에서 바로 import 할 수 있습니다.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import {
|
|
123
|
+
GaesupWorld,
|
|
124
|
+
GaesupController,
|
|
125
|
+
WorldContainer,
|
|
126
|
+
WorldConfigProvider,
|
|
127
|
+
BuildingUI,
|
|
128
|
+
InventoryUI,
|
|
129
|
+
QuestLogUI,
|
|
130
|
+
DialogBox,
|
|
131
|
+
WeatherEffect,
|
|
132
|
+
useInventoryStore,
|
|
133
|
+
useQuestStore,
|
|
134
|
+
useWeatherStore,
|
|
135
|
+
useGameTime,
|
|
136
|
+
getItemRegistry,
|
|
137
|
+
getNPCScheduler,
|
|
138
|
+
} from 'gaesup-world';
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
블루프린트 런타임 관련 API도 루트 엔트리에서 바로 사용할 수 있습니다.
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import {
|
|
145
|
+
BlueprintSpawner,
|
|
146
|
+
blueprintRegistry,
|
|
147
|
+
BlueprintFactory,
|
|
148
|
+
} from 'gaesup-world';
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
관리자 UI와 블루프린트 편집 UI는 별도 subpath를 사용합니다.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { GaesupAdmin, useAuthStore } from 'gaesup-world/admin';
|
|
155
|
+
import { BlueprintEditor } from 'gaesup-world/blueprints/editor';
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Admin 사용법
|
|
159
|
+
|
|
160
|
+
관리자 UI는 `gaesup-world/admin` 엔트리에서 import 합니다.
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
import { GaesupAdmin } from 'gaesup-world/admin';
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
기본적으로 `GaesupAdmin`은 로그인 게이트가 켜져 있습니다. 즉, `requireLogin` 기본값은 `true`입니다.
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { GaesupAdmin } from 'gaesup-world/admin';
|
|
170
|
+
|
|
171
|
+
export default function AdminPage() {
|
|
172
|
+
return (
|
|
173
|
+
<GaesupAdmin>
|
|
174
|
+
<div>Protected Admin Area</div>
|
|
175
|
+
</GaesupAdmin>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
로그인 보호 없이 감싸고 싶다면 명시적으로 꺼야 합니다.
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
<GaesupAdmin requireLogin={false}>
|
|
184
|
+
<div>Public Admin Preview</div>
|
|
185
|
+
</GaesupAdmin>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 개발 환경 실행
|
|
189
|
+
|
|
190
|
+
이 저장소 자체를 로컬에서 실행할 때는 `pnpm` 기준으로 작업하는 것이 가장 자연스럽습니다.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
corepack pnpm install
|
|
194
|
+
corepack pnpm dev
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
주요 명령:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
corepack pnpm dev
|
|
201
|
+
corepack pnpm build
|
|
202
|
+
corepack pnpm exec vite build --mode esm
|
|
203
|
+
corepack pnpm exec vite build
|
|
204
|
+
corepack pnpm test -- --runInBand
|
|
205
|
+
corepack pnpm lint
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
참고:
|
|
209
|
+
|
|
210
|
+
- 현재 Windows 환경에서는 `prepare` 스크립트가 `pnpm` PATH 설정에 따라 실패할 수 있습니다.
|
|
211
|
+
- 이런 경우 `corepack pnpm ...` 형태로 실행하면 정상 동작합니다.
|
|
212
|
+
|
|
213
|
+
## 데모 앱
|
|
214
|
+
|
|
215
|
+
`examples/`에는 라이브러리를 실제로 사용하는 데모 라우트가 들어 있습니다.
|
|
216
|
+
|
|
217
|
+
- `/`: 쇼케이스 데모
|
|
218
|
+
- `/world`: 기본 월드/건설 에디터 데모
|
|
219
|
+
- `/edit`: 편집 데모
|
|
220
|
+
- `/blueprints`: 블루프린트 에디터
|
|
221
|
+
- `/network`: 멀티플레이어 데모
|
|
222
|
+
- `/admin`: 관리자 래핑 데모
|
|
223
|
+
|
|
224
|
+
최근 정리로 인해 `examples`는 가능하면 내부 소스 경로 대신 루트 public API를 사용하도록 맞춰져 있습니다.
|
|
225
|
+
|
|
226
|
+
## 검증 상태
|
|
227
|
+
|
|
228
|
+
최근 확인 기준:
|
|
229
|
+
|
|
230
|
+
- `corepack pnpm exec vite build`: 성공
|
|
231
|
+
- `corepack pnpm exec vite build --mode esm`: 성공
|
|
232
|
+
- `corepack pnpm exec jest --runInBand --watchman=false`: 성공
|
|
233
|
+
- `npm run build:types`: 성공
|
|
234
|
+
|
|
235
|
+
타입 선언 빌드는 현재 통과합니다.
|
|
236
|
+
|
|
237
|
+
## 문서 안내
|
|
238
|
+
|
|
239
|
+
프로젝트 개요:
|
|
240
|
+
|
|
241
|
+
- [프로젝트 개요](./docs/GAESUP_WORLD_OVERVIEW.md)
|
|
242
|
+
|
|
243
|
+
도메인 문서:
|
|
244
|
+
|
|
245
|
+
- [애니메이션](./docs/domain/ANIMATION.md)
|
|
246
|
+
- [블루프린트](./docs/domain/BLUEPRINT.md)
|
|
247
|
+
- [카메라](./docs/domain/CAMERA.md)
|
|
248
|
+
- [모션](./docs/domain/MOTIONS.md)
|
|
249
|
+
- [네트워크](./docs/domain/NETWORKS.md)
|
|
250
|
+
- [보일러플레이트 구조](./docs/domain/BOILERPLATE_ARCHITECTURE.md)
|
|
251
|
+
|
|
252
|
+
계획 문서:
|
|
253
|
+
|
|
254
|
+
- [MVP 계획](./docs/plan/MVP.md)
|
|
255
|
+
|
|
256
|
+
가이드 문서:
|
|
257
|
+
|
|
258
|
+
- [API 가이드](./docs/guide/API_GUIDE.md)
|
|
259
|
+
- [레이어 가이드](./docs/guide/LAYER_GUIDE.md)
|
|
260
|
+
- [성능 가이드](./docs/guide/PERFORMANCE_GUIDE.md)
|
|
261
|
+
- [테스트 가이드](./docs/guide/TEST_GUIDE.md)
|
|
262
|
+
|
|
263
|
+
## 패키지 정보
|
|
264
|
+
|
|
265
|
+
- npm: https://www.npmjs.com/package/gaesup-world
|
|
266
|
+
- 저장소: https://github.com/jigglypop/gaesup-world.git
|
|
267
|
+
- 라이선스: MIT
|