@adatechnology/game-vehicles 0.8.0 → 0.8.2
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/index.d.ts +58 -2
- package/dist/index.global.js +352 -87
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +351 -86
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -542,6 +542,7 @@ type GrilleSpec = {
|
|
|
542
542
|
h?: number;
|
|
543
543
|
y?: number;
|
|
544
544
|
emblem?: boolean;
|
|
545
|
+
emblemBack?: number;
|
|
545
546
|
};
|
|
546
547
|
/** The spec of `kit.car` (see the comment above it). */
|
|
547
548
|
type CarSpec = {
|
|
@@ -914,7 +915,8 @@ type GrilleOptions = {
|
|
|
914
915
|
h?: number;
|
|
915
916
|
style?: 'bars' | 'mesh' | 'big' | 'seven' | 'closed' | 'truck';
|
|
916
917
|
col?: ColorRepresentation;
|
|
917
|
-
emblem?: boolean;
|
|
918
|
+
emblem?: boolean; /** metres the badge sits behind its usual place on the grille (a car whose foremost point is the badge keeps its measured length) */
|
|
919
|
+
emblemBack?: number;
|
|
918
920
|
};
|
|
919
921
|
declare function installLights(kit: Kit): {
|
|
920
922
|
lampGroup: (c: BuildContext, x: number, y: number, z: number, rotY: number) => three.Group<three.Object3DEventMap>;
|
|
@@ -2058,6 +2060,58 @@ interface VehicleKit {
|
|
|
2058
2060
|
*/
|
|
2059
2061
|
declare function createVehicleKit(options: VehicleKitOptions): VehicleKit;
|
|
2060
2062
|
|
|
2063
|
+
/**
|
|
2064
|
+
* The mark a round leaves in a vehicle's skin, from the round itself (calibre, mass, energy, how it met the panel) and the panel's material: no table per weapon.
|
|
2065
|
+
* A pistol round punches a clean hole with a tight dimple, a rifle round a small sharp hole with torn petals and a wide ring of chipped paint, a slug or a heavy
|
|
2066
|
+
* calibre a big ragged hole with the sheet pushed in, a shotgun pellet that stops a dimple without a bore, and a round at a slant a long gouge.
|
|
2067
|
+
*/
|
|
2068
|
+
/** What the mark looks like: drives the drawing of the mark (texture, size, stretch). */
|
|
2069
|
+
type HoleStyle = 'round' | 'petalled' | 'ragged' | 'dimple' | 'gouge';
|
|
2070
|
+
interface BulletHoleInput {
|
|
2071
|
+
/** Diameter of the round, millimetres (`Hit.caliber`). */
|
|
2072
|
+
readonly caliberMm: number;
|
|
2073
|
+
/** Kinetic energy at the panel, joules. */
|
|
2074
|
+
readonly energy: number;
|
|
2075
|
+
/** Mass of the round, grams (`Hit.mass`); without it the speed is not known and the mark goes by calibre. */
|
|
2076
|
+
readonly massGrams?: number;
|
|
2077
|
+
/** |cos| of the angle between the round's path and the panel's normal: 1 square on, 0 along the panel. */
|
|
2078
|
+
readonly cosIncidence: number;
|
|
2079
|
+
/** The round went through the panel. */
|
|
2080
|
+
readonly through: boolean;
|
|
2081
|
+
/** The panel's material (`steel`, `aluminium`, `glass`, `plastic`, `rubber`). */
|
|
2082
|
+
readonly material: string;
|
|
2083
|
+
/** The bore the panel already took (`holeDiam` of the impl, with a soft point's spread), metres. */
|
|
2084
|
+
readonly boreDiameter: number;
|
|
2085
|
+
}
|
|
2086
|
+
interface BulletHoleShape {
|
|
2087
|
+
readonly style: HoleStyle;
|
|
2088
|
+
/** Diameter of the dark bore, metres (0: no bore, the sheet is only dented or scraped). */
|
|
2089
|
+
readonly boreDiameter: number;
|
|
2090
|
+
/** Diameter of the whole mark across (bare metal and chipped paint around the bore), metres. */
|
|
2091
|
+
readonly markDiameter: number;
|
|
2092
|
+
/** How far the sheet is pushed in at the middle, metres. */
|
|
2093
|
+
readonly dentDepth: number;
|
|
2094
|
+
/** Length over width of the mark, along the round's path on the panel (1: round). */
|
|
2095
|
+
readonly elongation: number;
|
|
2096
|
+
/** Torn petals of sheet around the bore (0: a clean edge). */
|
|
2097
|
+
readonly petals: number;
|
|
2098
|
+
}
|
|
2099
|
+
/** Below this |cos| the round meets the panel at a slant (more than ~63° off square): it scrapes a gouge instead of a round hole. */
|
|
2100
|
+
declare const GOUGE_COS = 0.45;
|
|
2101
|
+
/** A round faster than this, metres per second, is a rifle round: its shock tears the sheet and chips the paint wide. */
|
|
2102
|
+
declare const RIFLE_SPEED = 600;
|
|
2103
|
+
/**
|
|
2104
|
+
* Without the round's mass (a world's shot carries the calibre and the energy only): a round carrying this many joules per square millimetre of its
|
|
2105
|
+
* cross-section is a rifle round (5.56 about 70, 7.62x39 about 40, .30-30 about 45; 9 mm about 8, .44 Magnum about 16, a 12 ga slug about 11).
|
|
2106
|
+
*/
|
|
2107
|
+
declare const RIFLE_ENERGY_DENSITY = 35;
|
|
2108
|
+
/** A round this wide or wider, millimetres, is a slug or a heavy calibre: a big ragged hole. */
|
|
2109
|
+
declare const HEAVY_CALIBER_MM = 12;
|
|
2110
|
+
/** The style of the mark from the round and how it met the panel. */
|
|
2111
|
+
declare function holeStyleOf(input: BulletHoleInput): HoleStyle;
|
|
2112
|
+
/** The size and shape of the mark (see {@link BulletHoleShape}). */
|
|
2113
|
+
declare function bulletHoleShape(input: BulletHoleInput): BulletHoleShape;
|
|
2114
|
+
|
|
2061
2115
|
/** Build states: new English name -> original seed text. */
|
|
2062
2116
|
declare const LEGACY_STATES: Record<string, string>;
|
|
2063
2117
|
/** Salts mixed into the seed of each phase of `applyZones`. */
|
|
@@ -2231,6 +2285,8 @@ interface PartDef {
|
|
|
2231
2285
|
material: MaterialId;
|
|
2232
2286
|
box: LocalBox;
|
|
2233
2287
|
mass: number;
|
|
2288
|
+
/** Where the part's mass sits, in the vehicle's space, when it is not the middle of its box: the synthetic chassis of a vehicle with no underbody zone holds the shell its box spans, and its weight sits over what the vehicle stands on. */
|
|
2289
|
+
massCentre?: Vec3;
|
|
2234
2290
|
/** Energy in joules that wrecks the part. */
|
|
2235
2291
|
hp: number;
|
|
2236
2292
|
/** The damage zone this part is, when it is one. */
|
|
@@ -2632,4 +2688,4 @@ declare const hullVolume: (points: ArrayLike<number>, faces: readonly HullFace[]
|
|
|
2632
2688
|
*/
|
|
2633
2689
|
declare const reducePoints: (points: ArrayLike<number>, max: number) => number[];
|
|
2634
2690
|
|
|
2635
|
-
export { ARMOUR_LEVELS, type ArmourLevel, type ArmourLevelId, type Band, type BandId, type BandIndex, type BandOverride, type BayBox, type BuildFunction, type BuildOptions, type BuildState, type BuildZoneState, type BusRowsOptions, CABIN_CATEGORIES, CABIN_LEAK, CABIN_MINIMUMS, CABIN_SOURCE, CRASH_RULES, type CabinBox, type CabinCategory, type CabinDoorMinimum, type CabinEnclosureOptions, type CabinMinimum, type CabinSource, type CarSpec, type CarWheel, type CrashOptions, type CrashResult, type CrashRules, type CreaseQueue, type CreaseWork, CutNode, type CutTest, DOOR_SHELL_DEPTH, DOOR_SHELL_MAX_DEPTH, type DamageMapOptions, type DamageZone, type Damageable, type DamageableKind, type DamageableMaterial, type DamageableSide, type DashboardOptions, type DoorShellParams, type DoorShellResult, type DriveReport, ENTRY_DUCK_FACTOR, type EngineBaySpec, type ExplodeOptions, FLOATING_AREA, type FlagEffect, type FluidDefinition, type GlassOptions, type GlassQuad, type Greenhouse, type GrilleOptions, type HeadlightLens, type HeadlightOptions, type HullFace, type HullPlan, HullSoup, type ImpactOptions, type InteriorOptions, JOINT_RULES, type JointDef, type KitConfiguration, type KitInternals, type KitTexts, LEGACY_STATES, LEGACY_ZONE_IDS, type LabelArgument, type LocalBox, type LocaleStrings, type LodSettings, type LoftRow, type LoftStation, type OverallHealth, PLUME_PUFFS, type PaneLook, type PartDef, type PartLabel, type PartRole, type PartSink, type PartialLocaleStrings, type ParticleEffectRequest, type ParticleEffects, type ParticleMaterials, type PathItem, type Plugin, type Puddle, type PuddleLobe, RAIN_MOVE_STEP, RAIN_OPENING_DIAMETER, RAIN_TURN_STEP, type ResolvedConfiguration, type RollState, SEED_SALTS, SMOKE_LOOKS, SMOKE_WIND, type ScenarioContext, type ScenarioDefinition, type ScenarioResult, type SceneNode, type SeatOptions, type ShellSpec, SmokeCause, type SmokeLook, type SmokePuff, type SmokePuffParams, type SmoothLoftOptions, type Splat, type SplatOptions, type StrayLamp, type TaillightOptions, type ThreeObject, type ThreeVector, type Translate, type TumbleSpec, type UiHelpers, type UnderbodySpec, type VehicleContext, type VehicleDestructible, type VehicleDestructibleOptions, type VehicleItem, type VehicleItemOptions, type VehicleKit, type VehicleKitOptions, type VehicleLamp, type VehicleMeta, type VehicleModel, type VehiclePart, type VehicleRainCover, type VehicleRainCoverOptions, type VehicleSpec, type VehicleStatus, type WarpFn, type WarpOptions, type ZoneDamageEntry, type ZoneDef, type ZoneEffect, type ZoneState, armourLevelOf, buildVehicleItem, buildVehicleModel, cabinBoxOf, cabinEnclosure, cabinMinimumOf, clamp, convexFaces, crackedGlassMaterial, crashDeltaV, crashVehicle, createCreaseQueue, createLod, createTranslate, createVehicleDestructible, createVehicleKit, createVehicleRainCover, defaultDamageableKinds, defaultLodSettings, doorShell, engineBayVent, format, hash, hullVolume, legacyGlassId, legacyLightId, legacyZoneId, listLocales, newHullPlan, openEdgeCount, planDivision, reducePoints, registerLegacySeeds, registerLocale, resolveStrings, rng, smokeCauseOfEmitter, smokePuff, smokeRate, smooth, strHash, strayLampsOf, swingOf, wrapThreeForLod };
|
|
2691
|
+
export { ARMOUR_LEVELS, type ArmourLevel, type ArmourLevelId, type Band, type BandId, type BandIndex, type BandOverride, type BayBox, type BuildFunction, type BuildOptions, type BuildState, type BuildZoneState, type BulletHoleInput, type BulletHoleShape, type BusRowsOptions, CABIN_CATEGORIES, CABIN_LEAK, CABIN_MINIMUMS, CABIN_SOURCE, CRASH_RULES, type CabinBox, type CabinCategory, type CabinDoorMinimum, type CabinEnclosureOptions, type CabinMinimum, type CabinSource, type CarSpec, type CarWheel, type CrashOptions, type CrashResult, type CrashRules, type CreaseQueue, type CreaseWork, CutNode, type CutTest, DOOR_SHELL_DEPTH, DOOR_SHELL_MAX_DEPTH, type DamageMapOptions, type DamageZone, type Damageable, type DamageableKind, type DamageableMaterial, type DamageableSide, type DashboardOptions, type DoorShellParams, type DoorShellResult, type DriveReport, ENTRY_DUCK_FACTOR, type EngineBaySpec, type ExplodeOptions, FLOATING_AREA, type FlagEffect, type FluidDefinition, GOUGE_COS, type GlassOptions, type GlassQuad, type Greenhouse, type GrilleOptions, HEAVY_CALIBER_MM, type HeadlightLens, type HeadlightOptions, type HoleStyle, type HullFace, type HullPlan, HullSoup, type ImpactOptions, type InteriorOptions, JOINT_RULES, type JointDef, type KitConfiguration, type KitInternals, type KitTexts, LEGACY_STATES, LEGACY_ZONE_IDS, type LabelArgument, type LocalBox, type LocaleStrings, type LodSettings, type LoftRow, type LoftStation, type OverallHealth, PLUME_PUFFS, type PaneLook, type PartDef, type PartLabel, type PartRole, type PartSink, type PartialLocaleStrings, type ParticleEffectRequest, type ParticleEffects, type ParticleMaterials, type PathItem, type Plugin, type Puddle, type PuddleLobe, RAIN_MOVE_STEP, RAIN_OPENING_DIAMETER, RAIN_TURN_STEP, RIFLE_ENERGY_DENSITY, RIFLE_SPEED, type ResolvedConfiguration, type RollState, SEED_SALTS, SMOKE_LOOKS, SMOKE_WIND, type ScenarioContext, type ScenarioDefinition, type ScenarioResult, type SceneNode, type SeatOptions, type ShellSpec, SmokeCause, type SmokeLook, type SmokePuff, type SmokePuffParams, type SmoothLoftOptions, type Splat, type SplatOptions, type StrayLamp, type TaillightOptions, type ThreeObject, type ThreeVector, type Translate, type TumbleSpec, type UiHelpers, type UnderbodySpec, type VehicleContext, type VehicleDestructible, type VehicleDestructibleOptions, type VehicleItem, type VehicleItemOptions, type VehicleKit, type VehicleKitOptions, type VehicleLamp, type VehicleMeta, type VehicleModel, type VehiclePart, type VehicleRainCover, type VehicleRainCoverOptions, type VehicleSpec, type VehicleStatus, type WarpFn, type WarpOptions, type ZoneDamageEntry, type ZoneDef, type ZoneEffect, type ZoneState, armourLevelOf, buildVehicleItem, buildVehicleModel, bulletHoleShape, cabinBoxOf, cabinEnclosure, cabinMinimumOf, clamp, convexFaces, crackedGlassMaterial, crashDeltaV, crashVehicle, createCreaseQueue, createLod, createTranslate, createVehicleDestructible, createVehicleKit, createVehicleRainCover, defaultDamageableKinds, defaultLodSettings, doorShell, engineBayVent, format, hash, holeStyleOf, hullVolume, legacyGlassId, legacyLightId, legacyZoneId, listLocales, newHullPlan, openEdgeCount, planDivision, reducePoints, registerLegacySeeds, registerLocale, resolveStrings, rng, smokeCauseOfEmitter, smokePuff, smokeRate, smooth, strHash, strayLampsOf, swingOf, wrapThreeForLod };
|