@adatechnology/game-weapons-three 0.12.0 → 0.13.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/dist/{chunk-ZVLG34JN.js → chunk-NQELXT56.js} +178 -20
- package/dist/chunk-NQELXT56.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +2067 -223
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/{testing-BlaMwqMW.d.ts → testing-BoxqhX_W.d.ts} +488 -6
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +9 -9
- package/dist/chunk-ZVLG34JN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BODY_ACTIONS,
|
|
5
5
|
CLASS_REFERENCE_ENERGY,
|
|
6
6
|
COUNTER_ITEM_ID,
|
|
7
|
+
CUES_IN_SAMPLE,
|
|
7
8
|
DEFAULT_ENERGY_CURVE,
|
|
8
9
|
DEFAULT_EXPLOSIVES_SCENE,
|
|
9
10
|
DEFAULT_THUMBNAIL_BASE,
|
|
@@ -11,13 +12,19 @@ import {
|
|
|
11
12
|
EXPLOSIVES_TEXT,
|
|
12
13
|
GAME_DISTANCE_CURVE,
|
|
13
14
|
GAME_SOUND_CLASSES,
|
|
15
|
+
GUNSHOT_PROFILES,
|
|
16
|
+
GUNSHOT_SAMPLE,
|
|
17
|
+
GUNSHOT_SAMPLE_IDS,
|
|
14
18
|
MECHANICAL_SOUNDS,
|
|
15
19
|
MODEL_ENTRIES,
|
|
16
20
|
MOUNTED_M134_ITEM_ID,
|
|
17
21
|
P13_VALVE_MESH,
|
|
22
|
+
RELOAD_SAMPLE,
|
|
23
|
+
RELOAD_SAMPLE_HITS,
|
|
18
24
|
SHIPPED_WEAPON_ITEM_MODELS,
|
|
19
25
|
WEAPON_ITEM_PREFIX,
|
|
20
26
|
WEAPON_THUMBNAILS,
|
|
27
|
+
WEIGHT_INTENSITY,
|
|
21
28
|
WORLD_EFFECTS,
|
|
22
29
|
WORLD_EXPLOSIVE_IDS,
|
|
23
30
|
WORLD_EXPLOSIVE_PREFIX,
|
|
@@ -34,6 +41,9 @@ import {
|
|
|
34
41
|
buildWeaponModel,
|
|
35
42
|
buildWeaponModelById,
|
|
36
43
|
cartridgeShape,
|
|
44
|
+
computeCasingSound,
|
|
45
|
+
computeFlyby,
|
|
46
|
+
computeGunshot,
|
|
37
47
|
computeShotSound,
|
|
38
48
|
createExplosivesTestModule,
|
|
39
49
|
createWeaponAudio,
|
|
@@ -56,13 +66,15 @@ import {
|
|
|
56
66
|
rigUnderbarrel,
|
|
57
67
|
weaponProp,
|
|
58
68
|
weaponPropsOver,
|
|
69
|
+
weaponSampleBank,
|
|
70
|
+
weaponSampleDefaults,
|
|
59
71
|
weaponThumbnailCredit,
|
|
60
72
|
weaponThumbnailUrl,
|
|
61
73
|
weaponsLayout,
|
|
62
74
|
worldExplosiveItem,
|
|
63
75
|
worldExplosiveShell,
|
|
64
76
|
worldExplosiveValve
|
|
65
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-NQELXT56.js";
|
|
66
78
|
|
|
67
79
|
// src/projectile-model.ts
|
|
68
80
|
function projectileModel(THREE, query) {
|
|
@@ -90,6 +102,7 @@ export {
|
|
|
90
102
|
BODY_ACTIONS,
|
|
91
103
|
CLASS_REFERENCE_ENERGY,
|
|
92
104
|
COUNTER_ITEM_ID,
|
|
105
|
+
CUES_IN_SAMPLE,
|
|
93
106
|
DEFAULT_ENERGY_CURVE,
|
|
94
107
|
DEFAULT_EXPLOSIVES_SCENE,
|
|
95
108
|
DEFAULT_THUMBNAIL_BASE,
|
|
@@ -97,12 +110,18 @@ export {
|
|
|
97
110
|
EXPLOSIVES_TEXT,
|
|
98
111
|
GAME_DISTANCE_CURVE,
|
|
99
112
|
GAME_SOUND_CLASSES,
|
|
113
|
+
GUNSHOT_PROFILES,
|
|
114
|
+
GUNSHOT_SAMPLE,
|
|
115
|
+
GUNSHOT_SAMPLE_IDS,
|
|
100
116
|
MECHANICAL_SOUNDS,
|
|
101
117
|
MODEL_ENTRIES,
|
|
102
118
|
MOUNTED_M134_ITEM_ID,
|
|
103
119
|
P13_VALVE_MESH,
|
|
120
|
+
RELOAD_SAMPLE,
|
|
121
|
+
RELOAD_SAMPLE_HITS,
|
|
104
122
|
WEAPON_ITEM_PREFIX,
|
|
105
123
|
WEAPON_THUMBNAILS,
|
|
124
|
+
WEIGHT_INTENSITY,
|
|
106
125
|
WORLD_EFFECTS,
|
|
107
126
|
WORLD_EXPLOSIVE_IDS,
|
|
108
127
|
WORLD_EXPLOSIVE_PREFIX,
|
|
@@ -118,6 +137,9 @@ export {
|
|
|
118
137
|
buildWeaponModel,
|
|
119
138
|
buildWeaponModelById,
|
|
120
139
|
cartridgeShape,
|
|
140
|
+
computeCasingSound,
|
|
141
|
+
computeFlyby,
|
|
142
|
+
computeGunshot,
|
|
121
143
|
computeShotSound,
|
|
122
144
|
createExplosivesTestModule,
|
|
123
145
|
createWeaponAudio,
|
|
@@ -141,6 +163,8 @@ export {
|
|
|
141
163
|
rigStock,
|
|
142
164
|
rigUnderbarrel,
|
|
143
165
|
weaponProp,
|
|
166
|
+
weaponSampleBank,
|
|
167
|
+
weaponSampleDefaults,
|
|
144
168
|
weaponThumbnailCredit,
|
|
145
169
|
weaponThumbnailUrl,
|
|
146
170
|
weaponsLayout,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/projectile-model.ts","../src/weapon-props.ts"],"sourcesContent":["import type * as THREE_NS from 'three'\n\nimport { buildWeaponModelById } from './models'\nimport { modelKit } from './models/kit'\nimport { buildFlyingRocket } from './models/launcher-rounds'\n\n/** What a host asks for a thrown or set down explosive: the weapon in the hand, the explosive it carries and how it is used (`rocket`, `grenade`, `molotov`, `charge`). */\nexport interface ProjectileQuery {\n readonly weapon: string\n readonly explosive?: string | undefined\n readonly kind: string\n}\n\n/** The model of a projectile and the axis along its length. */\nexport interface ProjectileModel {\n readonly model: THREE_NS.Object3D\n readonly axis: [number, number, number]\n}\n\n/**\n * The model of what a weapon throws or fires, drawn by the same code as the weapon itself: the round of a rocket launcher (the RPG-7's PG-7V, the Carl Gustaf's 84 mm round, the rocket of\n * the disposable tubes), long axis +x. Answers `null` where the gallery has no model: the throwables (grenades, molotovs, dynamite, C4, the Claymore) and the grenade launchers are\n * still the plain props of `weaponProp`, and a host keeps its primitive for them.\n */\nexport function projectileModel(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null {\n if (query.kind !== 'rocket') return null\n const launcher = buildWeaponModelById(THREE, query.weapon)\n if (!launcher || launcher.parts.family !== 'rocket') return null\n const round = launcher.parts.makeRound ? launcher.parts.makeRound() : buildFlyingRocket(modelKit(THREE), launcher.parts.launcherType)\n return { model: round, axis: [1, 0, 0] }\n}\n","import { applyPatches, mergeById, removeIds } from '@adatechnology/game-contracts'\nimport type { DeepPartial } from '@adatechnology/game-contracts'\n\nimport { SHIPPED_WEAPON_ITEM_MODELS, weaponPropsOver } from './weapon-item-model'\nimport type { WeaponItemModel, WeaponProps } from './weapon-item-model'\n\nexport interface WeaponPropsOptions {\n /** Item model overrides by weapon id, added to the shipped ones (`null` keeps the low-poly prop); later packs replace earlier ones. */\n readonly packs?: readonly Readonly<Record<string, WeaponItemModel | null>>[]\n /** Changes to an override by weapon id, merged field by field. */\n readonly patch?: Readonly<Record<string, DeepPartial<WeaponItemModel>>>\n /** Weapon ids whose override is taken out (the weapon id itself is then the item model id). */\n readonly remove?: readonly string[]\n}\n\ntype Entry = { readonly id: string; readonly model: WeaponItemModel }\n\n/** A set of weapon prop overrides of its own: the shipped ones plus `packs`, `patch` and `remove`. Nothing is shared with any other set on the page. */\nexport function createWeaponProps(options: WeaponPropsOptions = {}): WeaponProps {\n const entryOf = ([id, model]: readonly [string, WeaponItemModel | null]): Entry => ({ id, model: model ?? { item: '' } })\n const entries = mergeById<Entry>(SHIPPED_WEAPON_ITEM_MODELS.map(entryOf), (options.packs ?? []).flatMap((pack) => Object.entries(pack).map(entryOf)))\n const patches: Record<string, { model: DeepPartial<WeaponItemModel> }> = {}\n for (const [id, model] of Object.entries(options.patch ?? {})) patches[id] = { model }\n applyPatches(entries, patches)\n removeIds(entries, options.remove)\n return weaponPropsOver(new Map([...entries].map(([id, entry]) => [id, entry.model])))\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/projectile-model.ts","../src/weapon-props.ts"],"sourcesContent":["import type * as THREE_NS from 'three'\n\nimport { buildWeaponModelById } from './models'\nimport { modelKit } from './models/kit'\nimport { buildFlyingRocket } from './models/launcher-rounds'\n\n/** What a host asks for a thrown or set down explosive: the weapon in the hand, the explosive it carries and how it is used (`rocket`, `grenade`, `molotov`, `charge`). */\nexport interface ProjectileQuery {\n readonly weapon: string\n readonly explosive?: string | undefined\n readonly kind: string\n}\n\n/** The model of a projectile and the axis along its length. */\nexport interface ProjectileModel {\n readonly model: THREE_NS.Object3D\n readonly axis: [number, number, number]\n}\n\n/**\n * The model of what a weapon throws or fires, drawn by the same code as the weapon itself: the round of a rocket launcher (the RPG-7's PG-7V, the Carl Gustaf's 84 mm round, the rocket of\n * the disposable tubes), long axis +x. Answers `null` where the gallery has no model: the throwables (grenades, molotovs, dynamite, C4, the Claymore) and the grenade launchers are\n * still the plain props of `weaponProp`, and a host keeps its primitive for them.\n */\nexport function projectileModel(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null {\n if (query.kind !== 'rocket') return null\n const launcher = buildWeaponModelById(THREE, query.weapon)\n if (!launcher || launcher.parts.family !== 'rocket') return null\n const round = launcher.parts.makeRound ? launcher.parts.makeRound() : buildFlyingRocket(modelKit(THREE), launcher.parts.launcherType)\n return { model: round, axis: [1, 0, 0] }\n}\n","import { applyPatches, mergeById, removeIds } from '@adatechnology/game-contracts'\nimport type { DeepPartial } from '@adatechnology/game-contracts'\n\nimport { SHIPPED_WEAPON_ITEM_MODELS, weaponPropsOver } from './weapon-item-model'\nimport type { WeaponItemModel, WeaponProps } from './weapon-item-model'\n\nexport interface WeaponPropsOptions {\n /** Item model overrides by weapon id, added to the shipped ones (`null` keeps the low-poly prop); later packs replace earlier ones. */\n readonly packs?: readonly Readonly<Record<string, WeaponItemModel | null>>[]\n /** Changes to an override by weapon id, merged field by field. */\n readonly patch?: Readonly<Record<string, DeepPartial<WeaponItemModel>>>\n /** Weapon ids whose override is taken out (the weapon id itself is then the item model id). */\n readonly remove?: readonly string[]\n}\n\ntype Entry = { readonly id: string; readonly model: WeaponItemModel }\n\n/** A set of weapon prop overrides of its own: the shipped ones plus `packs`, `patch` and `remove`. Nothing is shared with any other set on the page. */\nexport function createWeaponProps(options: WeaponPropsOptions = {}): WeaponProps {\n const entryOf = ([id, model]: readonly [string, WeaponItemModel | null]): Entry => ({ id, model: model ?? { item: '' } })\n const entries = mergeById<Entry>(SHIPPED_WEAPON_ITEM_MODELS.map(entryOf), (options.packs ?? []).flatMap((pack) => Object.entries(pack).map(entryOf)))\n const patches: Record<string, { model: DeepPartial<WeaponItemModel> }> = {}\n for (const [id, model] of Object.entries(options.patch ?? {})) patches[id] = { model }\n applyPatches(entries, patches)\n removeIds(entries, options.remove)\n return weaponPropsOver(new Map([...entries].map(([id, entry]) => [id, entry.model])))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,SAAS,gBAAgB,OAAwB,OAAgD;AACtG,MAAI,MAAM,SAAS,SAAU,QAAO;AACpC,QAAM,WAAW,qBAAqB,OAAO,MAAM,MAAM;AACzD,MAAI,CAAC,YAAY,SAAS,MAAM,WAAW,SAAU,QAAO;AAC5D,QAAM,QAAQ,SAAS,MAAM,YAAY,SAAS,MAAM,UAAU,IAAI,kBAAkB,SAAS,KAAK,GAAG,SAAS,MAAM,YAAY;AACpI,SAAO,EAAE,OAAO,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE;AACzC;;;AC9BA,SAAS,cAAc,WAAW,iBAAiB;AAkB5C,SAAS,kBAAkB,UAA8B,CAAC,GAAgB;AAC/E,QAAM,UAAU,CAAC,CAAC,IAAI,KAAK,OAAyD,EAAE,IAAI,OAAO,SAAS,EAAE,MAAM,GAAG,EAAE;AACvH,QAAM,UAAU,UAAiB,2BAA2B,IAAI,OAAO,IAAI,QAAQ,SAAS,CAAC,GAAG,QAAQ,CAAC,SAAS,OAAO,QAAQ,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC;AACpJ,QAAM,UAAmE,CAAC;AAC1E,aAAW,CAAC,IAAI,KAAK,KAAK,OAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAAG,SAAQ,EAAE,IAAI,EAAE,MAAM;AACrF,eAAa,SAAS,OAAO;AAC7B,YAAU,SAAS,QAAQ,MAAM;AACjC,SAAO,gBAAgB,IAAI,IAAI,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC;AACtF;","names":[]}
|