@spatial-engine/react 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Francisco Rueda Esquivel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ useOctree: () => useOctree,
24
+ useSpatialEngine: () => useSpatialEngine
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+ var import_react = require("react");
28
+ var import_core = require("@spatial-engine/core");
29
+ function useSpatialEngine(options = {}) {
30
+ const { aabbCapacity = 1024, rayCapacity = 256 } = options;
31
+ const handleRef = (0, import_react.useRef)(null);
32
+ if (handleRef.current === null) {
33
+ const aabbPool = new import_core.AABBPool(aabbCapacity);
34
+ const rayPool = new import_core.RayPool(rayCapacity);
35
+ handleRef.current = {
36
+ aabbPool,
37
+ rayPool,
38
+ reset: () => {
39
+ aabbPool.reset();
40
+ rayPool.reset();
41
+ }
42
+ };
43
+ }
44
+ (0, import_react.useEffect)(() => {
45
+ const handle = handleRef.current;
46
+ if (handle === null) return;
47
+ const newAabb = new import_core.AABBPool(aabbCapacity);
48
+ const newRay = new import_core.RayPool(rayCapacity);
49
+ handle.aabbPool = newAabb;
50
+ handle.rayPool = newRay;
51
+ handle.reset = () => {
52
+ newAabb.reset();
53
+ newRay.reset();
54
+ };
55
+ }, [aabbCapacity, rayCapacity]);
56
+ return handleRef.current;
57
+ }
58
+ function useOctree(options = {}) {
59
+ const { nodeCapacity = 512, objectCapacity = 512 } = options;
60
+ const handleRef = (0, import_react.useRef)(null);
61
+ if (handleRef.current === null) {
62
+ const nodePool = new import_core.OctreeNodePool(nodeCapacity);
63
+ const aabbPool = new import_core.AABBPool(objectCapacity);
64
+ const octree = new import_core.Octree(nodePool, aabbPool);
65
+ handleRef.current = {
66
+ octree,
67
+ nodePool,
68
+ aabbPool,
69
+ reset: () => {
70
+ nodePool.reset();
71
+ aabbPool.reset();
72
+ }
73
+ };
74
+ }
75
+ (0, import_react.useEffect)(() => {
76
+ const handle = handleRef.current;
77
+ if (handle === null) return;
78
+ const newNodePool = new import_core.OctreeNodePool(nodeCapacity);
79
+ const newAabbPool = new import_core.AABBPool(objectCapacity);
80
+ const newOctree = new import_core.Octree(newNodePool, newAabbPool);
81
+ handle.octree = newOctree;
82
+ handle.nodePool = newNodePool;
83
+ handle.aabbPool = newAabbPool;
84
+ handle.reset = () => {
85
+ newNodePool.reset();
86
+ newAabbPool.reset();
87
+ };
88
+ }, [nodeCapacity, objectCapacity]);
89
+ return handleRef.current;
90
+ }
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ useOctree,
94
+ useSpatialEngine
95
+ });
96
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { useRef, useEffect } from 'react';\nimport { AABBPool, RayPool, OctreeNodePool, Octree } from '@spatial-engine/core';\n\nexport interface SpatialEngineOptions {\n /** Maximum number of AABBs to pre-allocate in the pool. Default: 1024 */\n aabbCapacity?: number;\n /** Maximum number of Rays to pre-allocate in the pool. Default: 256 */\n rayCapacity?: number;\n}\n\nexport interface SpatialEngineHandle {\n aabbPool: AABBPool;\n rayPool: RayPool;\n /** Reset both pools (call once per frame before re-populating). */\n reset: () => void;\n}\n\n/**\n * React hook that creates and manages a pair of zero-GC spatial pools\n * backed by Float32Arrays. The pools are stable across renders – call\n * `handle.reset()` at the start of each animation frame to free all\n * allocations without triggering GC.\n */\nexport function useSpatialEngine(\n options: SpatialEngineOptions = {},\n): SpatialEngineHandle {\n const { aabbCapacity = 1024, rayCapacity = 256 } = options;\n\n const handleRef = useRef<SpatialEngineHandle | null>(null);\n\n if (handleRef.current === null) {\n const aabbPool = new AABBPool(aabbCapacity);\n const rayPool = new RayPool(rayCapacity);\n handleRef.current = {\n aabbPool,\n rayPool,\n reset: () => {\n aabbPool.reset();\n rayPool.reset();\n },\n };\n }\n\n // Re-create pools if capacity options change (rare but supported).\n useEffect(() => {\n const handle = handleRef.current;\n if (handle === null) return;\n const newAabb = new AABBPool(aabbCapacity);\n const newRay = new RayPool(rayCapacity);\n handle.aabbPool = newAabb;\n handle.rayPool = newRay;\n handle.reset = () => {\n newAabb.reset();\n newRay.reset();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [aabbCapacity, rayCapacity]);\n\n return handleRef.current;\n}\n\nexport interface OctreeOptions {\n /** Number of octree node slots to pre-allocate. Default: 512 */\n nodeCapacity?: number;\n /** Number of object (AABB) slots to pre-allocate. Default: 512 */\n objectCapacity?: number;\n}\n\nexport interface OctreeHandle {\n octree: Octree;\n nodePool: OctreeNodePool;\n aabbPool: AABBPool;\n /** Reset both pools (call once per frame before re-populating). */\n reset: () => void;\n}\n\n/**\n * React hook that creates and manages a zero-GC Octree backed by flat\n * Float32Array pools. The octree and pools are stable across renders.\n * Call `handle.reset()` at the start of each animation frame to free all\n * object allocations without triggering GC, then re-insert objects for that\n * frame.\n */\nexport function useOctree(options: OctreeOptions = {}): OctreeHandle {\n const { nodeCapacity = 512, objectCapacity = 512 } = options;\n\n const handleRef = useRef<OctreeHandle | null>(null);\n\n if (handleRef.current === null) {\n const nodePool = new OctreeNodePool(nodeCapacity);\n const aabbPool = new AABBPool(objectCapacity);\n const octree = new Octree(nodePool, aabbPool);\n handleRef.current = {\n octree,\n nodePool,\n aabbPool,\n reset: () => {\n nodePool.reset();\n aabbPool.reset();\n },\n };\n }\n\n // Re-create pools if capacity options change (rare but supported).\n useEffect(() => {\n const handle = handleRef.current;\n if (handle === null) return;\n const newNodePool = new OctreeNodePool(nodeCapacity);\n const newAabbPool = new AABBPool(objectCapacity);\n const newOctree = new Octree(newNodePool, newAabbPool);\n handle.octree = newOctree;\n handle.nodePool = newNodePool;\n handle.aabbPool = newAabbPool;\n handle.reset = () => {\n newNodePool.reset();\n newAabbPool.reset();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\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A,IACF;AAAA,EACF;AAGA,8BAAU,MAAM;AACd,UAAM,SAAS,UAAU;AACzB,QAAI,WAAW,KAAM;AACrB,UAAM,cAAc,IAAI,2BAAe,YAAY;AACnD,UAAM,cAAc,IAAI,qBAAS,cAAc;AAC/C,UAAM,YAAY,IAAI,mBAAO,aAAa,WAAW;AACrD,WAAO,SAAS;AAChB,WAAO,WAAW;AAClB,WAAO,WAAW;AAClB,WAAO,QAAQ,MAAM;AACnB,kBAAY,MAAM;AAClB,kBAAY,MAAM;AAAA,IACpB;AAAA,EAEF,GAAG,CAAC,cAAc,cAAc,CAAC;AAEjC,SAAO,UAAU;AACnB;","names":[]}
@@ -0,0 +1,44 @@
1
+ import { Octree, OctreeNodePool, AABBPool, RayPool } from '@spatial-engine/core';
2
+
3
+ interface SpatialEngineOptions {
4
+ /** Maximum number of AABBs to pre-allocate in the pool. Default: 1024 */
5
+ aabbCapacity?: number;
6
+ /** Maximum number of Rays to pre-allocate in the pool. Default: 256 */
7
+ rayCapacity?: number;
8
+ }
9
+ interface SpatialEngineHandle {
10
+ aabbPool: AABBPool;
11
+ rayPool: RayPool;
12
+ /** Reset both pools (call once per frame before re-populating). */
13
+ reset: () => void;
14
+ }
15
+ /**
16
+ * React hook that creates and manages a pair of zero-GC spatial pools
17
+ * backed by Float32Arrays. The pools are stable across renders – call
18
+ * `handle.reset()` at the start of each animation frame to free all
19
+ * allocations without triggering GC.
20
+ */
21
+ declare function useSpatialEngine(options?: SpatialEngineOptions): SpatialEngineHandle;
22
+ interface OctreeOptions {
23
+ /** Number of octree node slots to pre-allocate. Default: 512 */
24
+ nodeCapacity?: number;
25
+ /** Number of object (AABB) slots to pre-allocate. Default: 512 */
26
+ objectCapacity?: number;
27
+ }
28
+ interface OctreeHandle {
29
+ octree: Octree;
30
+ nodePool: OctreeNodePool;
31
+ aabbPool: AABBPool;
32
+ /** Reset both pools (call once per frame before re-populating). */
33
+ reset: () => void;
34
+ }
35
+ /**
36
+ * React hook that creates and manages a zero-GC Octree backed by flat
37
+ * Float32Array pools. The octree and pools are stable across renders.
38
+ * Call `handle.reset()` at the start of each animation frame to free all
39
+ * object allocations without triggering GC, then re-insert objects for that
40
+ * frame.
41
+ */
42
+ declare function useOctree(options?: OctreeOptions): OctreeHandle;
43
+
44
+ export { type OctreeHandle, type OctreeOptions, type SpatialEngineHandle, type SpatialEngineOptions, useOctree, useSpatialEngine };
@@ -0,0 +1,44 @@
1
+ import { Octree, OctreeNodePool, AABBPool, RayPool } from '@spatial-engine/core';
2
+
3
+ interface SpatialEngineOptions {
4
+ /** Maximum number of AABBs to pre-allocate in the pool. Default: 1024 */
5
+ aabbCapacity?: number;
6
+ /** Maximum number of Rays to pre-allocate in the pool. Default: 256 */
7
+ rayCapacity?: number;
8
+ }
9
+ interface SpatialEngineHandle {
10
+ aabbPool: AABBPool;
11
+ rayPool: RayPool;
12
+ /** Reset both pools (call once per frame before re-populating). */
13
+ reset: () => void;
14
+ }
15
+ /**
16
+ * React hook that creates and manages a pair of zero-GC spatial pools
17
+ * backed by Float32Arrays. The pools are stable across renders – call
18
+ * `handle.reset()` at the start of each animation frame to free all
19
+ * allocations without triggering GC.
20
+ */
21
+ declare function useSpatialEngine(options?: SpatialEngineOptions): SpatialEngineHandle;
22
+ interface OctreeOptions {
23
+ /** Number of octree node slots to pre-allocate. Default: 512 */
24
+ nodeCapacity?: number;
25
+ /** Number of object (AABB) slots to pre-allocate. Default: 512 */
26
+ objectCapacity?: number;
27
+ }
28
+ interface OctreeHandle {
29
+ octree: Octree;
30
+ nodePool: OctreeNodePool;
31
+ aabbPool: AABBPool;
32
+ /** Reset both pools (call once per frame before re-populating). */
33
+ reset: () => void;
34
+ }
35
+ /**
36
+ * React hook that creates and manages a zero-GC Octree backed by flat
37
+ * Float32Array pools. The octree and pools are stable across renders.
38
+ * Call `handle.reset()` at the start of each animation frame to free all
39
+ * object allocations without triggering GC, then re-insert objects for that
40
+ * frame.
41
+ */
42
+ declare function useOctree(options?: OctreeOptions): OctreeHandle;
43
+
44
+ export { type OctreeHandle, type OctreeOptions, type SpatialEngineHandle, type SpatialEngineOptions, useOctree, useSpatialEngine };
package/dist/index.js ADDED
@@ -0,0 +1,70 @@
1
+ // src/index.ts
2
+ import { useRef, useEffect } from "react";
3
+ import { AABBPool, RayPool, OctreeNodePool, Octree } from "@spatial-engine/core";
4
+ function useSpatialEngine(options = {}) {
5
+ const { aabbCapacity = 1024, rayCapacity = 256 } = options;
6
+ const handleRef = useRef(null);
7
+ if (handleRef.current === null) {
8
+ const aabbPool = new AABBPool(aabbCapacity);
9
+ const rayPool = new RayPool(rayCapacity);
10
+ handleRef.current = {
11
+ aabbPool,
12
+ rayPool,
13
+ reset: () => {
14
+ aabbPool.reset();
15
+ rayPool.reset();
16
+ }
17
+ };
18
+ }
19
+ useEffect(() => {
20
+ const handle = handleRef.current;
21
+ if (handle === null) return;
22
+ const newAabb = new AABBPool(aabbCapacity);
23
+ const newRay = new RayPool(rayCapacity);
24
+ handle.aabbPool = newAabb;
25
+ handle.rayPool = newRay;
26
+ handle.reset = () => {
27
+ newAabb.reset();
28
+ newRay.reset();
29
+ };
30
+ }, [aabbCapacity, rayCapacity]);
31
+ return handleRef.current;
32
+ }
33
+ function useOctree(options = {}) {
34
+ const { nodeCapacity = 512, objectCapacity = 512 } = options;
35
+ const handleRef = useRef(null);
36
+ if (handleRef.current === null) {
37
+ const nodePool = new OctreeNodePool(nodeCapacity);
38
+ const aabbPool = new AABBPool(objectCapacity);
39
+ const octree = new Octree(nodePool, aabbPool);
40
+ handleRef.current = {
41
+ octree,
42
+ nodePool,
43
+ aabbPool,
44
+ reset: () => {
45
+ nodePool.reset();
46
+ aabbPool.reset();
47
+ }
48
+ };
49
+ }
50
+ useEffect(() => {
51
+ const handle = handleRef.current;
52
+ if (handle === null) return;
53
+ const newNodePool = new OctreeNodePool(nodeCapacity);
54
+ const newAabbPool = new AABBPool(objectCapacity);
55
+ const newOctree = new Octree(newNodePool, newAabbPool);
56
+ handle.octree = newOctree;
57
+ handle.nodePool = newNodePool;
58
+ handle.aabbPool = newAabbPool;
59
+ handle.reset = () => {
60
+ newNodePool.reset();
61
+ newAabbPool.reset();
62
+ };
63
+ }, [nodeCapacity, objectCapacity]);
64
+ return handleRef.current;
65
+ }
66
+ export {
67
+ useOctree,
68
+ useSpatialEngine
69
+ };
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { useRef, useEffect } from 'react';\nimport { AABBPool, RayPool, OctreeNodePool, Octree } from '@spatial-engine/core';\n\nexport interface SpatialEngineOptions {\n /** Maximum number of AABBs to pre-allocate in the pool. Default: 1024 */\n aabbCapacity?: number;\n /** Maximum number of Rays to pre-allocate in the pool. Default: 256 */\n rayCapacity?: number;\n}\n\nexport interface SpatialEngineHandle {\n aabbPool: AABBPool;\n rayPool: RayPool;\n /** Reset both pools (call once per frame before re-populating). */\n reset: () => void;\n}\n\n/**\n * React hook that creates and manages a pair of zero-GC spatial pools\n * backed by Float32Arrays. The pools are stable across renders – call\n * `handle.reset()` at the start of each animation frame to free all\n * allocations without triggering GC.\n */\nexport function useSpatialEngine(\n options: SpatialEngineOptions = {},\n): SpatialEngineHandle {\n const { aabbCapacity = 1024, rayCapacity = 256 } = options;\n\n const handleRef = useRef<SpatialEngineHandle | null>(null);\n\n if (handleRef.current === null) {\n const aabbPool = new AABBPool(aabbCapacity);\n const rayPool = new RayPool(rayCapacity);\n handleRef.current = {\n aabbPool,\n rayPool,\n reset: () => {\n aabbPool.reset();\n rayPool.reset();\n },\n };\n }\n\n // Re-create pools if capacity options change (rare but supported).\n useEffect(() => {\n const handle = handleRef.current;\n if (handle === null) return;\n const newAabb = new AABBPool(aabbCapacity);\n const newRay = new RayPool(rayCapacity);\n handle.aabbPool = newAabb;\n handle.rayPool = newRay;\n handle.reset = () => {\n newAabb.reset();\n newRay.reset();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [aabbCapacity, rayCapacity]);\n\n return handleRef.current;\n}\n\nexport interface OctreeOptions {\n /** Number of octree node slots to pre-allocate. Default: 512 */\n nodeCapacity?: number;\n /** Number of object (AABB) slots to pre-allocate. Default: 512 */\n objectCapacity?: number;\n}\n\nexport interface OctreeHandle {\n octree: Octree;\n nodePool: OctreeNodePool;\n aabbPool: AABBPool;\n /** Reset both pools (call once per frame before re-populating). */\n reset: () => void;\n}\n\n/**\n * React hook that creates and manages a zero-GC Octree backed by flat\n * Float32Array pools. The octree and pools are stable across renders.\n * Call `handle.reset()` at the start of each animation frame to free all\n * object allocations without triggering GC, then re-insert objects for that\n * frame.\n */\nexport function useOctree(options: OctreeOptions = {}): OctreeHandle {\n const { nodeCapacity = 512, objectCapacity = 512 } = options;\n\n const handleRef = useRef<OctreeHandle | null>(null);\n\n if (handleRef.current === null) {\n const nodePool = new OctreeNodePool(nodeCapacity);\n const aabbPool = new AABBPool(objectCapacity);\n const octree = new Octree(nodePool, aabbPool);\n handleRef.current = {\n octree,\n nodePool,\n aabbPool,\n reset: () => {\n nodePool.reset();\n aabbPool.reset();\n },\n };\n }\n\n // Re-create pools if capacity options change (rare but supported).\n useEffect(() => {\n const handle = handleRef.current;\n if (handle === null) return;\n const newNodePool = new OctreeNodePool(nodeCapacity);\n const newAabbPool = new AABBPool(objectCapacity);\n const newOctree = new Octree(newNodePool, newAabbPool);\n handle.octree = newOctree;\n handle.nodePool = newNodePool;\n handle.aabbPool = newAabbPool;\n handle.reset = () => {\n newNodePool.reset();\n newAabbPool.reset();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [nodeCapacity, objectCapacity]);\n\n return handleRef.current;\n}\n\n"],"mappings":";AAAA,SAAS,QAAQ,iBAAiB;AAClC,SAAS,UAAU,SAAS,gBAAgB,cAAc;AAsBnD,SAAS,iBACd,UAAgC,CAAC,GACZ;AACrB,QAAM,EAAE,eAAe,MAAM,cAAc,IAAI,IAAI;AAEnD,QAAM,YAAY,OAAmC,IAAI;AAEzD,MAAI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MAAM;AAClB,kBAAY,MAAM;AAAA,IACpB;AAAA,EAEF,GAAG,CAAC,cAAc,cAAc,CAAC;AAEjC,SAAO,UAAU;AACnB;","names":[]}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@spatial-engine/react",
3
+ "version": "0.0.1",
4
+ "description": "React Three Fiber adapter for @spatial-engine/core",
5
+ "author": "Francisco Rueda Esquivel",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/franruedaesq/spatial-engine.git",
10
+ "directory": "packages/react"
11
+ },
12
+ "keywords": [
13
+ "react",
14
+ "react-three-fiber",
15
+ "r3f",
16
+ "octree",
17
+ "spatial",
18
+ "aabb",
19
+ "hooks",
20
+ "3d",
21
+ "data-oriented-design",
22
+ "zero-gc"
23
+ ],
24
+ "type": "module",
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "dependencies": {
39
+ "@spatial-engine/core": "0.0.1",
40
+ "@spatial-engine/three": "0.0.1"
41
+ },
42
+ "peerDependencies": {
43
+ "react": ">=18.0.0",
44
+ "@react-three/fiber": ">=8.0.0",
45
+ "three": ">=0.150.0"
46
+ },
47
+ "devDependencies": {
48
+ "react": "^18.3.1",
49
+ "@types/react": "^18.3.3",
50
+ "three": "^0.166.1",
51
+ "@types/three": "^0.166.0",
52
+ "@react-three/fiber": "^8.17.5"
53
+ },
54
+ "scripts": {
55
+ "build": "tsup",
56
+ "typecheck": "tsc --noEmit"
57
+ }
58
+ }