@threenative/core 0.3.10 → 0.3.12
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/capabilities.json +1096 -26
- package/dist/camera-shake-CZKOfGn4.d.ts +46 -0
- package/dist/{canvas-layer-vCtanIeB.d.ts → canvas-layer-CWuFRT7G.d.ts} +1 -1
- package/dist/chunk-2Z44XSI2.js +35 -0
- package/dist/chunk-5O73CDMR.js +1849 -0
- package/dist/chunk-6KLNISRJ.js +153 -0
- package/dist/chunk-7UUT3TY5.js +133 -0
- package/dist/chunk-CFGTPFUH.js +231 -0
- package/dist/chunk-DBELTTTM.js +615 -0
- package/dist/chunk-GMHATRPW.js +7701 -0
- package/dist/chunk-GXY7B3JG.js +46 -0
- package/dist/chunk-KIRUKTBQ.js +187 -0
- package/dist/chunk-N5LRP4BR.js +220 -0
- package/dist/chunk-OKXUCASC.js +2238 -0
- package/dist/chunk-QWJEMUUT.js +94 -0
- package/dist/chunk-VAZM36TV.js +497 -0
- package/dist/{game-DzMcitDO.d.ts → game-D7pAzZUY.d.ts} +15 -3
- package/dist/hot.d.ts +3 -3
- package/dist/hot.js +2 -46
- package/dist/index.d.ts +329 -302
- package/dist/index.js +10565 -22533
- package/dist/{model-lod-CTpZ6imz.d.ts → model-lod-B6BMqS1r.d.ts} +33 -3
- package/dist/playtest.d.ts +3 -3
- package/dist/playtest.js +24 -75
- package/dist/react-css.js +1 -215
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-rZm0hVqq.d.ts → renderer-DvFVoAgj.d.ts} +13 -4
- package/dist/spells/index.d.ts +643 -0
- package/dist/spells/index.js +1558 -0
- package/dist/spells/ultra/index.d.ts +1600 -0
- package/dist/spells/ultra/index.js +6804 -0
- package/dist/terrain-jobs-worker.js +1 -123
- package/dist/two-sided-foliage-W523J3UM.js +1 -0
- package/dist/ui-layer.js +5 -384
- package/dist/worker.js +4 -41
- package/dist/world.d.ts +725 -259
- package/dist/world.js +16714 -18284
- package/mcp/animation-server.mjs +1 -1
- package/mcp/animation.mjs +2 -3
- package/mcp/engine-server.mjs +142 -47
- package/mcp/servers.mjs +9 -2
- package/mcp/terrain.mjs +8 -0
- package/package.json +14 -6
- package/patches/three@0.187.0-prd269-upgrade.patch +2102 -0
- package/patches/three@0.187.0.patch +2004 -407
- package/src/assets.ts +9 -2
- package/src/card-lod.ts +152 -0
- package/src/compressed-texture-preparation.ts +1008 -0
- package/src/frame-budget.ts +31 -20
- package/src/game-dev-tools.ts +93 -0
- package/src/game-frame-loop.ts +995 -0
- package/src/game-renderer-metrics.ts +77 -0
- package/src/game-startup.ts +1001 -0
- package/src/game-validate.ts +70 -0
- package/src/game.ts +253 -1935
- package/src/index.ts +27 -2
- package/src/launch-diagnostics.ts +22 -12
- package/src/look/ao-admission.ts +24 -0
- package/src/look/filmic-tone-mapping.ts +15 -13
- package/src/look/look-diagnostics.ts +3 -3
- package/src/look/quality.ts +10 -5
- package/src/look/world-environment.ts +76 -9
- package/src/loop.ts +29 -0
- package/src/model-lod.ts +42 -3
- package/src/particle-kinds.ts +515 -0
- package/src/picking.ts +17 -3
- package/src/playtest.ts +27 -1
- package/src/projection-apply.ts +4 -1
- package/src/projection-plan.ts +9 -6
- package/src/render/mesh-pool.ts +1 -1
- package/src/render/resolution-subrect.ts +2 -0
- package/src/render/rough-diffuse.ts +46 -12
- package/src/render/soft-shadow.ts +27 -12
- package/src/render/virtual-shadow-adaptive.ts +55 -0
- package/src/render/virtual-shadow-casters.ts +175 -0
- package/src/render/virtual-shadow-layers.ts +76 -0
- package/src/render/virtual-shadow-level.ts +224 -0
- package/src/render/virtual-shadow-markers.ts +193 -0
- package/src/render/virtual-shadow-options.ts +370 -0
- package/src/render/virtual-shadow-pages.ts +5 -0
- package/src/render/virtual-shadow.ts +213 -992
- package/src/render/world-impostor-surface.ts +293 -34
- package/src/render-camera-cull.ts +32 -1
- package/src/render-pass-budget.ts +34 -7
- package/src/renderProjection.ts +22 -0
- package/src/renderer.ts +92 -37
- package/src/snow-field.ts +1 -1
- package/src/spells/cast-pool.ts +361 -0
- package/src/spells/index.ts +177 -0
- package/src/spells/mechanisms.ts +295 -0
- package/src/spells/reaction-field.ts +415 -0
- package/src/spells/spell-lights.ts +139 -0
- package/src/spells/spell-world.ts +187 -0
- package/src/spells/spell.ts +397 -0
- package/src/spells/spells.ts +283 -0
- package/src/spells/ultra/engine/camera.ts +184 -0
- package/src/spells/ultra/engine/quality.ts +96 -0
- package/src/spells/ultra/index.ts +52 -0
- package/src/spells/ultra/main.ts +305 -0
- package/src/spells/ultra/scene/arenaMaterial.ts +325 -0
- package/src/spells/ultra/spells/cast.ts +233 -0
- package/src/spells/ultra/spells/fire.ts +1267 -0
- package/src/spells/ultra/vfx/FluidVolume.ts +816 -0
- package/src/spells/ultra/vfx/FluidVolume.tsl.ts +855 -0
- package/src/spells/ultra/vfx/FxTarget.ts +61 -0
- package/src/spells/ultra/vfx/GroundField.ts +1399 -0
- package/src/spells/ultra/vfx/Particles.ts +1475 -0
- package/src/spells/ultra/vfx/Ribbons.ts +645 -0
- package/src/spells/ultra/vfx/Shockwaves.ts +286 -0
- package/src/spells/ultra/vfx/Volumes.ts +489 -0
- package/src/spells/ultra/vfx/common.ts +1195 -0
- package/src/spells/ultra/vfx/noise.ts +441 -0
- package/src/startup-readiness.ts +128 -34
- package/src/version.ts +1 -1
- package/src/warmup.ts +56 -8
- package/src/water-surface.ts +9 -3
- package/src/world-bundle-safety.ts +401 -0
- package/src/world-cell-batches.ts +1216 -0
- package/src/world-cell-chunks.ts +1132 -0
- package/src/world-cell-data.ts +995 -0
- package/src/world-cell-impostors.ts +1449 -0
- package/src/world-cell-lod-bias.ts +151 -0
- package/src/world-cell-models.ts +1074 -0
- package/src/world-cell-options.ts +189 -0
- package/src/world-cell-placements.ts +694 -0
- package/src/world-cell-prewarm.ts +557 -0
- package/src/world-cell-readiness.ts +357 -0
- package/src/world-cell-render-bundles.ts +459 -0
- package/src/world-cell-render-gpu-dress.ts +714 -0
- package/src/world-cell-render-main-cull.ts +484 -0
- package/src/world-cell-render-shadow-claims.ts +198 -0
- package/src/world-cell-render-util.ts +246 -0
- package/src/world-cell-render.ts +1493 -0
- package/src/world-cell-residency.ts +745 -0
- package/src/world-cells.ts +1318 -10418
- package/src/world-chunk-shadow.ts +308 -0
- package/src/world-collar.ts +315 -0
- package/src/world-gpu-flags.ts +163 -0
- package/src/world-gpu-readback.ts +881 -0
- package/src/world-gpu-reference.ts +510 -0
- package/src/world-gpu-scene.ts +214 -2264
- package/src/world-gpu-shadow.ts +190 -0
- package/src/world-gpu-types.ts +381 -0
- package/src/world-gpu-validation.ts +518 -0
- package/src/world-heightfield.ts +802 -0
- package/src/world-load-limiter.ts +106 -0
- package/src/world-noise.ts +241 -0
- package/src/world-package.ts +42 -0
- package/src/world-region.ts +1 -1
- package/src/world-terrain-splat.ts +365 -149
- package/src/world-tile-budget.ts +256 -0
- package/src/world-tile-geometry.ts +469 -0
- package/src/world-tile-lod.ts +408 -0
- package/src/world-tile-observation.ts +566 -0
- package/src/world-tile-stitch.ts +166 -0
- package/src/world-tiles.ts +170 -1745
- package/src/world-water-bodies.ts +359 -0
- package/src/world.ts +35 -741
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
|
|
3
|
+
type CameraShakeCurve = (phase: number) => number;
|
|
4
|
+
interface ICameraShakeOptions {
|
|
5
|
+
/** Position amplitude in world metres, supplied by the game. */
|
|
6
|
+
readonly amplitude: Vector3;
|
|
7
|
+
/** Rotation amplitude in radians around x/y/z, supplied by the game. */
|
|
8
|
+
readonly rotationAmplitude: Vector3;
|
|
9
|
+
/** Curve cycles per second, supplied by the game. */
|
|
10
|
+
readonly frequency: number;
|
|
11
|
+
/** Exponential envelope decay per second, supplied by the game. */
|
|
12
|
+
readonly decay: number;
|
|
13
|
+
/** Game-authored waveform sampled at `elapsed * frequency * 2π`. */
|
|
14
|
+
readonly curve: CameraShakeCurve;
|
|
15
|
+
}
|
|
16
|
+
interface ICameraShakeOffset {
|
|
17
|
+
readonly position: Vector3;
|
|
18
|
+
readonly rotation: Vector3;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Produce a transient camera offset without owning or mutating a camera.
|
|
22
|
+
*
|
|
23
|
+
* The caller supplies the amplitudes, frequency, decay and waveform. {@link update} evaluates the
|
|
24
|
+
* waveform against the caller's fixed-step delta and returns a reusable position/rotation offset;
|
|
25
|
+
* a template can compose it after its own camera rig and damping.
|
|
26
|
+
*/
|
|
27
|
+
declare class CameraShake {
|
|
28
|
+
#private;
|
|
29
|
+
readonly amplitude: Vector3;
|
|
30
|
+
readonly rotationAmplitude: Vector3;
|
|
31
|
+
readonly frequency: number;
|
|
32
|
+
readonly decay: number;
|
|
33
|
+
readonly curve: CameraShakeCurve;
|
|
34
|
+
readonly offset: ICameraShakeOffset;
|
|
35
|
+
constructor(options: ICameraShakeOptions);
|
|
36
|
+
get active(): boolean;
|
|
37
|
+
get elapsed(): number;
|
|
38
|
+
/** Start or restart the authored shake waveform. */
|
|
39
|
+
trigger(): this;
|
|
40
|
+
/** Stop the effect and clear the offset. */
|
|
41
|
+
stop(): this;
|
|
42
|
+
/** Evaluate the current offset and advance by one caller-supplied fixed-step delta. */
|
|
43
|
+
update(dt: number): ICameraShakeOffset;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { type CameraShakeCurve as C, type ICameraShakeOffset as I, CameraShake as a, type ICameraShakeOptions as b };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as three from 'three';
|
|
2
2
|
import { Camera, Vector2, Vector3, Scene, OrthographicCamera } from 'three';
|
|
3
|
-
import { I as IRendererLike } from './renderer-
|
|
3
|
+
import { I as IRendererLike } from './renderer-DvFVoAgj.js';
|
|
4
4
|
|
|
5
5
|
interface IViewportSize {
|
|
6
6
|
readonly aspect: number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/quiet-markers.ts
|
|
2
|
+
var LOG_FLAG = "TN_LOG";
|
|
3
|
+
var BROWSER_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "file:"]);
|
|
4
|
+
var restore;
|
|
5
|
+
var isOn = (value) => value === true || typeof value === "string" && value !== "" && value !== "0" && value !== "false";
|
|
6
|
+
function markerLogRequested() {
|
|
7
|
+
const host = globalThis;
|
|
8
|
+
if (isOn(host.process?.env?.[LOG_FLAG])) return true;
|
|
9
|
+
const query = globalThis.location?.search;
|
|
10
|
+
if (typeof query === "string" && /[?&]tnLog=(?!0(?:&|$))(?!false(?:&|$))[^&]/u.test(query))
|
|
11
|
+
return true;
|
|
12
|
+
return isOn(globalThis.__THREENATIVE_LOG__);
|
|
13
|
+
}
|
|
14
|
+
function installQuietMarkers() {
|
|
15
|
+
const protocol = globalThis.location?.protocol;
|
|
16
|
+
if (restore !== void 0 || typeof protocol !== "string" || !BROWSER_PROTOCOLS.has(protocol))
|
|
17
|
+
return;
|
|
18
|
+
if (markerLogRequested()) return;
|
|
19
|
+
const original = { log: console.log, info: console.info };
|
|
20
|
+
const quiet = (method) => (...args) => {
|
|
21
|
+
if (typeof args[0] === "string" && args[0].startsWith("TN_")) console.debug(...args);
|
|
22
|
+
else method.apply(console, args);
|
|
23
|
+
};
|
|
24
|
+
console.log = quiet(original.log);
|
|
25
|
+
console.info = quiet(original.info);
|
|
26
|
+
restore = original;
|
|
27
|
+
}
|
|
28
|
+
function uninstallQuietMarkers() {
|
|
29
|
+
if (restore === void 0) return;
|
|
30
|
+
console.log = restore.log;
|
|
31
|
+
console.info = restore.info;
|
|
32
|
+
restore = void 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { installQuietMarkers, markerLogRequested, uninstallQuietMarkers };
|