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 CHANGED
@@ -10,6 +10,8 @@ npm i react-three-game @react-three/fiber three
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
11
11
  [![React](https://img.shields.io/badge/React-19-blue.svg)](https://react.dev/)
12
12
 
13
+ ![Prefab Editor](assets/editor.gif)
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 (_jsxs("group", { ref: (el) => registerRef(gameObject.id, el), position: transformProps.position, rotation: transformProps.rotation, scale: transformProps.scale, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, children: [physicsWrapped, children] }));
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.5",
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": "ISC",
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
- }