@plasius/gpu-physics 0.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-02-11
4
+
5
+ - Initial public release of `@plasius/gpu-physics`.
6
+ - Added `PhysicsRoot`, `StaticRigidBody`, `DynamicRigidBody`, and `KinematicRigidBody` bridge components.
7
+ - Added baseline tests and migration documentation.
package/LICENSE ADDED
@@ -0,0 +1,203 @@
1
+ Copyright 2025 Plasius LTD
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @plasius/gpu-physics
2
+
3
+ Framework-ready physics bridge package for Plasius GPU migration paths.
4
+
5
+ ## Why
6
+
7
+ `@plasius/gpu-physics` provides a stable physics API surface while renderer code migrates away from direct legacy integration points. It currently wraps proven runtime primitives and keeps call sites isolated.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @plasius/gpu-physics
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import { PhysicsRoot, StaticRigidBody } from "@plasius/gpu-physics";
19
+
20
+ <PhysicsRoot gravity={[0, -9.81, 0]}>
21
+ <StaticRigidBody colliders="trimesh">
22
+ {/* scene mesh */}
23
+ </StaticRigidBody>
24
+ </PhysicsRoot>
25
+ ```
26
+
27
+ ## Exports
28
+
29
+ - `DEFAULT_GRAVITY`
30
+ - `PhysicsRoot`
31
+ - `StaticRigidBody`
32
+ - `DynamicRigidBody`
33
+ - `KinematicRigidBody`
34
+
35
+ ## License
36
+
37
+ Apache-2.0
package/dist/index.cjs ADDED
@@ -0,0 +1,94 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/index.js
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ DEFAULT_GRAVITY: () => DEFAULT_GRAVITY,
33
+ DynamicRigidBody: () => DynamicRigidBody,
34
+ KinematicRigidBody: () => KinematicRigidBody,
35
+ PhysicsRoot: () => PhysicsRoot,
36
+ StaticRigidBody: () => StaticRigidBody
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+ var import_react = __toESM(require("react"), 1);
40
+ var import_rapier = require("@react-three/rapier");
41
+ var DEFAULT_GRAVITY = Object.freeze([0, -9.81, 0]);
42
+ function PhysicsRoot({ gravity = DEFAULT_GRAVITY, children, ...props }) {
43
+ return import_react.default.createElement(import_rapier.Physics, { gravity, ...props }, children);
44
+ }
45
+ function StaticRigidBody({
46
+ colliders = "trimesh",
47
+ children,
48
+ ...props
49
+ }) {
50
+ return import_react.default.createElement(
51
+ import_rapier.RigidBody,
52
+ {
53
+ type: "fixed",
54
+ colliders,
55
+ ...props
56
+ },
57
+ children
58
+ );
59
+ }
60
+ function DynamicRigidBody({ colliders = "hull", children, ...props }) {
61
+ return import_react.default.createElement(
62
+ import_rapier.RigidBody,
63
+ {
64
+ type: "dynamic",
65
+ colliders,
66
+ ...props
67
+ },
68
+ children
69
+ );
70
+ }
71
+ function KinematicRigidBody({
72
+ colliders = "hull",
73
+ children,
74
+ ...props
75
+ }) {
76
+ return import_react.default.createElement(
77
+ import_rapier.RigidBody,
78
+ {
79
+ type: "kinematicPosition",
80
+ colliders,
81
+ ...props
82
+ },
83
+ children
84
+ );
85
+ }
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ DEFAULT_GRAVITY,
89
+ DynamicRigidBody,
90
+ KinematicRigidBody,
91
+ PhysicsRoot,
92
+ StaticRigidBody
93
+ });
94
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"sourcesContent":["import React from \"react\";\nimport {\n Physics as RapierPhysics,\n RigidBody as RapierRigidBody,\n} from \"@react-three/rapier\";\n\nexport const DEFAULT_GRAVITY = Object.freeze([0, -9.81, 0]);\n\nexport function PhysicsRoot({ gravity = DEFAULT_GRAVITY, children, ...props }) {\n return React.createElement(RapierPhysics, { gravity, ...props }, children);\n}\n\nexport function StaticRigidBody({\n colliders = \"trimesh\",\n children,\n ...props\n}) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"fixed\",\n colliders,\n ...props,\n },\n children\n );\n}\n\nexport function DynamicRigidBody({ colliders = \"hull\", children, ...props }) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"dynamic\",\n colliders,\n ...props,\n },\n children\n );\n}\n\nexport function KinematicRigidBody({\n colliders = \"hull\",\n children,\n ...props\n}) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"kinematicPosition\",\n colliders,\n ...props,\n },\n children\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,oBAGO;AAEA,IAAM,kBAAkB,OAAO,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAEnD,SAAS,YAAY,EAAE,UAAU,iBAAiB,UAAU,GAAG,MAAM,GAAG;AAC7E,SAAO,aAAAA,QAAM,cAAc,cAAAC,SAAe,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC3E;AAEO,SAAS,gBAAgB;AAAA,EAC9B,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAO,aAAAD,QAAM;AAAA,IACX,cAAAE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,iBAAiB,EAAE,YAAY,QAAQ,UAAU,GAAG,MAAM,GAAG;AAC3E,SAAO,aAAAF,QAAM;AAAA,IACX,cAAAE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mBAAmB;AAAA,EACjC,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAO,aAAAF,QAAM;AAAA,IACX,cAAAE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":["React","RapierPhysics","RapierRigidBody"]}
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ // src/index.js
2
+ import React from "react";
3
+ import {
4
+ Physics as RapierPhysics,
5
+ RigidBody as RapierRigidBody
6
+ } from "@react-three/rapier";
7
+ var DEFAULT_GRAVITY = Object.freeze([0, -9.81, 0]);
8
+ function PhysicsRoot({ gravity = DEFAULT_GRAVITY, children, ...props }) {
9
+ return React.createElement(RapierPhysics, { gravity, ...props }, children);
10
+ }
11
+ function StaticRigidBody({
12
+ colliders = "trimesh",
13
+ children,
14
+ ...props
15
+ }) {
16
+ return React.createElement(
17
+ RapierRigidBody,
18
+ {
19
+ type: "fixed",
20
+ colliders,
21
+ ...props
22
+ },
23
+ children
24
+ );
25
+ }
26
+ function DynamicRigidBody({ colliders = "hull", children, ...props }) {
27
+ return React.createElement(
28
+ RapierRigidBody,
29
+ {
30
+ type: "dynamic",
31
+ colliders,
32
+ ...props
33
+ },
34
+ children
35
+ );
36
+ }
37
+ function KinematicRigidBody({
38
+ colliders = "hull",
39
+ children,
40
+ ...props
41
+ }) {
42
+ return React.createElement(
43
+ RapierRigidBody,
44
+ {
45
+ type: "kinematicPosition",
46
+ colliders,
47
+ ...props
48
+ },
49
+ children
50
+ );
51
+ }
52
+ export {
53
+ DEFAULT_GRAVITY,
54
+ DynamicRigidBody,
55
+ KinematicRigidBody,
56
+ PhysicsRoot,
57
+ StaticRigidBody
58
+ };
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"sourcesContent":["import React from \"react\";\nimport {\n Physics as RapierPhysics,\n RigidBody as RapierRigidBody,\n} from \"@react-three/rapier\";\n\nexport const DEFAULT_GRAVITY = Object.freeze([0, -9.81, 0]);\n\nexport function PhysicsRoot({ gravity = DEFAULT_GRAVITY, children, ...props }) {\n return React.createElement(RapierPhysics, { gravity, ...props }, children);\n}\n\nexport function StaticRigidBody({\n colliders = \"trimesh\",\n children,\n ...props\n}) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"fixed\",\n colliders,\n ...props,\n },\n children\n );\n}\n\nexport function DynamicRigidBody({ colliders = \"hull\", children, ...props }) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"dynamic\",\n colliders,\n ...props,\n },\n children\n );\n}\n\nexport function KinematicRigidBody({\n colliders = \"hull\",\n children,\n ...props\n}) {\n return React.createElement(\n RapierRigidBody,\n {\n type: \"kinematicPosition\",\n colliders,\n ...props,\n },\n children\n );\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAClB;AAAA,EACE,WAAW;AAAA,EACX,aAAa;AAAA,OACR;AAEA,IAAM,kBAAkB,OAAO,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AAEnD,SAAS,YAAY,EAAE,UAAU,iBAAiB,UAAU,GAAG,MAAM,GAAG;AAC7E,SAAO,MAAM,cAAc,eAAe,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC3E;AAEO,SAAS,gBAAgB;AAAA,EAC9B,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAO,MAAM;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,iBAAiB,EAAE,YAAY,QAAQ,UAAU,GAAG,MAAM,GAAG;AAC3E,SAAO,MAAM;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mBAAmB;AAAA,EACjC,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAO,MAAM;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,2 @@
1
+ type,github_handle,full_name,company,email,date,approver
2
+ corporate,Zephod111r,Phillip Hounslow,Plasius LTD,zephod@plasius.co.uk,2025-09-12,Phillip Hounslow (Maintainer)
package/legal/CLA.md ADDED
@@ -0,0 +1,22 @@
1
+ # Contributor License Agreements (CLA)
2
+
3
+ To protect the intellectual property of this project and ensure clarity of rights, all contributors must sign a Contributor License Agreement (CLA) before their first contribution.
4
+
5
+ ## Which CLA should I sign?
6
+
7
+ - **Individual CLA**: If you are contributing personally and not on behalf of an employer, sign the [Individual CLA](INDIVIDUAL_CLA.md).
8
+ - **Corporate CLA**: If you are contributing as part of your work for a company, the company should sign the [Corporate CLA](CORPORATE_CLA.md).
9
+
10
+ ## How to sign
11
+
12
+ 1. Download the appropriate CLA file (Individual or Corporate).
13
+ 2. Fill in the required details, sign, and date it.
14
+ 3. Email a PDF copy of the signed document to **[contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)** with subject: `CLA – Individual` or `CLA – Corporate`.
15
+
16
+ ## Registry
17
+
18
+ All signed CLAs are logged internally in the CLA registry (`CLA-REGISTRY.csv`).
19
+
20
+ ## Questions?
21
+
22
+ If you have any questions about which CLA to sign or how the process works, please email **[contributors@plasius.co.uk](mailtocontributors@plasius.co.uk)**.
@@ -0,0 +1,57 @@
1
+ # Corporate Contributor License Agreement (CLA)
2
+
3
+ ## Purpose
4
+
5
+ This Corporate Contributor License Agreement ("Agreement") is intended to protect the intellectual property rights of the contributors and the project, ensure clear licensing terms for contributions, and maintain trust within the community. By signing this Agreement, the corporation agrees to the terms that facilitate the use, distribution, and modification of contributions under the project's licensing framework.
6
+
7
+ ## Agreement
8
+
9
+ 1. **Representation of Authority**
10
+ The undersigned individual represents and warrants that they have the full legal authority to enter into this Agreement on behalf of the corporation named below ("Corporation") and to grant the rights contained herein.
11
+
12
+ 2. **Grant of Copyright License**
13
+ The Corporation hereby grants to the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free, irrevocable copyright license to use, reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the contributions submitted to the project.
14
+
15
+ 3. **Grant of Patent License**
16
+ The Corporation hereby grants to the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under any patent claims that are necessarily infringed by the contributions to make, use, sell, offer for sale, import, and otherwise dispose of the contributions or derivative works thereof.
17
+
18
+ 4. **Warranties and Representations**
19
+ The Corporation represents and warrants that:
20
+
21
+ - The contributions are the original work of the Corporation or that the Corporation has sufficient rights to grant the licenses herein.
22
+ - The submission of the contributions does not violate any agreements or rights of third parties.
23
+
24
+ 5. **No Revocation**
25
+ This license is granted on a perpetual basis and cannot be revoked, provided that the terms of this Agreement are met.
26
+
27
+ 6. **Governing Law**
28
+ This Agreement shall be governed by and construed in accordance with the laws of the United Kingdom, without regard to its conflict of laws principles.
29
+
30
+ 7. **Execution**
31
+
32
+ This Agreement is effective upon signature by the authorized representative of the Corporation. Please sign and date this document, then email a scanned PDF copy to [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk).
33
+
34
+ ---
35
+
36
+ ### **@plasius/gpu-xr**
37
+
38
+ **Corporation Legal Name:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
39
+
40
+ **Authorized Representative:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
41
+
42
+ **Title:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
43
+
44
+ **Email:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
45
+
46
+ **Date:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
47
+
48
+ **Signature:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
49
+
50
+ ---
51
+
52
+ ## How to Sign
53
+
54
+ - Download this file as a template.
55
+ - Fill in the Corporation’s legal name, authorized representative, title, email, date, and provide a signature.
56
+ - Sign and date the document.
57
+ - Send a scanned copy of the signed Agreement to [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk).
@@ -0,0 +1,91 @@
1
+ # Individual Contributor License Agreement (CLA)
2
+
3
+ **Project:** @plasius/gpu-xr (Plasius LTD)
4
+ **Version:** 1.0 — 2025‑09‑12
5
+ **Contact:** [contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)
6
+
7
+ ---
8
+
9
+ ## 1. Definitions
10
+
11
+ - **"You"** (or **"Contributor"**) means the individual signing this CLA and submitting Contributions to the Project.
12
+ - **"Contribution"** means any original work of authorship, including code, documentation, data, designs, or feedback that You submit to the Project in any form (e.g., pull request, issue comment, email, file upload).
13
+ - **"Project"** means the @plasius/gpu-xr repositories and related materials owned or managed by **Plasius LTD**.
14
+
15
+ ## 2. Copyright License Grant
16
+
17
+ You hereby grant to Plasius LTD a **perpetual, worldwide, non‑exclusive, transferable, sublicensable, royalty‑free, irrevocable** copyright license to:
18
+
19
+ - use, reproduce, publicly display, publicly perform, modify, create derivative works of, and
20
+ - distribute Contributions in source and object form,
21
+ - and to **sublicense** these rights under any terms Plasius LTD chooses, including proprietary or open‑source licenses.
22
+
23
+ ## 3. Patent License Grant
24
+
25
+ You hereby grant to Plasius LTD and its sublicensees a **perpetual, worldwide, non‑exclusive, transferable, royalty‑free, irrevocable** patent license to **make, have made, use, offer to sell, sell, import, and otherwise transfer** the Contribution and derivative works thereof, where such license applies only to patent claims that You **own or control** and that would be infringed by Your Contribution or its combination with the Project.
26
+
27
+ ## 4. Moral Rights & Attribution
28
+
29
+ To the maximum extent permitted by applicable law, You **waive** and agree not to assert any moral rights (e.g., rights of attribution or integrity) in or to the Contribution against Plasius LTD. Plasius LTD may, but is not required to, credit You.
30
+
31
+ ## 5. Representations & Warranties
32
+
33
+ You represent that:
34
+
35
+ 1. **Originality / Rights:** Each Contribution is Your original creation, or You have sufficient rights to submit it and grant the licenses above.
36
+ 2. **No Confidential Info:** Contributions **do not** include confidential information or trade secrets of any third party.
37
+ 3. **No Infringement:** To the best of Your knowledge, Contributions do not infringe any third‑party IP rights.
38
+ 4. **Employment / Contractor Status:** If Your employer or a third party might claim rights in Your Contribution, You have obtained **written permission** to make the Contribution and grant these licenses (attach or reference below), or Your Contribution is made **outside the scope** of your employment and without using your employer’s confidential information or resources.
39
+ 5. **Compliance:** You will follow the Project’s policies (e.g., Code of Conduct, Security Policy) and applicable laws.
40
+
41
+ ## 6. Third‑Party Code
42
+
43
+ If Your Contribution includes code, data, or other material from a third party, You will **identify the material and its license** in the pull request or submission, and ensure it is **compatible** with the Project’s licensing model. You will not submit material subject to terms that require the Project to disclose proprietary source code (e.g., certain copyleft obligations) unless the Project has **pre‑approved** such inclusion in writing.
44
+
45
+ ## 7. Scope & Duration
46
+
47
+ - This CLA covers **all past and future** Contributions You submit to the Project, unless and until You provide written notice to **revoke** it.
48
+ - Revocation is **not retroactive**: rights granted for prior Contributions remain in effect.
49
+
50
+ ## 8. Disclaimer
51
+
52
+ THE CONTRIBUTION IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON‑INFRINGEMENT.
53
+
54
+ ## 9. Governing Law & Jurisdiction
55
+
56
+ This CLA is governed by the **laws of England and Wales**, and the courts of England and Wales shall have **exclusive jurisdiction** over any dispute arising out of or relating to it.
57
+
58
+ ## 10. Entire Agreement
59
+
60
+ This CLA is the entire agreement between You and Plasius LTD regarding Contributions. It supersedes any prior discussions relating to Contributions. If any provision is held unenforceable, the remaining provisions remain in full force.
61
+
62
+ ---
63
+
64
+ ## 11. Contributor Information & Signature
65
+
66
+ By signing below, You agree to the terms of this CLA for Your Contributions to the Project.
67
+
68
+ **Full Name:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
69
+
70
+ **Email:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
71
+
72
+ **GitHub Handle:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
73
+
74
+ **Address (optional):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
75
+
76
+ **Employer (if applicable):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
77
+
78
+ **If employed:** ☐ I confirm Contributions are made outside the scope of employment **or** ☐ I have attached my employer’s written permission.
79
+
80
+ **Signature:** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
81
+
82
+ **Date (YYYY‑MM‑DD):** \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
83
+
84
+ _Electronic signatures are accepted. You may type your name in the Signature field and email a PDF copy._
85
+
86
+ **Submission:** Please email the signed CLA to **[contributors@plasius.co.uk](mailto:contributors@plasius.co.uk)** with subject line: `CLA – Individual – <GitHubHandle>`.
87
+
88
+ **(Optional) Attachments / Notes:**
89
+
90
+ - Employer permission letter (if required)
91
+ - Third‑party license disclosures (if any)
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@plasius/gpu-physics",
3
+ "version": "0.1.0",
4
+ "description": "Physics integration bridge package for Plasius GPU renderer migration.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "private": false,
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./src/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "src",
14
+ "README.md",
15
+ "CHANGELOG.md",
16
+ "LICENSE",
17
+ "legal"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./src/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "require": "./dist/index.cjs"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "demo": "python3 -m http.server --directory ..",
30
+ "test": "npm run test:unit",
31
+ "test:unit": "node --test",
32
+ "test:coverage": "c8 --reporter=lcov --reporter=text node --test"
33
+ },
34
+ "keywords": [
35
+ "physics",
36
+ "rapier",
37
+ "webgpu",
38
+ "gpu",
39
+ "plasius"
40
+ ],
41
+ "author": "Plasius LTD <development@plasius.co.uk>",
42
+ "license": "Apache-2.0",
43
+ "peerDependencies": {
44
+ "react": "^19.1.0"
45
+ },
46
+ "dependencies": {
47
+ "@react-three/rapier": "^2.1.0"
48
+ },
49
+ "devDependencies": {
50
+ "c8": "^10.1.3",
51
+ "react": "^19.1.0",
52
+ "tsup": "^8.5.0",
53
+ "typescript": "^5.9.3"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/Plasius-LTD/gpu-physics.git"
58
+ },
59
+ "bugs": {
60
+ "url": "https://github.com/Plasius-LTD/gpu-physics/issues"
61
+ },
62
+ "homepage": "https://github.com/Plasius-LTD/gpu-physics#readme",
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "funding": [
67
+ {
68
+ "type": "patreon",
69
+ "url": "https://www.patreon.com/c/plasiusltd/membership"
70
+ },
71
+ {
72
+ "type": "github",
73
+ "url": "https://github.com/sponsors/Plasius-LTD"
74
+ }
75
+ ]
76
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { ReactNode, ReactElement } from "react";
2
+
3
+ export type Vec3 = [number, number, number];
4
+
5
+ export const DEFAULT_GRAVITY: Readonly<Vec3>;
6
+
7
+ export interface PhysicsRootProps {
8
+ gravity?: Vec3;
9
+ children?: ReactNode;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ export interface RigidBodyBridgeProps {
14
+ colliders?: string | false;
15
+ children?: ReactNode;
16
+ [key: string]: unknown;
17
+ }
18
+
19
+ export function PhysicsRoot(props: PhysicsRootProps): ReactElement;
20
+ export function StaticRigidBody(props: RigidBodyBridgeProps): ReactElement;
21
+ export function DynamicRigidBody(props: RigidBodyBridgeProps): ReactElement;
22
+ export function KinematicRigidBody(props: RigidBodyBridgeProps): ReactElement;
package/src/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import {
3
+ Physics as RapierPhysics,
4
+ RigidBody as RapierRigidBody,
5
+ } from "@react-three/rapier";
6
+
7
+ export const DEFAULT_GRAVITY = Object.freeze([0, -9.81, 0]);
8
+
9
+ export function PhysicsRoot({ gravity = DEFAULT_GRAVITY, children, ...props }) {
10
+ return React.createElement(RapierPhysics, { gravity, ...props }, children);
11
+ }
12
+
13
+ export function StaticRigidBody({
14
+ colliders = "trimesh",
15
+ children,
16
+ ...props
17
+ }) {
18
+ return React.createElement(
19
+ RapierRigidBody,
20
+ {
21
+ type: "fixed",
22
+ colliders,
23
+ ...props,
24
+ },
25
+ children
26
+ );
27
+ }
28
+
29
+ export function DynamicRigidBody({ colliders = "hull", children, ...props }) {
30
+ return React.createElement(
31
+ RapierRigidBody,
32
+ {
33
+ type: "dynamic",
34
+ colliders,
35
+ ...props,
36
+ },
37
+ children
38
+ );
39
+ }
40
+
41
+ export function KinematicRigidBody({
42
+ colliders = "hull",
43
+ children,
44
+ ...props
45
+ }) {
46
+ return React.createElement(
47
+ RapierRigidBody,
48
+ {
49
+ type: "kinematicPosition",
50
+ colliders,
51
+ ...props,
52
+ },
53
+ children
54
+ );
55
+ }