@khr3/launchers 0.2.9 → 0.3.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/AGENTS.md +3 -3
- package/CLAUDE.md +1 -5
- package/LICENSE +1 -1
- package/README.md +39 -32
- package/dist/KhrLauncher.d.ts +46 -0
- package/dist/KhrLauncher.js +316 -0
- package/dist/KhrLauncher.js.map +1 -0
- package/dist/armory/engine/assemblyVerifier.d.ts +48 -0
- package/dist/armory/engine/assemblyVerifier.js +443 -0
- package/dist/armory/engine/assemblyVerifier.js.map +1 -0
- package/dist/armory/engine/audioSynth.d.ts +26 -0
- package/dist/armory/engine/audioSynth.js +256 -0
- package/dist/armory/engine/audioSynth.js.map +1 -0
- package/dist/armory/engine/ballistics.d.ts +125 -0
- package/dist/armory/engine/ballistics.js +399 -0
- package/dist/armory/engine/ballistics.js.map +1 -0
- package/dist/armory/engine/bvhExploder.d.ts +43 -0
- package/dist/armory/engine/bvhExploder.js +326 -0
- package/dist/armory/engine/bvhExploder.js.map +1 -0
- package/dist/armory/engine/dispose.d.ts +6 -0
- package/dist/armory/engine/dispose.js +54 -0
- package/dist/armory/engine/dispose.js.map +1 -0
- package/dist/armory/engine/glbPhysicsExporter.d.ts +116 -0
- package/dist/armory/engine/glbPhysicsExporter.js +1960 -0
- package/dist/armory/engine/glbPhysicsExporter.js.map +1 -0
- package/dist/armory/engine/jointGraph.d.ts +5 -0
- package/dist/armory/engine/jointGraph.js +50 -0
- package/dist/armory/engine/jointGraph.js.map +1 -0
- package/dist/armory/engine/materials.d.ts +87 -0
- package/dist/armory/engine/materials.js +1089 -0
- package/dist/armory/engine/materials.js.map +1 -0
- package/dist/armory/engine/meshSegmenter.d.ts +44 -0
- package/dist/armory/engine/meshSegmenter.js +527 -0
- package/dist/armory/engine/meshSegmenter.js.map +1 -0
- package/dist/armory/engine/orthoExtruder.d.ts +33 -0
- package/dist/armory/engine/orthoExtruder.js +549 -0
- package/dist/armory/engine/orthoExtruder.js.map +1 -0
- package/dist/armory/engine/parts/boltRifleBuilder.d.ts +16 -0
- package/dist/armory/engine/parts/boltRifleBuilder.js +233 -0
- package/dist/armory/engine/parts/boltRifleBuilder.js.map +1 -0
- package/dist/armory/engine/parts/cadKernel.d.ts +39 -0
- package/dist/armory/engine/parts/cadKernel.js +367 -0
- package/dist/armory/engine/parts/cadKernel.js.map +1 -0
- package/dist/armory/engine/parts/fireControlGroup.d.ts +29 -0
- package/dist/armory/engine/parts/fireControlGroup.js +428 -0
- package/dist/armory/engine/parts/fireControlGroup.js.map +1 -0
- package/dist/armory/engine/parts/magazineBuilder.d.ts +14 -0
- package/dist/armory/engine/parts/magazineBuilder.js +146 -0
- package/dist/armory/engine/parts/magazineBuilder.js.map +1 -0
- package/dist/armory/engine/parts/muzzleDevices.d.ts +8 -0
- package/dist/armory/engine/parts/muzzleDevices.js +72 -0
- package/dist/armory/engine/parts/muzzleDevices.js.map +1 -0
- package/dist/armory/engine/parts/picatinnyRail.d.ts +49 -0
- package/dist/armory/engine/parts/picatinnyRail.js +474 -0
- package/dist/armory/engine/parts/picatinnyRail.js.map +1 -0
- package/dist/armory/engine/parts/pistolVariants.d.ts +28 -0
- package/dist/armory/engine/parts/pistolVariants.js +318 -0
- package/dist/armory/engine/parts/pistolVariants.js.map +1 -0
- package/dist/armory/engine/parts/revolverBuilder.d.ts +49 -0
- package/dist/armory/engine/parts/revolverBuilder.js +475 -0
- package/dist/armory/engine/parts/revolverBuilder.js.map +1 -0
- package/dist/armory/engine/proceduralGeometry.d.ts +113 -0
- package/dist/armory/engine/proceduralGeometry.js +1591 -0
- package/dist/armory/engine/proceduralGeometry.js.map +1 -0
- package/dist/armory/engine/renderState.d.ts +2 -0
- package/dist/armory/engine/renderState.js +20 -0
- package/dist/armory/engine/renderState.js.map +1 -0
- package/dist/armory/engine/simSolver.d.ts +127 -0
- package/dist/armory/engine/simSolver.js +736 -0
- package/dist/armory/engine/simSolver.js.map +1 -0
- package/dist/armory/engine/weaponSpecs.d.ts +277 -0
- package/dist/armory/engine/weaponSpecs.js +1311 -0
- package/dist/armory/engine/weaponSpecs.js.map +1 -0
- package/dist/armory/engine/webglContext.d.ts +1 -0
- package/dist/armory/engine/webglContext.js +14 -0
- package/dist/armory/engine/webglContext.js.map +1 -0
- package/dist/armory/types/physicsSchema.d.ts +205 -0
- package/dist/armory/types/physicsSchema.js +2 -0
- package/dist/armory/types/physicsSchema.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/inertia.d.ts +3 -9
- package/dist/inertia.js +6 -6
- package/dist/inertia.js.map +1 -1
- package/dist/launcherKhr.d.ts +3 -9
- package/dist/launcherKhr.js +3 -15
- package/dist/launcherKhr.js.map +1 -1
- package/dist/launcherParts.d.ts +3 -8
- package/dist/launcherParts.js +19 -39
- package/dist/launcherParts.js.map +1 -1
- package/dist/react.d.ts +3 -0
- package/dist/react.js +4 -0
- package/dist/react.js.map +1 -0
- package/dist/recipes.d.ts +18 -12
- package/dist/recipes.js +103 -2
- package/dist/recipes.js.map +1 -1
- package/dist/runtime.js +3 -2
- package/dist/runtime.js.map +1 -1
- package/dist/schema.d.ts +2 -1
- package/dist/schema.js +18 -0
- package/dist/schema.js.map +1 -1
- package/dist/three.d.ts +54 -0
- package/dist/three.js +58 -0
- package/dist/three.js.map +1 -0
- package/docs/api-reference.md +49 -299
- package/package.json +63 -8
|
@@ -0,0 +1,1311 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Right-handed glTF/Three.js coordinate system (SI meters, 1 unit = 1 meter):
|
|
3
|
+
* +Z = muzzle forward, +Y = up, -X = shooter's right, +X = shooter's left
|
|
4
|
+
*/
|
|
5
|
+
export const WEAPON_ARCHETYPES = {
|
|
6
|
+
pistol: {
|
|
7
|
+
id: 'pistol',
|
|
8
|
+
name: 'Semi-Auto Pistol',
|
|
9
|
+
shortName: 'Semi-Auto Pistol',
|
|
10
|
+
caliberLabel: '9×19mm',
|
|
11
|
+
magCapacity: 15,
|
|
12
|
+
fireRateHz: 9.0,
|
|
13
|
+
manualCycleRequired: false,
|
|
14
|
+
defaultBlowbackImpulse: 5.4,
|
|
15
|
+
railLengthM: 0.072,
|
|
16
|
+
railPos: [0, 0.04, 0.076],
|
|
17
|
+
underRailPos: [0, -0.011, 0.092],
|
|
18
|
+
underRailLengthM: 0.06,
|
|
19
|
+
muzzlePos: [0, 0.022, 0.148],
|
|
20
|
+
joints: [
|
|
21
|
+
{
|
|
22
|
+
id: 'joint_pistol_slide',
|
|
23
|
+
nodeName: 'Slide_Blowback',
|
|
24
|
+
connectedNodeName: 'Receiver',
|
|
25
|
+
semanticRole: 'slide_blowback',
|
|
26
|
+
jointType: 'prismatic',
|
|
27
|
+
axis: [2],
|
|
28
|
+
limits: { min: -0.055, max: 0.0, stiffness: 4200, damping: 120 },
|
|
29
|
+
drive: {
|
|
30
|
+
type: 'linear',
|
|
31
|
+
mode: 'force',
|
|
32
|
+
positionTarget: 0.0,
|
|
33
|
+
velocityTarget: 0.0,
|
|
34
|
+
stiffness: 880,
|
|
35
|
+
damping: 32,
|
|
36
|
+
},
|
|
37
|
+
massKg: 0.34,
|
|
38
|
+
colliderShape: 'box',
|
|
39
|
+
colliderExtents: [0.028, 0.032, 0.19],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'joint_pistol_hammer',
|
|
43
|
+
nodeName: 'Hammer_Revolute',
|
|
44
|
+
connectedNodeName: 'Receiver',
|
|
45
|
+
semanticRole: 'hammer',
|
|
46
|
+
jointType: 'revolute',
|
|
47
|
+
axis: [0],
|
|
48
|
+
limits: { min: 0.0, max: 0.55, stiffness: 600, damping: 18 },
|
|
49
|
+
drive: {
|
|
50
|
+
type: 'angular',
|
|
51
|
+
mode: 'force',
|
|
52
|
+
positionTarget: 0.0,
|
|
53
|
+
velocityTarget: 0.0,
|
|
54
|
+
stiffness: 420,
|
|
55
|
+
damping: 16,
|
|
56
|
+
},
|
|
57
|
+
massKg: 0.04,
|
|
58
|
+
colliderShape: 'box',
|
|
59
|
+
colliderExtents: [0.01, 0.026, 0.02],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'joint_pistol_trigger',
|
|
63
|
+
nodeName: 'Trigger_Revolute',
|
|
64
|
+
connectedNodeName: 'Receiver',
|
|
65
|
+
semanticRole: 'trigger',
|
|
66
|
+
jointType: 'revolute',
|
|
67
|
+
axis: [0],
|
|
68
|
+
limits: { min: 0.0, max: 0.36, stiffness: 500, damping: 14 },
|
|
69
|
+
drive: {
|
|
70
|
+
type: 'angular',
|
|
71
|
+
mode: 'force',
|
|
72
|
+
positionTarget: 0.0,
|
|
73
|
+
velocityTarget: 0.0,
|
|
74
|
+
stiffness: 88,
|
|
75
|
+
damping: 1.9,
|
|
76
|
+
},
|
|
77
|
+
massKg: 0.024,
|
|
78
|
+
colliderShape: 'box',
|
|
79
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'joint_pistol_chamber',
|
|
83
|
+
nodeName: 'Chamber_Breech',
|
|
84
|
+
connectedNodeName: 'Receiver',
|
|
85
|
+
semanticRole: 'chamber_breech',
|
|
86
|
+
jointType: 'prismatic',
|
|
87
|
+
axis: [2],
|
|
88
|
+
limits: { min: -0.016, max: 0.0, stiffness: 1200, damping: 40 },
|
|
89
|
+
drive: {
|
|
90
|
+
type: 'linear',
|
|
91
|
+
mode: 'force',
|
|
92
|
+
positionTarget: 0.0,
|
|
93
|
+
velocityTarget: 0.0,
|
|
94
|
+
stiffness: 600,
|
|
95
|
+
damping: 26,
|
|
96
|
+
},
|
|
97
|
+
massKg: 0.08,
|
|
98
|
+
colliderShape: 'cylinder',
|
|
99
|
+
colliderExtents: [0.012, 0.048, 0.012],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'joint_pistol_mag',
|
|
103
|
+
nodeName: 'Magazine_Well',
|
|
104
|
+
connectedNodeName: 'Receiver',
|
|
105
|
+
semanticRole: 'magazine_well',
|
|
106
|
+
jointType: 'prismatic',
|
|
107
|
+
axis: [1],
|
|
108
|
+
limits: { min: -0.18, max: 0.0, stiffness: 2500, damping: 75 },
|
|
109
|
+
drive: {
|
|
110
|
+
type: 'linear',
|
|
111
|
+
mode: 'force',
|
|
112
|
+
positionTarget: 0.0,
|
|
113
|
+
velocityTarget: 0.0,
|
|
114
|
+
stiffness: 460,
|
|
115
|
+
damping: 28,
|
|
116
|
+
},
|
|
117
|
+
massKg: 0.24,
|
|
118
|
+
colliderShape: 'box',
|
|
119
|
+
colliderExtents: [0.022, 0.115, 0.036],
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
anchors: [
|
|
123
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
124
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [-0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
125
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.018, 0.006, -0.056], parentNode: 'Receiver' },
|
|
126
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [0.016, -0.058, -0.018], parentNode: 'Receiver' },
|
|
127
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.022, 0.158], parentNode: 'Receiver' },
|
|
128
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [-0.018, 0.024, 0.028], parentNode: 'Receiver' },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
revolver: {
|
|
132
|
+
id: 'revolver',
|
|
133
|
+
name: 'Revolver',
|
|
134
|
+
shortName: 'Revolver',
|
|
135
|
+
caliberLabel: '.44 Mag',
|
|
136
|
+
magCapacity: 8,
|
|
137
|
+
fireRateHz: 4.5,
|
|
138
|
+
manualCycleRequired: false,
|
|
139
|
+
defaultBlowbackImpulse: 4.8,
|
|
140
|
+
railLengthM: 0.11,
|
|
141
|
+
railPos: [0, 0.053, 0.062],
|
|
142
|
+
underRailPos: [0, 0.0074, 0.168],
|
|
143
|
+
underRailLengthM: 0.06,
|
|
144
|
+
muzzlePos: [0, 0.0377, 0.252],
|
|
145
|
+
joints: [
|
|
146
|
+
{
|
|
147
|
+
id: 'joint_revolver_cylinder',
|
|
148
|
+
nodeName: 'Slide_Blowback',
|
|
149
|
+
connectedNodeName: 'Chamber_Breech',
|
|
150
|
+
semanticRole: 'slide_blowback',
|
|
151
|
+
jointType: 'revolute',
|
|
152
|
+
axis: [2],
|
|
153
|
+
limits: { min: -6.2832, max: 6.2832, stiffness: 800, damping: 24 },
|
|
154
|
+
drive: {
|
|
155
|
+
type: 'angular',
|
|
156
|
+
mode: 'force',
|
|
157
|
+
positionTarget: 0.0,
|
|
158
|
+
velocityTarget: 0.0,
|
|
159
|
+
stiffness: 440,
|
|
160
|
+
damping: 22,
|
|
161
|
+
},
|
|
162
|
+
massKg: 0.42,
|
|
163
|
+
colliderShape: 'cylinder',
|
|
164
|
+
colliderExtents: [0.0218, 0.056, 0.0218],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'joint_revolver_crane',
|
|
168
|
+
nodeName: 'Chamber_Breech',
|
|
169
|
+
connectedNodeName: 'Receiver',
|
|
170
|
+
semanticRole: 'chamber_breech',
|
|
171
|
+
jointType: 'revolute',
|
|
172
|
+
axis: [2],
|
|
173
|
+
limits: { min: -1.48, max: 0.0, stiffness: 680, damping: 24 },
|
|
174
|
+
drive: {
|
|
175
|
+
type: 'angular',
|
|
176
|
+
mode: 'force',
|
|
177
|
+
positionTarget: 0.0,
|
|
178
|
+
velocityTarget: 0.0,
|
|
179
|
+
stiffness: 310,
|
|
180
|
+
damping: 20,
|
|
181
|
+
},
|
|
182
|
+
massKg: 0.14,
|
|
183
|
+
colliderShape: 'box',
|
|
184
|
+
colliderExtents: [0.016, 0.024, 0.056],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: 'joint_revolver_hammer',
|
|
188
|
+
nodeName: 'Hammer_Revolute',
|
|
189
|
+
connectedNodeName: 'Receiver',
|
|
190
|
+
semanticRole: 'hammer',
|
|
191
|
+
jointType: 'revolute',
|
|
192
|
+
axis: [0],
|
|
193
|
+
limits: { min: 0.0, max: 0.65, stiffness: 640, damping: 18 },
|
|
194
|
+
drive: {
|
|
195
|
+
type: 'angular',
|
|
196
|
+
mode: 'force',
|
|
197
|
+
positionTarget: 0.0,
|
|
198
|
+
velocityTarget: 0.0,
|
|
199
|
+
stiffness: 460,
|
|
200
|
+
damping: 16,
|
|
201
|
+
},
|
|
202
|
+
massKg: 0.05,
|
|
203
|
+
colliderShape: 'box',
|
|
204
|
+
colliderExtents: [0.01, 0.028, 0.022],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 'joint_revolver_trigger',
|
|
208
|
+
nodeName: 'Trigger_Revolute',
|
|
209
|
+
connectedNodeName: 'Receiver',
|
|
210
|
+
semanticRole: 'trigger',
|
|
211
|
+
jointType: 'revolute',
|
|
212
|
+
axis: [0],
|
|
213
|
+
limits: { min: 0.0, max: 0.36, stiffness: 520, damping: 14 },
|
|
214
|
+
drive: {
|
|
215
|
+
type: 'angular',
|
|
216
|
+
mode: 'force',
|
|
217
|
+
positionTarget: 0.0,
|
|
218
|
+
velocityTarget: 0.0,
|
|
219
|
+
stiffness: 88,
|
|
220
|
+
damping: 1.9,
|
|
221
|
+
},
|
|
222
|
+
massKg: 0.024,
|
|
223
|
+
colliderShape: 'box',
|
|
224
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'joint_revolver_speedloader',
|
|
228
|
+
nodeName: 'Magazine_Well',
|
|
229
|
+
connectedNodeName: 'Chamber_Breech',
|
|
230
|
+
semanticRole: 'magazine_well',
|
|
231
|
+
jointType: 'prismatic',
|
|
232
|
+
axis: [2],
|
|
233
|
+
limits: { min: -0.045, max: 0.0, stiffness: 1800, damping: 55 },
|
|
234
|
+
drive: {
|
|
235
|
+
type: 'linear',
|
|
236
|
+
mode: 'force',
|
|
237
|
+
positionTarget: 0.0,
|
|
238
|
+
velocityTarget: 0.0,
|
|
239
|
+
stiffness: 420,
|
|
240
|
+
damping: 26,
|
|
241
|
+
},
|
|
242
|
+
massKg: 0.14,
|
|
243
|
+
colliderShape: 'cylinder',
|
|
244
|
+
colliderExtents: [0.016, 0.038, 0.016],
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
anchors: [
|
|
248
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
249
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
250
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.018, 0.028, -0.038], parentNode: 'Receiver' },
|
|
251
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [-0.016, -0.058, -0.018], parentNode: 'Receiver' },
|
|
252
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.0377, 0.262], parentNode: 'Receiver' },
|
|
253
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [0.036, 0.024, -0.018], parentNode: 'Receiver' },
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
shotgun: {
|
|
257
|
+
id: 'shotgun',
|
|
258
|
+
name: 'Pump Shotgun',
|
|
259
|
+
shortName: 'Pump Shotgun',
|
|
260
|
+
caliberLabel: '12-Gauge',
|
|
261
|
+
magCapacity: 6,
|
|
262
|
+
fireRateHz: 2.2,
|
|
263
|
+
manualCycleRequired: true,
|
|
264
|
+
defaultBlowbackImpulse: 4.0,
|
|
265
|
+
railLengthM: 0.18,
|
|
266
|
+
railPos: [0, 0.045, 0.036],
|
|
267
|
+
underRailPos: [0, -0.0096, 0.455],
|
|
268
|
+
underRailLengthM: 0.06,
|
|
269
|
+
muzzlePos: [0, 0.03, 0.56],
|
|
270
|
+
joints: [
|
|
271
|
+
{
|
|
272
|
+
id: 'joint_shotgun_pump',
|
|
273
|
+
nodeName: 'Pump_Action',
|
|
274
|
+
connectedNodeName: 'Receiver',
|
|
275
|
+
semanticRole: 'pump_action',
|
|
276
|
+
jointType: 'prismatic',
|
|
277
|
+
axis: [2],
|
|
278
|
+
limits: { min: -0.11, max: 0.0, stiffness: 3200, damping: 110 },
|
|
279
|
+
drive: {
|
|
280
|
+
type: 'linear',
|
|
281
|
+
mode: 'force',
|
|
282
|
+
positionTarget: 0.0,
|
|
283
|
+
velocityTarget: 0.0,
|
|
284
|
+
stiffness: 420,
|
|
285
|
+
damping: 34,
|
|
286
|
+
},
|
|
287
|
+
massKg: 0.42,
|
|
288
|
+
colliderShape: 'cylinder',
|
|
289
|
+
colliderExtents: [0.024, 0.17, 0.024],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 'joint_shotgun_bolt',
|
|
293
|
+
nodeName: 'Slide_Blowback',
|
|
294
|
+
connectedNodeName: 'Receiver',
|
|
295
|
+
semanticRole: 'slide_blowback',
|
|
296
|
+
jointType: 'prismatic',
|
|
297
|
+
axis: [2],
|
|
298
|
+
limits: { min: -0.095, max: 0.0, stiffness: 3800, damping: 110 },
|
|
299
|
+
drive: {
|
|
300
|
+
type: 'linear',
|
|
301
|
+
mode: 'force',
|
|
302
|
+
positionTarget: 0.0,
|
|
303
|
+
velocityTarget: 0.0,
|
|
304
|
+
stiffness: 520,
|
|
305
|
+
damping: 32,
|
|
306
|
+
},
|
|
307
|
+
massKg: 0.28,
|
|
308
|
+
colliderShape: 'box',
|
|
309
|
+
colliderExtents: [0.026, 0.028, 0.11],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: 'joint_shotgun_loading_gate',
|
|
313
|
+
nodeName: 'Chamber_Breech',
|
|
314
|
+
connectedNodeName: 'Receiver',
|
|
315
|
+
semanticRole: 'chamber_breech',
|
|
316
|
+
jointType: 'revolute',
|
|
317
|
+
axis: [0],
|
|
318
|
+
limits: { min: 0.0, max: 0.68, stiffness: 480, damping: 20 },
|
|
319
|
+
drive: {
|
|
320
|
+
type: 'angular',
|
|
321
|
+
mode: 'force',
|
|
322
|
+
positionTarget: 0.0,
|
|
323
|
+
velocityTarget: 0.0,
|
|
324
|
+
stiffness: 220,
|
|
325
|
+
damping: 18,
|
|
326
|
+
},
|
|
327
|
+
massKg: 0.035,
|
|
328
|
+
colliderShape: 'box',
|
|
329
|
+
colliderExtents: [0.022, 0.005, 0.068],
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'joint_shotgun_hammer',
|
|
333
|
+
nodeName: 'Hammer_Revolute',
|
|
334
|
+
connectedNodeName: 'Receiver',
|
|
335
|
+
semanticRole: 'hammer',
|
|
336
|
+
jointType: 'revolute',
|
|
337
|
+
axis: [0],
|
|
338
|
+
limits: { min: 0.0, max: 0.62, stiffness: 520, damping: 18 },
|
|
339
|
+
drive: {
|
|
340
|
+
type: 'angular',
|
|
341
|
+
mode: 'force',
|
|
342
|
+
positionTarget: 0.0,
|
|
343
|
+
velocityTarget: 0.0,
|
|
344
|
+
stiffness: 380,
|
|
345
|
+
damping: 16,
|
|
346
|
+
},
|
|
347
|
+
massKg: 0.05,
|
|
348
|
+
colliderShape: 'box',
|
|
349
|
+
colliderExtents: [0.012, 0.032, 0.02],
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: 'joint_shotgun_trigger',
|
|
353
|
+
nodeName: 'Trigger_Revolute',
|
|
354
|
+
connectedNodeName: 'Receiver',
|
|
355
|
+
semanticRole: 'trigger',
|
|
356
|
+
jointType: 'revolute',
|
|
357
|
+
axis: [0],
|
|
358
|
+
limits: { min: 0.0, max: 0.36, stiffness: 480, damping: 14 },
|
|
359
|
+
drive: {
|
|
360
|
+
type: 'angular',
|
|
361
|
+
mode: 'force',
|
|
362
|
+
positionTarget: 0.0,
|
|
363
|
+
velocityTarget: 0.0,
|
|
364
|
+
stiffness: 88,
|
|
365
|
+
damping: 1.9,
|
|
366
|
+
},
|
|
367
|
+
massKg: 0.024,
|
|
368
|
+
colliderShape: 'box',
|
|
369
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: 'joint_shotgun_lifter',
|
|
373
|
+
nodeName: 'Magazine_Well',
|
|
374
|
+
connectedNodeName: 'Receiver',
|
|
375
|
+
semanticRole: 'magazine_well',
|
|
376
|
+
jointType: 'prismatic',
|
|
377
|
+
axis: [1],
|
|
378
|
+
limits: { min: -0.14, max: 0.0, stiffness: 2000, damping: 65 },
|
|
379
|
+
drive: {
|
|
380
|
+
type: 'linear',
|
|
381
|
+
mode: 'force',
|
|
382
|
+
positionTarget: 0.0,
|
|
383
|
+
velocityTarget: 0.0,
|
|
384
|
+
stiffness: 380,
|
|
385
|
+
damping: 26,
|
|
386
|
+
},
|
|
387
|
+
massKg: 0.18,
|
|
388
|
+
colliderShape: 'box',
|
|
389
|
+
colliderExtents: [0.026, 0.04, 0.08],
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
anchors: [
|
|
393
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
394
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [-0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
395
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.018, 0.01, -0.052], parentNode: 'Receiver' },
|
|
396
|
+
{ id: 'IK_Palm_Forend', label: 'Pump Forend', color: '#a855f7', defaultLocalPos: [0, -0.026, 0.0], parentNode: 'Pump_Action' },
|
|
397
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.03, 0.568], parentNode: 'Receiver' },
|
|
398
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [-0.024, 0.022, 0.065], parentNode: 'Receiver' },
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
smg: {
|
|
402
|
+
id: 'smg',
|
|
403
|
+
name: 'Compact SMG',
|
|
404
|
+
shortName: 'Compact SMG',
|
|
405
|
+
caliberLabel: '9×19mm',
|
|
406
|
+
magCapacity: 30,
|
|
407
|
+
fireRateHz: 13.5,
|
|
408
|
+
manualCycleRequired: false,
|
|
409
|
+
defaultBlowbackImpulse: 6.2,
|
|
410
|
+
railLengthM: 0.21,
|
|
411
|
+
railPos: [0, 0.062, 0.058],
|
|
412
|
+
underRailPos: [0, -0.0002, 0.268],
|
|
413
|
+
underRailLengthM: 0.11,
|
|
414
|
+
muzzlePos: [0, 0.024, 0.39],
|
|
415
|
+
joints: [
|
|
416
|
+
{
|
|
417
|
+
id: 'joint_smg_bolt',
|
|
418
|
+
nodeName: 'Slide_Blowback',
|
|
419
|
+
connectedNodeName: 'Receiver',
|
|
420
|
+
semanticRole: 'slide_blowback',
|
|
421
|
+
jointType: 'prismatic',
|
|
422
|
+
axis: [2],
|
|
423
|
+
limits: { min: -0.075, max: 0.0, stiffness: 4600, damping: 130 },
|
|
424
|
+
drive: {
|
|
425
|
+
type: 'linear',
|
|
426
|
+
mode: 'force',
|
|
427
|
+
positionTarget: 0.0,
|
|
428
|
+
velocityTarget: 0.0,
|
|
429
|
+
stiffness: 1120,
|
|
430
|
+
damping: 36,
|
|
431
|
+
},
|
|
432
|
+
massKg: 0.44,
|
|
433
|
+
colliderShape: 'box',
|
|
434
|
+
colliderExtents: [0.028, 0.03, 0.115],
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: 'joint_smg_feed_cover',
|
|
438
|
+
nodeName: 'Chamber_Breech',
|
|
439
|
+
connectedNodeName: 'Receiver',
|
|
440
|
+
semanticRole: 'chamber_breech',
|
|
441
|
+
jointType: 'revolute',
|
|
442
|
+
axis: [0],
|
|
443
|
+
limits: { min: 0.0, max: 0.78, stiffness: 520, damping: 24 },
|
|
444
|
+
drive: {
|
|
445
|
+
type: 'angular',
|
|
446
|
+
mode: 'force',
|
|
447
|
+
positionTarget: 0.0,
|
|
448
|
+
velocityTarget: 0.0,
|
|
449
|
+
stiffness: 220,
|
|
450
|
+
damping: 22,
|
|
451
|
+
},
|
|
452
|
+
massKg: 0.16,
|
|
453
|
+
colliderShape: 'box',
|
|
454
|
+
colliderExtents: [0.042, 0.016, 0.19],
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: 'joint_smg_hammer',
|
|
458
|
+
nodeName: 'Hammer_Revolute',
|
|
459
|
+
connectedNodeName: 'Receiver',
|
|
460
|
+
semanticRole: 'hammer',
|
|
461
|
+
jointType: 'revolute',
|
|
462
|
+
axis: [0],
|
|
463
|
+
limits: { min: 0.0, max: 0.48, stiffness: 540, damping: 16 },
|
|
464
|
+
drive: {
|
|
465
|
+
type: 'angular',
|
|
466
|
+
mode: 'force',
|
|
467
|
+
positionTarget: 0.0,
|
|
468
|
+
velocityTarget: 0.0,
|
|
469
|
+
stiffness: 460,
|
|
470
|
+
damping: 18,
|
|
471
|
+
},
|
|
472
|
+
massKg: 0.04,
|
|
473
|
+
colliderShape: 'box',
|
|
474
|
+
colliderExtents: [0.012, 0.026, 0.02],
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
id: 'joint_smg_trigger',
|
|
478
|
+
nodeName: 'Trigger_Revolute',
|
|
479
|
+
connectedNodeName: 'Receiver',
|
|
480
|
+
semanticRole: 'trigger',
|
|
481
|
+
jointType: 'revolute',
|
|
482
|
+
axis: [0],
|
|
483
|
+
limits: { min: 0.0, max: 0.36, stiffness: 500, damping: 14 },
|
|
484
|
+
drive: {
|
|
485
|
+
type: 'angular',
|
|
486
|
+
mode: 'force',
|
|
487
|
+
positionTarget: 0.0,
|
|
488
|
+
velocityTarget: 0.0,
|
|
489
|
+
stiffness: 88,
|
|
490
|
+
damping: 1.9,
|
|
491
|
+
},
|
|
492
|
+
massKg: 0.024,
|
|
493
|
+
colliderShape: 'box',
|
|
494
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
id: 'joint_smg_mag',
|
|
498
|
+
nodeName: 'Magazine_Well',
|
|
499
|
+
connectedNodeName: 'Receiver',
|
|
500
|
+
semanticRole: 'magazine_well',
|
|
501
|
+
jointType: 'prismatic',
|
|
502
|
+
axis: [1],
|
|
503
|
+
limits: { min: -0.2, max: 0.0, stiffness: 2600, damping: 80 },
|
|
504
|
+
drive: {
|
|
505
|
+
type: 'linear',
|
|
506
|
+
mode: 'force',
|
|
507
|
+
positionTarget: 0.0,
|
|
508
|
+
velocityTarget: 0.0,
|
|
509
|
+
stiffness: 480,
|
|
510
|
+
damping: 28,
|
|
511
|
+
},
|
|
512
|
+
massKg: 0.36,
|
|
513
|
+
colliderShape: 'box',
|
|
514
|
+
colliderExtents: [0.028, 0.185, 0.044],
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
anchors: [
|
|
518
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
519
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [-0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
520
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.022, 0.004, -0.048], parentNode: 'Receiver' },
|
|
521
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [0, -0.012, 0.235], parentNode: 'Receiver' },
|
|
522
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.024, 0.398], parentNode: 'Receiver' },
|
|
523
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [-0.024, 0.026, 0.082], parentNode: 'Receiver' },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
'bolt-rifle': {
|
|
527
|
+
id: 'bolt-rifle',
|
|
528
|
+
name: 'Bolt-Action Rifle',
|
|
529
|
+
shortName: 'Bolt-Action Rifle',
|
|
530
|
+
caliberLabel: '7.62×51mm',
|
|
531
|
+
magCapacity: 5,
|
|
532
|
+
fireRateHz: 1.4,
|
|
533
|
+
manualCycleRequired: true,
|
|
534
|
+
defaultBlowbackImpulse: 4.5,
|
|
535
|
+
railLengthM: 0.17,
|
|
536
|
+
railPos: [0, 0.0405, 0.035],
|
|
537
|
+
underRailPos: [0, -0.002, 0.35],
|
|
538
|
+
underRailLengthM: 0.08,
|
|
539
|
+
muzzlePos: [0, 0.024, 0.68],
|
|
540
|
+
joints: [
|
|
541
|
+
{
|
|
542
|
+
id: 'joint_rifle_bolt',
|
|
543
|
+
nodeName: 'Slide_Blowback',
|
|
544
|
+
connectedNodeName: 'Receiver',
|
|
545
|
+
semanticRole: 'slide_blowback',
|
|
546
|
+
jointType: 'prismatic',
|
|
547
|
+
axis: [2],
|
|
548
|
+
limits: { min: -0.088, max: 0.0, stiffness: 3600, damping: 115 },
|
|
549
|
+
drive: {
|
|
550
|
+
type: 'linear',
|
|
551
|
+
mode: 'force',
|
|
552
|
+
positionTarget: 0.0,
|
|
553
|
+
velocityTarget: 0.0,
|
|
554
|
+
stiffness: 460,
|
|
555
|
+
damping: 30,
|
|
556
|
+
},
|
|
557
|
+
massKg: 0.42,
|
|
558
|
+
colliderShape: 'cylinder',
|
|
559
|
+
colliderExtents: [0.011, 0.16, 0.011],
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
id: 'joint_rifle_hammer',
|
|
563
|
+
nodeName: 'Hammer_Revolute',
|
|
564
|
+
connectedNodeName: 'Receiver',
|
|
565
|
+
semanticRole: 'hammer',
|
|
566
|
+
jointType: 'revolute',
|
|
567
|
+
axis: [0],
|
|
568
|
+
limits: { min: 0.0, max: 0.45, stiffness: 580, damping: 18 },
|
|
569
|
+
drive: {
|
|
570
|
+
type: 'angular',
|
|
571
|
+
mode: 'force',
|
|
572
|
+
positionTarget: 0.0,
|
|
573
|
+
velocityTarget: 0.0,
|
|
574
|
+
stiffness: 420,
|
|
575
|
+
damping: 16,
|
|
576
|
+
},
|
|
577
|
+
massKg: 0.04,
|
|
578
|
+
colliderShape: 'box',
|
|
579
|
+
colliderExtents: [0.01, 0.022, 0.018],
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
id: 'joint_rifle_trigger',
|
|
583
|
+
nodeName: 'Trigger_Revolute',
|
|
584
|
+
connectedNodeName: 'Receiver',
|
|
585
|
+
semanticRole: 'trigger',
|
|
586
|
+
jointType: 'revolute',
|
|
587
|
+
axis: [0],
|
|
588
|
+
limits: { min: 0.0, max: 0.36, stiffness: 520, damping: 14 },
|
|
589
|
+
drive: {
|
|
590
|
+
type: 'angular',
|
|
591
|
+
mode: 'force',
|
|
592
|
+
positionTarget: 0.0,
|
|
593
|
+
velocityTarget: 0.0,
|
|
594
|
+
stiffness: 88,
|
|
595
|
+
damping: 1.9,
|
|
596
|
+
},
|
|
597
|
+
massKg: 0.024,
|
|
598
|
+
colliderShape: 'box',
|
|
599
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
id: 'joint_rifle_mag',
|
|
603
|
+
nodeName: 'Magazine_Well',
|
|
604
|
+
connectedNodeName: 'Receiver',
|
|
605
|
+
semanticRole: 'magazine_well',
|
|
606
|
+
jointType: 'prismatic',
|
|
607
|
+
axis: [1],
|
|
608
|
+
limits: { min: -0.16, max: 0.0, stiffness: 2400, damping: 75 },
|
|
609
|
+
drive: {
|
|
610
|
+
type: 'linear',
|
|
611
|
+
mode: 'force',
|
|
612
|
+
positionTarget: 0.0,
|
|
613
|
+
velocityTarget: 0.0,
|
|
614
|
+
stiffness: 440,
|
|
615
|
+
damping: 26,
|
|
616
|
+
},
|
|
617
|
+
massKg: 0.26,
|
|
618
|
+
colliderShape: 'box',
|
|
619
|
+
colliderExtents: [0.024, 0.088, 0.068],
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
anchors: [
|
|
623
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
624
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [-0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
625
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.022, 0.018, -0.042], parentNode: 'Receiver' },
|
|
626
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [0, -0.012, 0.28], parentNode: 'Receiver' },
|
|
627
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.024, 0.69], parentNode: 'Receiver' },
|
|
628
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [-0.024, 0.028, 0.078], parentNode: 'Receiver' },
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
'rotary-gl': {
|
|
632
|
+
id: 'rotary-gl',
|
|
633
|
+
name: 'Rotary 40mm Launcher',
|
|
634
|
+
shortName: 'Rotary 40mm Launcher',
|
|
635
|
+
caliberLabel: '40mm Round',
|
|
636
|
+
magCapacity: 6,
|
|
637
|
+
fireRateHz: 2.6,
|
|
638
|
+
manualCycleRequired: false,
|
|
639
|
+
defaultBlowbackImpulse: 4.2,
|
|
640
|
+
railLengthM: 0.19,
|
|
641
|
+
railPos: [0, 0.118, 0.135],
|
|
642
|
+
underRailPos: [0, 0.0528, 0.234],
|
|
643
|
+
underRailLengthM: 0.1,
|
|
644
|
+
muzzlePos: [0, 0.087, 0.345],
|
|
645
|
+
joints: [
|
|
646
|
+
{
|
|
647
|
+
id: 'joint_rgl_drum',
|
|
648
|
+
nodeName: 'Slide_Blowback',
|
|
649
|
+
connectedNodeName: 'Chamber_Breech',
|
|
650
|
+
semanticRole: 'slide_blowback',
|
|
651
|
+
jointType: 'revolute',
|
|
652
|
+
axis: [2],
|
|
653
|
+
limits: { min: -6.2832, max: 6.2832, stiffness: 860, damping: 28 },
|
|
654
|
+
drive: {
|
|
655
|
+
type: 'angular',
|
|
656
|
+
mode: 'force',
|
|
657
|
+
positionTarget: 0.0,
|
|
658
|
+
velocityTarget: 0.0,
|
|
659
|
+
stiffness: 380,
|
|
660
|
+
damping: 22,
|
|
661
|
+
},
|
|
662
|
+
massKg: 1.45,
|
|
663
|
+
colliderShape: 'cylinder',
|
|
664
|
+
colliderExtents: [0.056, 0.125, 0.056],
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
id: 'joint_rgl_hinge',
|
|
668
|
+
nodeName: 'Chamber_Breech',
|
|
669
|
+
connectedNodeName: 'Receiver',
|
|
670
|
+
semanticRole: 'chamber_breech',
|
|
671
|
+
jointType: 'revolute',
|
|
672
|
+
axis: [2],
|
|
673
|
+
limits: { min: -1.38, max: 0.0, stiffness: 680, damping: 26 },
|
|
674
|
+
drive: {
|
|
675
|
+
type: 'angular',
|
|
676
|
+
mode: 'force',
|
|
677
|
+
positionTarget: 0.0,
|
|
678
|
+
velocityTarget: 0.0,
|
|
679
|
+
stiffness: 260,
|
|
680
|
+
damping: 20,
|
|
681
|
+
},
|
|
682
|
+
massKg: 0.85,
|
|
683
|
+
colliderShape: 'box',
|
|
684
|
+
colliderExtents: [0.08, 0.1, 0.18],
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
id: 'joint_rgl_hammer',
|
|
688
|
+
nodeName: 'Hammer_Revolute',
|
|
689
|
+
connectedNodeName: 'Receiver',
|
|
690
|
+
semanticRole: 'hammer',
|
|
691
|
+
jointType: 'revolute',
|
|
692
|
+
axis: [0],
|
|
693
|
+
limits: { min: 0.0, max: 0.56, stiffness: 580, damping: 18 },
|
|
694
|
+
drive: {
|
|
695
|
+
type: 'angular',
|
|
696
|
+
mode: 'force',
|
|
697
|
+
positionTarget: 0.0,
|
|
698
|
+
velocityTarget: 0.0,
|
|
699
|
+
stiffness: 420,
|
|
700
|
+
damping: 16,
|
|
701
|
+
},
|
|
702
|
+
massKg: 0.06,
|
|
703
|
+
colliderShape: 'box',
|
|
704
|
+
colliderExtents: [0.014, 0.03, 0.022],
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
id: 'joint_rgl_trigger',
|
|
708
|
+
nodeName: 'Trigger_Revolute',
|
|
709
|
+
connectedNodeName: 'Receiver',
|
|
710
|
+
semanticRole: 'trigger',
|
|
711
|
+
jointType: 'revolute',
|
|
712
|
+
axis: [0],
|
|
713
|
+
limits: { min: 0.0, max: 0.36, stiffness: 520, damping: 14 },
|
|
714
|
+
drive: {
|
|
715
|
+
type: 'angular',
|
|
716
|
+
mode: 'force',
|
|
717
|
+
positionTarget: 0.0,
|
|
718
|
+
velocityTarget: 0.0,
|
|
719
|
+
stiffness: 88,
|
|
720
|
+
damping: 1.9,
|
|
721
|
+
},
|
|
722
|
+
massKg: 0.024,
|
|
723
|
+
colliderShape: 'box',
|
|
724
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
id: 'joint_rgl_canisters',
|
|
728
|
+
nodeName: 'Magazine_Well',
|
|
729
|
+
connectedNodeName: 'Chamber_Breech',
|
|
730
|
+
semanticRole: 'magazine_well',
|
|
731
|
+
jointType: 'prismatic',
|
|
732
|
+
axis: [2],
|
|
733
|
+
limits: { min: -0.085, max: 0.0, stiffness: 1800, damping: 60 },
|
|
734
|
+
drive: {
|
|
735
|
+
type: 'linear',
|
|
736
|
+
mode: 'force',
|
|
737
|
+
positionTarget: 0.0,
|
|
738
|
+
velocityTarget: 0.0,
|
|
739
|
+
stiffness: 380,
|
|
740
|
+
damping: 26,
|
|
741
|
+
},
|
|
742
|
+
massKg: 0.95,
|
|
743
|
+
colliderShape: 'cylinder',
|
|
744
|
+
colliderExtents: [0.048, 0.09, 0.048],
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
anchors: [
|
|
748
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
749
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
750
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [-0.022, 0.008, -0.048], parentNode: 'Receiver' },
|
|
751
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [0, 0.015, 0.245], parentNode: 'Receiver' },
|
|
752
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.087, 0.355], parentNode: 'Receiver' },
|
|
753
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [0.072, 0.056, 0.02], parentNode: 'Receiver' },
|
|
754
|
+
],
|
|
755
|
+
},
|
|
756
|
+
rpg: {
|
|
757
|
+
id: 'rpg',
|
|
758
|
+
name: 'Rocket Launcher',
|
|
759
|
+
shortName: 'Rocket Launcher',
|
|
760
|
+
caliberLabel: '85mm Rocket',
|
|
761
|
+
magCapacity: 1,
|
|
762
|
+
fireRateHz: 1.0,
|
|
763
|
+
manualCycleRequired: false,
|
|
764
|
+
defaultBlowbackImpulse: 3.4,
|
|
765
|
+
railLengthM: 0.14,
|
|
766
|
+
railPos: [0, 0.068, 0.14],
|
|
767
|
+
underRailPos: [0, -0.006, 0.24],
|
|
768
|
+
underRailLengthM: 0.09,
|
|
769
|
+
muzzlePos: [0, 0.028, 0.4],
|
|
770
|
+
joints: [
|
|
771
|
+
{
|
|
772
|
+
id: 'joint_rpg_breech',
|
|
773
|
+
nodeName: 'Chamber_Breech',
|
|
774
|
+
connectedNodeName: 'Receiver',
|
|
775
|
+
semanticRole: 'chamber_breech',
|
|
776
|
+
jointType: 'revolute',
|
|
777
|
+
axis: [0],
|
|
778
|
+
limits: { min: 0.0, max: 0.85, stiffness: 580, damping: 24 },
|
|
779
|
+
drive: {
|
|
780
|
+
type: 'angular',
|
|
781
|
+
mode: 'force',
|
|
782
|
+
positionTarget: 0.0,
|
|
783
|
+
velocityTarget: 0.0,
|
|
784
|
+
stiffness: 210,
|
|
785
|
+
damping: 20,
|
|
786
|
+
},
|
|
787
|
+
massKg: 0.48,
|
|
788
|
+
colliderShape: 'cylinder',
|
|
789
|
+
colliderExtents: [0.036, 0.12, 0.036],
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
id: 'joint_rpg_warhead_track',
|
|
793
|
+
nodeName: 'Magazine_Well',
|
|
794
|
+
connectedNodeName: 'Receiver',
|
|
795
|
+
semanticRole: 'magazine_well',
|
|
796
|
+
jointType: 'prismatic',
|
|
797
|
+
axis: [2],
|
|
798
|
+
limits: { min: -0.05, max: 0.22, stiffness: 1800, damping: 65 },
|
|
799
|
+
drive: {
|
|
800
|
+
type: 'linear',
|
|
801
|
+
mode: 'force',
|
|
802
|
+
positionTarget: 0.0,
|
|
803
|
+
velocityTarget: 0.0,
|
|
804
|
+
stiffness: 340,
|
|
805
|
+
damping: 26,
|
|
806
|
+
},
|
|
807
|
+
massKg: 1.45,
|
|
808
|
+
colliderShape: 'capsule',
|
|
809
|
+
colliderExtents: [0.042, 0.28, 0.042],
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
id: 'joint_rpg_hammer',
|
|
813
|
+
nodeName: 'Hammer_Revolute',
|
|
814
|
+
connectedNodeName: 'Receiver',
|
|
815
|
+
semanticRole: 'hammer',
|
|
816
|
+
jointType: 'revolute',
|
|
817
|
+
axis: [0],
|
|
818
|
+
limits: { min: 0.0, max: 0.52, stiffness: 520, damping: 18 },
|
|
819
|
+
drive: {
|
|
820
|
+
type: 'angular',
|
|
821
|
+
mode: 'force',
|
|
822
|
+
positionTarget: 0.0,
|
|
823
|
+
velocityTarget: 0.0,
|
|
824
|
+
stiffness: 390,
|
|
825
|
+
damping: 16,
|
|
826
|
+
},
|
|
827
|
+
massKg: 0.06,
|
|
828
|
+
colliderShape: 'box',
|
|
829
|
+
colliderExtents: [0.014, 0.03, 0.02],
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
id: 'joint_rpg_trigger',
|
|
833
|
+
nodeName: 'Trigger_Revolute',
|
|
834
|
+
connectedNodeName: 'Receiver',
|
|
835
|
+
semanticRole: 'trigger',
|
|
836
|
+
jointType: 'revolute',
|
|
837
|
+
axis: [0],
|
|
838
|
+
limits: { min: 0.0, max: 0.36, stiffness: 480, damping: 14 },
|
|
839
|
+
drive: {
|
|
840
|
+
type: 'angular',
|
|
841
|
+
mode: 'force',
|
|
842
|
+
positionTarget: 0.0,
|
|
843
|
+
velocityTarget: 0.0,
|
|
844
|
+
stiffness: 88,
|
|
845
|
+
damping: 1.9,
|
|
846
|
+
},
|
|
847
|
+
massKg: 0.024,
|
|
848
|
+
colliderShape: 'box',
|
|
849
|
+
colliderExtents: [0.009, 0.028, 0.014],
|
|
850
|
+
},
|
|
851
|
+
],
|
|
852
|
+
anchors: [
|
|
853
|
+
{ id: 'IK_Palm_Primary', label: 'Primary Palm', color: '#38bdf8', defaultLocalPos: [0, -0.068, -0.052], parentNode: 'Receiver' },
|
|
854
|
+
{ id: 'IK_Index_Trigger', label: 'Trigger Index', color: '#f43f5e', defaultLocalPos: [-0.008, -0.016, 0.004], parentNode: 'Trigger_Revolute' },
|
|
855
|
+
{ id: 'IK_Thumb_Safety', label: 'Thumb Safety', color: '#f59e0b', defaultLocalPos: [0.018, 0.006, -0.05], parentNode: 'Receiver' },
|
|
856
|
+
{ id: 'IK_Palm_Forend', label: 'Forend Support', color: '#a855f7', defaultLocalPos: [0, -0.042, 0.14], parentNode: 'Receiver' },
|
|
857
|
+
{ id: 'Socket_Muzzle', label: 'Muzzle Socket', color: '#22c55e', defaultLocalPos: [0, 0.028, 0.42], parentNode: 'Receiver' },
|
|
858
|
+
{ id: 'Socket_Eject', label: 'Ejection Port', color: '#eab308', defaultLocalPos: [0, 0.028, -0.45], parentNode: 'Receiver' },
|
|
859
|
+
],
|
|
860
|
+
},
|
|
861
|
+
};
|
|
862
|
+
/**
|
|
863
|
+
* Brandless modular catalog sharing a standard FCU and 21.2mm rail geometry.
|
|
864
|
+
*/
|
|
865
|
+
export const WEAPON_CATALOG = [
|
|
866
|
+
// Sidearms
|
|
867
|
+
{
|
|
868
|
+
id: 'pistol-service',
|
|
869
|
+
category: 'handguns',
|
|
870
|
+
categoryLabel: 'Sidearms',
|
|
871
|
+
name: 'Service Pistol',
|
|
872
|
+
caliber: '9×19mm · 15rd',
|
|
873
|
+
archetypeId: 'pistol',
|
|
874
|
+
loadoutPatch: { pistolChassis: 'service-9', magazine: 'standard', optic: 'red-dot', muzzle: 'compensator' },
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
id: 'pistol-subcompact',
|
|
878
|
+
category: 'handguns',
|
|
879
|
+
categoryLabel: 'Sidearms',
|
|
880
|
+
name: 'Compact Pistol',
|
|
881
|
+
caliber: '9×19mm · 10rd',
|
|
882
|
+
archetypeId: 'pistol',
|
|
883
|
+
loadoutPatch: { pistolChassis: 'subcompact-snub', magazine: 'standard', optic: 'iron', muzzle: 'standard' },
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
id: 'pistol-handcannon',
|
|
887
|
+
category: 'handguns',
|
|
888
|
+
categoryLabel: 'Sidearms',
|
|
889
|
+
name: 'Heavy Pistol',
|
|
890
|
+
caliber: '.50 · 8rd',
|
|
891
|
+
archetypeId: 'pistol',
|
|
892
|
+
loadoutPatch: { pistolChassis: 'heavy-handcannon', magazine: 'standard', optic: 'red-dot', muzzle: 'standard' },
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
id: 'revolver-snub',
|
|
896
|
+
category: 'handguns',
|
|
897
|
+
categoryLabel: 'Sidearms',
|
|
898
|
+
name: 'Snub Revolver',
|
|
899
|
+
caliber: '.38/.357 · 6-Cyl',
|
|
900
|
+
archetypeId: 'revolver',
|
|
901
|
+
loadoutPatch: { revolverChassis: 'snub-nose', optic: 'iron', muzzle: 'standard', underbarrel: 'none' },
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
id: 'revolver-magnum',
|
|
905
|
+
category: 'handguns',
|
|
906
|
+
categoryLabel: 'Sidearms',
|
|
907
|
+
name: 'Long Revolver',
|
|
908
|
+
caliber: '.44 Mag · 8-Cyl',
|
|
909
|
+
archetypeId: 'revolver',
|
|
910
|
+
loadoutPatch: { revolverChassis: 'magnum-long', optic: 'red-dot', muzzle: 'standard', underbarrel: 'laser-lam', laserActive: true },
|
|
911
|
+
},
|
|
912
|
+
// Compact / SMG
|
|
913
|
+
{
|
|
914
|
+
id: 'smg-roller',
|
|
915
|
+
category: 'smgs',
|
|
916
|
+
categoryLabel: 'Compact / SMG',
|
|
917
|
+
name: 'Compact SMG',
|
|
918
|
+
caliber: '9×19mm · 30rd',
|
|
919
|
+
archetypeId: 'smg',
|
|
920
|
+
loadoutPatch: { smgChassis: 'mp5-roller', magazine: 'standard', optic: 'holographic', muzzle: 'suppressor' },
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
id: 'smg-machine-pistol',
|
|
924
|
+
category: 'smgs',
|
|
925
|
+
categoryLabel: 'Compact / SMG',
|
|
926
|
+
name: 'Machine Pistol',
|
|
927
|
+
caliber: '9×19mm · 30rd',
|
|
928
|
+
archetypeId: 'smg',
|
|
929
|
+
loadoutPatch: { smgChassis: 'mac-ingram', magazine: 'extended', optic: 'red-dot', muzzle: 'suppressor' },
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
id: 'smg-drum-mobster',
|
|
933
|
+
category: 'smgs',
|
|
934
|
+
categoryLabel: 'Compact / SMG',
|
|
935
|
+
name: 'Drum SMG',
|
|
936
|
+
caliber: '.45 ACP · 50rd Drum',
|
|
937
|
+
archetypeId: 'smg',
|
|
938
|
+
loadoutPatch: { smgChassis: 'thompson-1928', magazine: 'drum', optic: 'iron', muzzle: 'compensator' },
|
|
939
|
+
},
|
|
940
|
+
// Rifles & Shotguns
|
|
941
|
+
{
|
|
942
|
+
id: 'rifle-bolt-field',
|
|
943
|
+
category: 'rifles',
|
|
944
|
+
categoryLabel: 'Rifles & Shotguns',
|
|
945
|
+
name: 'Field Bolt Rifle',
|
|
946
|
+
caliber: '7.62×51mm · 5/8rd',
|
|
947
|
+
archetypeId: 'bolt-rifle',
|
|
948
|
+
loadoutPatch: { rifleChassis: 'field-walnut', magazine: 'standard', optic: 'zoom-scope', scopeZoom: 8, muzzle: 'standard' },
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
id: 'rifle-bolt-precision',
|
|
952
|
+
category: 'rifles',
|
|
953
|
+
categoryLabel: 'Rifles & Shotguns',
|
|
954
|
+
name: 'Marksman Rifle',
|
|
955
|
+
caliber: '7.62×51mm · 8rd',
|
|
956
|
+
archetypeId: 'bolt-rifle',
|
|
957
|
+
loadoutPatch: { rifleChassis: 'precision-marksman', magazine: 'extended', optic: 'thermal-ir', muzzle: 'suppressor', underbarrel: 'laser-lam', laserActive: true },
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
id: 'shotgun-trench',
|
|
961
|
+
category: 'rifles',
|
|
962
|
+
categoryLabel: 'Rifles & Shotguns',
|
|
963
|
+
name: 'Pump Shotgun',
|
|
964
|
+
caliber: '12-Gauge · 6rd',
|
|
965
|
+
archetypeId: 'shotgun',
|
|
966
|
+
loadoutPatch: { optic: 'red-dot', muzzle: 'standard', underbarrel: 'laser-lam', laserActive: true },
|
|
967
|
+
},
|
|
968
|
+
// Launchers
|
|
969
|
+
{
|
|
970
|
+
id: 'launcher-rotary-gl',
|
|
971
|
+
category: 'launchers',
|
|
972
|
+
categoryLabel: 'Launchers',
|
|
973
|
+
name: 'Rotary 40mm Launcher',
|
|
974
|
+
caliber: '40mm · 6-Cyl',
|
|
975
|
+
archetypeId: 'rotary-gl',
|
|
976
|
+
loadoutPatch: { optic: 'holographic', underbarrel: 'vertical-grip', muzzle: 'standard' },
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
id: 'launcher-rpg',
|
|
980
|
+
category: 'launchers',
|
|
981
|
+
categoryLabel: 'Launchers',
|
|
982
|
+
name: 'Rocket Launcher',
|
|
983
|
+
caliber: '85mm Rocket · 1rd',
|
|
984
|
+
archetypeId: 'rpg',
|
|
985
|
+
loadoutPatch: { optic: 'iron', underbarrel: 'none' },
|
|
986
|
+
},
|
|
987
|
+
];
|
|
988
|
+
export function resolveActivePresetLabel(archetypeId, loadout) {
|
|
989
|
+
if (archetypeId === 'pistol') {
|
|
990
|
+
if (loadout.pistolChassis === 'subcompact-snub')
|
|
991
|
+
return 'Compact Pistol';
|
|
992
|
+
if (loadout.pistolChassis === 'heavy-handcannon')
|
|
993
|
+
return 'Heavy Pistol';
|
|
994
|
+
return 'Service Pistol';
|
|
995
|
+
}
|
|
996
|
+
if (archetypeId === 'revolver') {
|
|
997
|
+
return loadout.revolverChassis === 'snub-nose' ? 'Snub Revolver' : 'Long Revolver';
|
|
998
|
+
}
|
|
999
|
+
if (archetypeId === 'smg') {
|
|
1000
|
+
if (loadout.smgChassis === 'mac-ingram')
|
|
1001
|
+
return 'Machine Pistol';
|
|
1002
|
+
if (loadout.smgChassis === 'thompson-1928')
|
|
1003
|
+
return 'Drum SMG';
|
|
1004
|
+
return 'Compact SMG';
|
|
1005
|
+
}
|
|
1006
|
+
if (archetypeId === 'bolt-rifle') {
|
|
1007
|
+
return loadout.rifleChassis === 'precision-marksman' ? 'Marksman Rifle' : 'Field Bolt Rifle';
|
|
1008
|
+
}
|
|
1009
|
+
if (archetypeId === 'rotary-gl')
|
|
1010
|
+
return 'Rotary 40mm Launcher';
|
|
1011
|
+
return WEAPON_ARCHETYPES[archetypeId].shortName;
|
|
1012
|
+
}
|
|
1013
|
+
export const DEFAULT_LOADOUT = {
|
|
1014
|
+
finish: 'parkerized',
|
|
1015
|
+
pistolChassis: 'service-9',
|
|
1016
|
+
revolverChassis: 'magnum-long',
|
|
1017
|
+
smgChassis: 'mp5-roller',
|
|
1018
|
+
rifleChassis: 'field-walnut',
|
|
1019
|
+
optic: 'red-dot',
|
|
1020
|
+
opticRailSlot: 0,
|
|
1021
|
+
scopeZoom: 8,
|
|
1022
|
+
thermalPalette: 'ironbow',
|
|
1023
|
+
muzzle: 'compensator',
|
|
1024
|
+
underbarrel: 'laser-lam',
|
|
1025
|
+
laserActive: true,
|
|
1026
|
+
magazine: 'standard',
|
|
1027
|
+
gripStyle: 'ergo-stippled',
|
|
1028
|
+
gripRakeDeg: 11,
|
|
1029
|
+
ammoType: 'tracer',
|
|
1030
|
+
shotgunLoad: 'slug',
|
|
1031
|
+
zeroDistanceM: 50,
|
|
1032
|
+
zeroElevationMoa: 0,
|
|
1033
|
+
zeroWindageMoa: 0,
|
|
1034
|
+
precisionSightIn: true,
|
|
1035
|
+
};
|
|
1036
|
+
export const DEFAULT_AMMO_CRAFTER = {
|
|
1037
|
+
payload: 'parabellum-9mm',
|
|
1038
|
+
radialSides: 20,
|
|
1039
|
+
caliberScale: 1.0,
|
|
1040
|
+
lengthScale: 1.0,
|
|
1041
|
+
};
|
|
1042
|
+
export const IMPORTED_ROLE_SPECS = [
|
|
1043
|
+
{ id: 'receiver_body', shortLabel: 'Receiver', canonicalNodeName: 'Receiver', isDynamicJoint: false, defaultMassKg: 0.65 },
|
|
1044
|
+
{ id: 'slide_bolt', shortLabel: 'Slide / Bolt', canonicalNodeName: 'Slide_Blowback', isDynamicJoint: true, defaultMassKg: 0.34 },
|
|
1045
|
+
{ id: 'pump_forend', shortLabel: 'Pump', canonicalNodeName: 'Pump_Action', isDynamicJoint: true, defaultMassKg: 0.38 },
|
|
1046
|
+
{ id: 'trigger', shortLabel: 'Trigger', canonicalNodeName: 'Trigger_Revolute', isDynamicJoint: true, defaultMassKg: 0.024 },
|
|
1047
|
+
{ id: 'magazine', shortLabel: 'Magazine', canonicalNodeName: 'Magazine_Well', isDynamicJoint: true, defaultMassKg: 0.24 },
|
|
1048
|
+
{ id: 'hinged_door', shortLabel: 'Door / Hatch', canonicalNodeName: 'Door_Hinged', isDynamicJoint: true, defaultMassKg: 0.022 },
|
|
1049
|
+
{ id: 'wheel_shapecast', shortLabel: 'Wheel (ShapeCast)', canonicalNodeName: 'Wheel_ShapeCast', isDynamicJoint: true, defaultMassKg: 12.0 },
|
|
1050
|
+
{ id: 'bottom_rail', shortLabel: 'Bottom Rail', canonicalNodeName: 'Mount_BottomRail', isDynamicJoint: false, defaultMassKg: 0.045 },
|
|
1051
|
+
{ id: 'top_rail', shortLabel: 'Top Rail', canonicalNodeName: 'Mount_TopOptic', isDynamicJoint: false, defaultMassKg: 0.055 },
|
|
1052
|
+
{ id: 'muzzle', shortLabel: 'Muzzle / Socket', canonicalNodeName: 'Mount_Muzzle', isDynamicJoint: false, defaultMassKg: 0.06 },
|
|
1053
|
+
{ id: 'grip', shortLabel: 'Grip / Handle', canonicalNodeName: 'Standard_GripAssembly', isDynamicJoint: false, defaultMassKg: 0.14 },
|
|
1054
|
+
{ id: 'barrel', shortLabel: 'Barrel / Static', canonicalNodeName: 'Part_Static', isDynamicJoint: false, defaultMassKg: 0.18 },
|
|
1055
|
+
];
|
|
1056
|
+
export const DEFAULT_TUNING = {
|
|
1057
|
+
stiffnessScale: 1.0,
|
|
1058
|
+
dampingScale: 1.0,
|
|
1059
|
+
blowbackImpulse: 5.4,
|
|
1060
|
+
timeScale: 1.0,
|
|
1061
|
+
simPaused: false,
|
|
1062
|
+
xrayReceiver: false,
|
|
1063
|
+
showIkAnchors: false,
|
|
1064
|
+
uvInspectMode: 'pbr',
|
|
1065
|
+
showBvhBounds: false,
|
|
1066
|
+
bvhDepth: 4,
|
|
1067
|
+
explodeMode: 'assembly',
|
|
1068
|
+
explodeAmount: 0,
|
|
1069
|
+
ammoRadialSides: 20,
|
|
1070
|
+
};
|
|
1071
|
+
export function getAllArchetypeJoints(archetypeId, _loadout) {
|
|
1072
|
+
const cfg = WEAPON_ARCHETYPES[archetypeId];
|
|
1073
|
+
const fcgJoints = [
|
|
1074
|
+
{
|
|
1075
|
+
id: `joint_${archetypeId}_trigger_bar`,
|
|
1076
|
+
nodeName: 'Trigger_TransferBar',
|
|
1077
|
+
connectedNodeName: 'Receiver',
|
|
1078
|
+
semanticRole: 'trigger_bar',
|
|
1079
|
+
jointType: 'prismatic',
|
|
1080
|
+
axis: [2],
|
|
1081
|
+
limits: { min: -0.007, max: 0.0, stiffness: 800, damping: 24 },
|
|
1082
|
+
drive: {
|
|
1083
|
+
type: 'linear',
|
|
1084
|
+
mode: 'force',
|
|
1085
|
+
positionTarget: 0.0,
|
|
1086
|
+
velocityTarget: 0.0,
|
|
1087
|
+
stiffness: 120,
|
|
1088
|
+
damping: 2.2,
|
|
1089
|
+
},
|
|
1090
|
+
massKg: 0.018,
|
|
1091
|
+
colliderShape: 'box',
|
|
1092
|
+
colliderExtents: [0.003, 0.008, 0.068],
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
id: `joint_${archetypeId}_sear`,
|
|
1096
|
+
nodeName: 'Sear_Revolute',
|
|
1097
|
+
connectedNodeName: 'Receiver',
|
|
1098
|
+
semanticRole: 'sear',
|
|
1099
|
+
jointType: 'revolute',
|
|
1100
|
+
axis: [0],
|
|
1101
|
+
limits: { min: -0.32, max: 0.0, stiffness: 650, damping: 18 },
|
|
1102
|
+
drive: {
|
|
1103
|
+
type: 'angular',
|
|
1104
|
+
mode: 'force',
|
|
1105
|
+
positionTarget: 0.0,
|
|
1106
|
+
velocityTarget: 0.0,
|
|
1107
|
+
stiffness: 110,
|
|
1108
|
+
damping: 1.8,
|
|
1109
|
+
},
|
|
1110
|
+
massKg: 0.014,
|
|
1111
|
+
colliderShape: 'box',
|
|
1112
|
+
colliderExtents: [0.008, 0.012, 0.014],
|
|
1113
|
+
},
|
|
1114
|
+
];
|
|
1115
|
+
return [...cfg.joints, ...fcgJoints];
|
|
1116
|
+
}
|
|
1117
|
+
export function computePrincipalInertiaDiagonal(massKg, extents) {
|
|
1118
|
+
const [sx, sy, sz] = extents;
|
|
1119
|
+
const k = massKg / 12;
|
|
1120
|
+
return [
|
|
1121
|
+
Number(Math.max(1e-6, k * (sy * sy + sz * sz)).toFixed(6)),
|
|
1122
|
+
Number(Math.max(1e-6, k * (sx * sx + sz * sz)).toFixed(6)),
|
|
1123
|
+
Number(Math.max(1e-6, k * (sx * sx + sy * sy)).toFixed(6)),
|
|
1124
|
+
];
|
|
1125
|
+
}
|
|
1126
|
+
export const RECEIVER_COLLIDER_SPECS = {
|
|
1127
|
+
pistol: { massKg: 0.42, size: [0.032, 0.145, 0.22] },
|
|
1128
|
+
revolver: { massKg: 0.92, size: [0.038, 0.145, 0.29] },
|
|
1129
|
+
shotgun: { massKg: 2.45, size: [0.044, 0.16, 0.85] },
|
|
1130
|
+
smg: { massKg: 1.85, size: [0.042, 0.18, 0.65] },
|
|
1131
|
+
'bolt-rifle': { massKg: 3.15, size: [0.046, 0.165, 1.02] },
|
|
1132
|
+
'rotary-gl': { massKg: 4.8, size: [0.12, 0.24, 0.72] },
|
|
1133
|
+
rpg: { massKg: 4.1, size: [0.095, 0.19, 0.85] },
|
|
1134
|
+
};
|
|
1135
|
+
export function buildKhr6DofJoint(params) {
|
|
1136
|
+
const { isLinear, activeAxis, freeSpin } = params;
|
|
1137
|
+
const otherTwo = [0, 1, 2].filter((ax) => ax !== activeAxis);
|
|
1138
|
+
const activeLimit = freeSpin
|
|
1139
|
+
? null
|
|
1140
|
+
: isLinear
|
|
1141
|
+
? {
|
|
1142
|
+
linearAxes: [activeAxis],
|
|
1143
|
+
min: params.min,
|
|
1144
|
+
max: params.max,
|
|
1145
|
+
stiffness: params.limitStiffness,
|
|
1146
|
+
damping: params.limitDamping,
|
|
1147
|
+
}
|
|
1148
|
+
: {
|
|
1149
|
+
angularAxes: [activeAxis],
|
|
1150
|
+
min: params.min,
|
|
1151
|
+
max: params.max,
|
|
1152
|
+
stiffness: params.limitStiffness,
|
|
1153
|
+
damping: params.limitDamping,
|
|
1154
|
+
};
|
|
1155
|
+
const limits = isLinear
|
|
1156
|
+
? [
|
|
1157
|
+
...(activeLimit ? [activeLimit] : []),
|
|
1158
|
+
{ linearAxes: otherTwo, min: 0, max: 0 },
|
|
1159
|
+
{ angularAxes: [0, 1, 2], min: 0, max: 0 },
|
|
1160
|
+
]
|
|
1161
|
+
: [
|
|
1162
|
+
{ linearAxes: [0, 1, 2], min: 0, max: 0 },
|
|
1163
|
+
...(activeLimit ? [activeLimit] : []),
|
|
1164
|
+
{ angularAxes: otherTwo, min: 0, max: 0 },
|
|
1165
|
+
];
|
|
1166
|
+
return {
|
|
1167
|
+
limits,
|
|
1168
|
+
drives: freeSpin
|
|
1169
|
+
? []
|
|
1170
|
+
: [
|
|
1171
|
+
{
|
|
1172
|
+
type: isLinear ? 'linear' : 'angular',
|
|
1173
|
+
mode: 'force',
|
|
1174
|
+
axis: activeAxis,
|
|
1175
|
+
positionTarget: params.positionTarget ?? 0,
|
|
1176
|
+
velocityTarget: params.velocityTarget ?? 0,
|
|
1177
|
+
stiffness: params.driveStiffness,
|
|
1178
|
+
damping: params.driveDamping,
|
|
1179
|
+
},
|
|
1180
|
+
],
|
|
1181
|
+
...(params.extras ? { extras: params.extras } : {}),
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
export function buildKhrPhysicsManifest(archetypeId, tuning, ikOffsets, loadout, partOffsets, customCadPart, forwardAxis = '+Z', partScales) {
|
|
1185
|
+
const cfg = WEAPON_ARCHETYPES[archetypeId];
|
|
1186
|
+
const allJoints = getAllArchetypeJoints(archetypeId, loadout);
|
|
1187
|
+
const recSpec = RECEIVER_COLLIDER_SPECS[archetypeId];
|
|
1188
|
+
const shapes = [
|
|
1189
|
+
...allJoints.map((j) => {
|
|
1190
|
+
if (j.colliderShape === 'cylinder') {
|
|
1191
|
+
return {
|
|
1192
|
+
type: 'cylinder',
|
|
1193
|
+
cylinder: {
|
|
1194
|
+
height: Number(j.colliderExtents[1].toFixed(4)),
|
|
1195
|
+
radiusTop: Number(j.colliderExtents[0].toFixed(4)),
|
|
1196
|
+
radiusBottom: Number(j.colliderExtents[0].toFixed(4)),
|
|
1197
|
+
},
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
if (j.colliderShape === 'capsule') {
|
|
1201
|
+
return {
|
|
1202
|
+
type: 'capsule',
|
|
1203
|
+
capsule: {
|
|
1204
|
+
height: Number(j.colliderExtents[1].toFixed(4)),
|
|
1205
|
+
radiusTop: Number(j.colliderExtents[0].toFixed(4)),
|
|
1206
|
+
radiusBottom: Number(j.colliderExtents[0].toFixed(4)),
|
|
1207
|
+
},
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
return {
|
|
1211
|
+
type: 'box',
|
|
1212
|
+
box: {
|
|
1213
|
+
size: j.colliderExtents.map((v) => Number(v.toFixed(4))),
|
|
1214
|
+
},
|
|
1215
|
+
};
|
|
1216
|
+
}),
|
|
1217
|
+
{
|
|
1218
|
+
type: 'box',
|
|
1219
|
+
box: {
|
|
1220
|
+
size: recSpec.size,
|
|
1221
|
+
},
|
|
1222
|
+
},
|
|
1223
|
+
];
|
|
1224
|
+
const physicsJoints = allJoints.map((j) => buildKhr6DofJoint({
|
|
1225
|
+
isLinear: j.jointType === 'prismatic',
|
|
1226
|
+
activeAxis: j.axis[0],
|
|
1227
|
+
min: j.limits.min,
|
|
1228
|
+
max: j.limits.max,
|
|
1229
|
+
limitStiffness: Number((j.limits.stiffness * tuning.stiffnessScale).toFixed(2)),
|
|
1230
|
+
limitDamping: Number((j.limits.damping * tuning.dampingScale).toFixed(2)),
|
|
1231
|
+
driveStiffness: Number((j.drive.stiffness * tuning.stiffnessScale).toFixed(2)),
|
|
1232
|
+
driveDamping: Number((j.drive.damping * tuning.dampingScale).toFixed(2)),
|
|
1233
|
+
positionTarget: j.drive.positionTarget,
|
|
1234
|
+
velocityTarget: j.drive.velocityTarget,
|
|
1235
|
+
extras: {
|
|
1236
|
+
weaponRole: j.semanticRole,
|
|
1237
|
+
nodeName: j.nodeName,
|
|
1238
|
+
connectedNodeName: j.connectedNodeName,
|
|
1239
|
+
},
|
|
1240
|
+
}));
|
|
1241
|
+
const anchors = cfg.anchors.map((a) => ({
|
|
1242
|
+
node: a.id,
|
|
1243
|
+
parentNode: a.parentNode,
|
|
1244
|
+
translation: ikOffsets?.[a.id] ?? a.defaultLocalPos,
|
|
1245
|
+
}));
|
|
1246
|
+
return {
|
|
1247
|
+
asset: {
|
|
1248
|
+
generator: 'khr-armory (Three.js / R3F)',
|
|
1249
|
+
version: '2.0',
|
|
1250
|
+
extras: {
|
|
1251
|
+
coordinateConvention: forwardAxis === '-Z'
|
|
1252
|
+
? '-Z_forward_+Y_up_+X_right_SI_meters_Godot_Blender_Unity'
|
|
1253
|
+
: '+Z_forward_+Y_up_+X_right_SI_meters_glTF_ThreeJS',
|
|
1254
|
+
},
|
|
1255
|
+
},
|
|
1256
|
+
extensionsUsed: ['KHR_physics_rigid_bodies', 'KHR_implicit_shapes'],
|
|
1257
|
+
extensions: {
|
|
1258
|
+
KHR_implicit_shapes: { shapes },
|
|
1259
|
+
KHR_physics_rigid_bodies: {
|
|
1260
|
+
physicsMaterials: [
|
|
1261
|
+
{ name: 'MachinedSteel_4140', staticFriction: 0.42, dynamicFriction: 0.28, restitution: 0.22 },
|
|
1262
|
+
{ name: 'CartridgeBrass_C260', staticFriction: 0.36, dynamicFriction: 0.24, restitution: 0.46 },
|
|
1263
|
+
{ name: 'ReinforcedPolymer', staticFriction: 0.65, dynamicFriction: 0.5, restitution: 0.14 },
|
|
1264
|
+
],
|
|
1265
|
+
collisionFilters: [
|
|
1266
|
+
{ name: 'WeaponInternalMechanism', collisionSystems: ['weapon_rig'], notCollideWithSystems: ['weapon_rig'] },
|
|
1267
|
+
{ name: 'EjectedDebris', collisionSystems: ['casings_and_mags'], collideWithSystems: ['world_static'] },
|
|
1268
|
+
],
|
|
1269
|
+
physicsJoints,
|
|
1270
|
+
},
|
|
1271
|
+
},
|
|
1272
|
+
modularLoadout: loadout ?? DEFAULT_LOADOUT,
|
|
1273
|
+
extras: {
|
|
1274
|
+
userPartOffsets: partOffsets ?? {},
|
|
1275
|
+
userPartScales: partScales ?? {},
|
|
1276
|
+
customCadSketch2D: customCadPart ?? null,
|
|
1277
|
+
},
|
|
1278
|
+
nodeRoles: {
|
|
1279
|
+
Receiver: {
|
|
1280
|
+
extras: { weaponRole: 'receiver_root' },
|
|
1281
|
+
motion: {
|
|
1282
|
+
mass: recSpec.massKg,
|
|
1283
|
+
isKinematic: true,
|
|
1284
|
+
centerOfMass: [0, 0, 0],
|
|
1285
|
+
inertiaDiagonal: computePrincipalInertiaDiagonal(recSpec.massKg, recSpec.size),
|
|
1286
|
+
},
|
|
1287
|
+
collider: {
|
|
1288
|
+
geometry: { shape: allJoints.length },
|
|
1289
|
+
physicsMaterial: 0,
|
|
1290
|
+
collisionFilter: 0,
|
|
1291
|
+
},
|
|
1292
|
+
},
|
|
1293
|
+
...Object.fromEntries(allJoints.map((j, idx) => [
|
|
1294
|
+
j.nodeName,
|
|
1295
|
+
{
|
|
1296
|
+
extras: { weaponRole: j.semanticRole },
|
|
1297
|
+
motion: {
|
|
1298
|
+
mass: j.massKg,
|
|
1299
|
+
isKinematic: false,
|
|
1300
|
+
centerOfMass: [0, 0, 0],
|
|
1301
|
+
inertiaDiagonal: computePrincipalInertiaDiagonal(j.massKg, j.colliderExtents),
|
|
1302
|
+
},
|
|
1303
|
+
collider: { geometry: { shape: idx }, physicsMaterial: 0, collisionFilter: 0 },
|
|
1304
|
+
joint: { joint: idx, connectedNode: j.connectedNodeName, enableCollision: false },
|
|
1305
|
+
},
|
|
1306
|
+
])),
|
|
1307
|
+
},
|
|
1308
|
+
ikAndSockets: anchors,
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
//# sourceMappingURL=weaponSpecs.js.map
|