@adatechnology/game-weapons-three 0.16.0 → 0.17.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/dist/{chunk-KWJQO6JS.js → chunk-BDYIF7JD.js} +218 -53
- package/dist/chunk-BDYIF7JD.js.map +1 -0
- package/dist/index.d.ts +45 -3
- package/dist/index.global.js +322 -92
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/{testing-CEcZ-zzz.d.ts → testing-BKDGK6cq.d.ts} +15 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +9 -9
- package/dist/chunk-KWJQO6JS.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as ModelOptions, b as WeaponModel, c as ModelKit, d as ModelParts, e as ModelFamily, A as AttachmentModelRegistry, L as LaserRaycast } from './testing-
|
|
2
|
-
export { f as AttachmentBuildContext, g as AttachmentModel, h as AttachmentModelBuilder, C as CLASS_REFERENCE_ENERGY, i as COUNTER_ITEM_ID, j as CUES_IN_SAMPLE, k as CasingSound, l as CuePlayed, D as DEFAULT_ENERGY_CURVE, m as DEFAULT_EXPLOSIVES_SCENE, n as DistanceCurve, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, p as EnergyCurve, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, F as FlybySound, u as FxLayers, G as GAME_DISTANCE_CURVE, v as GAME_SOUND_CLASSES, w as GUNSHOT_PROFILES, x as GUNSHOT_SAMPLE, y as GUNSHOT_SAMPLE_IDS, z as Gunshot, B as GunshotInput, H as GunshotPlayed, J as ItemModelRequest, K as MECHANICAL_SOUNDS, N as MOUNTED_M134_ITEM_ID, O as MechanicalSoundId, P as ModelMaterials, Q as MountFrame, R as RELOAD_SAMPLE, S as RELOAD_SAMPLE_HITS, T as ShotExtras, U as ShotSound, V as ShotSoundClass, X as ShotSoundInput, Y as ShotSoundOptions, Z as SoundClassDef, _ as SoundStep, $ as WEAPON_ITEM_PREFIX, a0 as WEIGHT_INTENSITY, a1 as WeaponAudio, a2 as WeaponAudioOptions, a3 as WeaponFx, a4 as WeaponFxOptions, a5 as WeaponModelDef, a6 as WeaponSampleOptions, a7 as WeaponsTestModuleOptions, a8 as buildItemWeaponModel, a9 as buildThrowableModel, aa as buildWeaponModel, ab as computeCasingSound, ac as computeFlyby, ad as computeGunshot, ae as computeShotSound, af as createExplosivesTestModule, ag as createWeaponAudio, ah as createWeaponFx, ai as createWeaponsTestModule, aj as defaultWeaponProps, ak as deriveFrames, al as explosivesTextOf, am as hasThrowableModel, an as itemModelOfWeapon, ao as mechanicalSoundOf, ap as modelKit, aq as mountFrame, ar as registerWeaponItemModel, as as weaponSampleBank, at as weaponSampleDefaults, au as weaponsLayout } from './testing-
|
|
1
|
+
import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as ModelOptions, b as WeaponModel, c as ModelKit, d as ModelParts, e as ModelFamily, A as AttachmentModelRegistry, L as LaserRaycast } from './testing-BKDGK6cq.js';
|
|
2
|
+
export { f as AttachmentBuildContext, g as AttachmentModel, h as AttachmentModelBuilder, C as CLASS_REFERENCE_ENERGY, i as COUNTER_ITEM_ID, j as CUES_IN_SAMPLE, k as CasingSound, l as CuePlayed, D as DEFAULT_ENERGY_CURVE, m as DEFAULT_EXPLOSIVES_SCENE, n as DistanceCurve, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, p as EnergyCurve, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, F as FlybySound, u as FxLayers, G as GAME_DISTANCE_CURVE, v as GAME_SOUND_CLASSES, w as GUNSHOT_PROFILES, x as GUNSHOT_SAMPLE, y as GUNSHOT_SAMPLE_IDS, z as Gunshot, B as GunshotInput, H as GunshotPlayed, J as ItemModelRequest, K as MECHANICAL_SOUNDS, N as MOUNTED_M134_ITEM_ID, O as MechanicalSoundId, P as ModelMaterials, Q as MountFrame, R as RELOAD_SAMPLE, S as RELOAD_SAMPLE_HITS, T as ShotExtras, U as ShotSound, V as ShotSoundClass, X as ShotSoundInput, Y as ShotSoundOptions, Z as SoundClassDef, _ as SoundStep, $ as WEAPON_ITEM_PREFIX, a0 as WEIGHT_INTENSITY, a1 as WeaponAudio, a2 as WeaponAudioOptions, a3 as WeaponFx, a4 as WeaponFxOptions, a5 as WeaponModelDef, a6 as WeaponSampleOptions, a7 as WeaponsTestModuleOptions, a8 as buildItemWeaponModel, a9 as buildThrowableModel, aa as buildWeaponModel, ab as computeCasingSound, ac as computeFlyby, ad as computeGunshot, ae as computeShotSound, af as createExplosivesTestModule, ag as createWeaponAudio, ah as createWeaponFx, ai as createWeaponsTestModule, aj as defaultWeaponProps, ak as deriveFrames, al as explosivesTextOf, am as hasThrowableModel, an as itemModelOfWeapon, ao as mechanicalSoundOf, ap as modelKit, aq as mountFrame, ar as registerWeaponItemModel, as as weaponSampleBank, at as weaponSampleDefaults, au as weaponsLayout } from './testing-BKDGK6cq.js';
|
|
3
3
|
import * as THREE_NS from 'three';
|
|
4
4
|
import { TestableItem, Vec3, HostEvent, EffectSink, DestructibleSpec, DeepPartial, ToolClipSet } from '@adatechnology/game-contracts';
|
|
5
5
|
import { ExplosiveDef, Arsenal, WeaponDef, CartridgeDims, CaliberDef, CaseType, ReloadFamily, FittedAttachment, AttachmentDef } from '@adatechnology/game-weapons';
|
|
@@ -229,4 +229,46 @@ declare function rigUnderbarrel(THREE: typeof THREE_NS, model: WeaponModel, def:
|
|
|
229
229
|
*/
|
|
230
230
|
declare function rigStock(THREE: typeof THREE_NS, model: WeaponModel, def: Pick<WeaponDef, 'stock' | 'dimensions'>): void;
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
/** How a tool is held in the first-person view: a pistol or a revolver, a rocket launcher, a long gun, a tool in one hand (a blade, a bat, a grenade, a lighter), or a gun carried at the hip (a hand-held rotary gun). */
|
|
233
|
+
type ViewHoldKind = 'handgun' | 'launcher' | 'long' | 'tool' | 'hip';
|
|
234
|
+
type Hold = {
|
|
235
|
+
/** The right hand's grip at the hip, from the eye (x right, y up, -z ahead, metres). */
|
|
236
|
+
readonly grip: readonly [number, number, number];
|
|
237
|
+
/** The vertical field of view the gun and the arms are drawn with (`FIRST_PERSON_LAYER`), degrees. */
|
|
238
|
+
readonly fov: number;
|
|
239
|
+
/** Aimed down the sights: how far ahead of the eye the sights sit, and how far back from the rear of the gun they are. */
|
|
240
|
+
readonly sights: {
|
|
241
|
+
readonly distance: number;
|
|
242
|
+
readonly fromRear: number;
|
|
243
|
+
};
|
|
244
|
+
/** Radians the tool is tilted up about the eye's x (a blade carried point up); none for a gun, whose barrel stays on the aim. */
|
|
245
|
+
readonly tilt?: number;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* The first-person viewmodel: the gun in the arms of the view, held at the hip with the barrel parallel to the aim (its line runs into the crosshair), the grip where the right hand
|
|
249
|
+
* reaches, drawn over the world with a lens of its own per kind, as shooters draw the weapon in the hands; aimed, the sights come to the eye. The gun and the arms keep their real size
|
|
250
|
+
* against each other; the lens frames them.
|
|
251
|
+
*/
|
|
252
|
+
declare const VIEW_HOLD: Readonly<Record<ViewHoldKind, Hold>>;
|
|
253
|
+
/**
|
|
254
|
+
* Where the world draws a point of the first-person layer: the layer is drawn with the lens `lensFov` and the world with `worldFov`, so a point at a depth lands on the screen where the
|
|
255
|
+
* world draws the point at the same depth moved toward the axis by tan(world / 2) / tan(lens / 2). The flash, the smoke and the casings, drawn by the world, start there.
|
|
256
|
+
*/
|
|
257
|
+
declare function toWorldLens(camera: THREE_NS.Camera, point: THREE_NS.Vector3, worldFov: number, lensFov: number): THREE_NS.Vector3;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* How the gun moves in the first-person view: it lags the turn of the view (`sway` metres per radian a second, up to `swayMax`, caught up at `swayRate`) and bobs with the step (`bobX`
|
|
261
|
+
* across and `bobY` down at full walking speed, `run` times that running, `frequency` radians per metre walked).
|
|
262
|
+
*/
|
|
263
|
+
declare const VIEW_MOTION: {
|
|
264
|
+
readonly sway: 0.006;
|
|
265
|
+
readonly swayMax: 0.02;
|
|
266
|
+
readonly swayRate: 9;
|
|
267
|
+
readonly bobX: 0.006;
|
|
268
|
+
readonly bobY: 0.008;
|
|
269
|
+
readonly run: 1.6;
|
|
270
|
+
readonly fullSpeed: 4;
|
|
271
|
+
readonly frequency: 3.2;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export { ARCHETYPE_MODELS, ATTACHMENT_MODELS, AttachmentModelRegistry, type AttachmentRig, BODY_ACTIONS, type CartridgeShape, type ClipContext, DEFAULT_THUMBNAIL_BASE, EXPLOSIVE_MODEL_IDS, type FitAttachmentOptions, ItemModels, LaserRaycast, MODEL_ENTRIES, type ModelEntry, ModelFamily, ModelKit, ModelOptions, ModelParts, P13_VALVE_MESH, type ProjectileModel, type ProjectileQuery, VIEW_HOLD, VIEW_MOTION, type ViewHoldKind, WEAPON_THUMBNAILS, WORLD_EFFECTS, WORLD_EXPLOSIVE_IDS, WORLD_EXPLOSIVE_PREFIX, WeaponItemModel, WeaponModel, type WeaponProp, WeaponProps, type WeaponPropsOptions, type WeaponThumbnailEntry, type WorldEffectIds, type WorldEffectsOptions, type WorldExplosiveOptions, applyCondition, buildCartridge, buildCasing, buildExplosiveModel, buildModeledProp, buildProp, buildRound, buildToolClips, buildTripodMountedProp, buildWeaponModelById, cartridgeShape, createWeaponProps, createWorldEffects, fitAttachmentModels, hasExplosiveModel, hasWeaponModel, modeledPropSpec, partRegistry, projectileModel, rigStock, rigUnderbarrel, toWorldLens, weaponProp, weaponThumbnailCredit, weaponThumbnailUrl, worldExplosiveItem, worldExplosiveShell, worldExplosiveValve };
|