react-three-game 0.0.5 → 0.0.7
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 +2 -0
- package/assets/editor.gif +0 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/tools/prefabeditor/PrefabRoot.js +5 -3
- package/package.json +2 -2
- package/tsconfig.json +0 -18
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ npm i react-three-game @react-three/fiber three
|
|
|
10
10
|
[](https://www.typescriptlang.org/)
|
|
11
11
|
[](https://react.dev/)
|
|
12
12
|
|
|
13
|
+

|
|
14
|
+
|
|
13
15
|
## Core Principle
|
|
14
16
|
|
|
15
17
|
Scenes are JSON prefabs. Components are registered modules. Hierarchy is declarative.
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { default as GameCanvas } from './shared/GameCanvas';
|
|
|
2
2
|
export { default as PrefabEditor } from './tools/prefabeditor/PrefabEditor';
|
|
3
3
|
export { default as PrefabRoot } from './tools/prefabeditor/PrefabRoot';
|
|
4
4
|
export { DragDropLoader } from './tools/dragdrop/DragDropLoader';
|
|
5
|
-
export { default as AssetViewerPage, TextureListViewer, ModelListViewer, SoundListViewer, SharedCanvas } from './tools/assetviewer/page';
|
|
5
|
+
export { default as AssetViewerPage, TextureListViewer, ModelListViewer, SoundListViewer, SharedCanvas, } from './tools/assetviewer/page';
|
|
6
|
+
export type { Prefab, GameObject } from './tools/prefabeditor/types';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// Components
|
|
1
2
|
export { default as GameCanvas } from './shared/GameCanvas';
|
|
2
3
|
export { default as PrefabEditor } from './tools/prefabeditor/PrefabEditor';
|
|
3
4
|
export { default as PrefabRoot } from './tools/prefabeditor/PrefabRoot';
|
|
4
5
|
export { DragDropLoader } from './tools/dragdrop/DragDropLoader';
|
|
5
|
-
export { default as AssetViewerPage, TextureListViewer, ModelListViewer, SoundListViewer, SharedCanvas } from './tools/assetviewer/page';
|
|
6
|
+
export { default as AssetViewerPage, TextureListViewer, ModelListViewer, SoundListViewer, SharedCanvas, } from './tools/assetviewer/page';
|
|
@@ -167,12 +167,14 @@ function GameObjectRenderer({ gameObject, selectedId, onSelect, registerRef, loa
|
|
|
167
167
|
}
|
|
168
168
|
// --- 3. Core content decided by component registry ---
|
|
169
169
|
const core = renderCoreNode(gameObject, ctx, parentMatrix);
|
|
170
|
-
// --- 4. Wrap with physics if needed ---
|
|
171
|
-
const physicsWrapped = wrapPhysicsIfNeeded(gameObject, core, ctx);
|
|
172
170
|
// --- 5. Render children (always relative transforms) ---
|
|
173
171
|
const children = ((_d = gameObject.children) !== null && _d !== void 0 ? _d : []).map((child) => (_jsx(GameObjectRenderer, { gameObject: child, selectedId: selectedId, onSelect: onSelect, registerRef: registerRef, loadedModels: loadedModels, loadedTextures: loadedTextures, editMode: editMode, parentMatrix: worldMatrix }, child.id)));
|
|
172
|
+
// --- 4. Wrap with physics if needed ---
|
|
173
|
+
// Combine core and children so they both get wrapped by physics (if present)
|
|
174
|
+
const content = (_jsxs(_Fragment, { children: [core, children] }));
|
|
175
|
+
const physicsWrapped = wrapPhysicsIfNeeded(gameObject, content, ctx);
|
|
174
176
|
// --- 6. Final group wrapper ---
|
|
175
|
-
return (
|
|
177
|
+
return (_jsx("group", { ref: (el) => registerRef(gameObject.id, el), position: transformProps.position, rotation: transformProps.rotation, scale: transformProps.scale, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, children: physicsWrapped }));
|
|
176
178
|
}
|
|
177
179
|
// Helper: render an instanced GameInstance (terminal node)
|
|
178
180
|
function renderInstancedNode(gameObject, worldMatrix, ctx) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-three-game",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Batteries included React Three Fiber game engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"keywords": [],
|
|
15
15
|
"author": "prnth",
|
|
16
|
-
"license": "
|
|
16
|
+
"license": "VPL",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@react-three/fiber": "^9.0.0",
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"lib": ["ES2017", "DOM"],
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationDir": "dist",
|
|
9
|
-
"outDir": "dist",
|
|
10
|
-
"strict": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"moduleResolution": "bundler",
|
|
14
|
-
"allowSyntheticDefaultImports": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src"],
|
|
17
|
-
"exclude": ["node_modules", "dist"]
|
|
18
|
-
}
|