@tresjs/cientos 5.8.1 → 5.9.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/trescientos.d.ts +3090 -8179
- package/dist/trescientos.js +1126 -248
- package/package.json +5 -4
package/dist/trescientos.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/cientos
|
|
3
|
-
* version: v5.
|
|
3
|
+
* version: v5.9.1
|
|
4
4
|
* (c) 2026
|
|
5
5
|
* description: Collection of useful helpers and fully functional, ready-made abstractions for Tres
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
import { Fragment, Suspense, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isReactive, isRef, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, ref, render, renderList, renderSlot, shallowReactive, shallowRef, toDisplayString, toRaw, toRefs, toValue, triggerRef, unref, useAttrs, useSlots, useTemplateRef, vShow, watch, watchEffect, withAsyncContext, withCtx, withDirectives, withModifiers } from "vue";
|
|
9
|
-
import { buildGraph, createTimer, extend, isObject3D, logError, logWarning, normalizeColor, normalizeVectorFlexibleParam, useLoader, useLoop, useTres, useTresContext } from "@tresjs/core";
|
|
8
|
+
import { Fragment, Suspense, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, isReactive, isRef, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, ref, render, renderList, renderSlot, shallowReactive, shallowRef, toDisplayString, toRaw, toRefs, toValue, triggerRef, unref, useAttrs, useSlots, useTemplateRef, vShow, watch, watchEffect, withAsyncContext, withCtx, withDirectives, withModifiers } from "vue";
|
|
9
|
+
import { INJECTION_KEY, TresPortal, buildGraph, createTimer, extend, isObject3D, logError, logWarning, normalizeColor, normalizeVectorFlexibleParam, useLoader, useLoop, useTres, useTresContext } from "@tresjs/core";
|
|
10
10
|
import * as THREE from "three";
|
|
11
|
-
import { AdditiveBlending, AlwaysStencilFunc, AnimationMixer, Audio, AudioListener, AudioLoader, BackSide, Box2, Box3, BoxGeometry, BufferAttribute, BufferGeometry, Camera, CatmullRomCurve3, ClampToEdgeWrapping, Color, CubeCamera, CubeReflectionMapping, CubeTextureLoader, CubicBezierCurve3, DataTexture, DefaultLoadingManager, DepthTexture, DirectionalLight, DoubleSide, EdgesGeometry, EqualStencilFunc, EquirectangularReflectionMapping, Euler, FloatType, FramebufferTexture, FrontSide, Group, HalfFloatType, IcosahedronGeometry, InstancedMesh, InterleavedBuffer, InterleavedBufferAttribute, KeepStencilOp, LOD, LinearFilter, MOUSE, MathUtils, Matrix4, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshLambertMaterial, MeshPhysicalMaterial, MeshStandardMaterial, NearestFilter, NoBlending, NoToneMapping, NotEqualStencilFunc, Object3D, OrthographicCamera, PerspectiveCamera, Plane, PlaneGeometry, Points, PointsMaterial, QuadraticBezierCurve3, Quaternion, REVISION, RGBAFormat, RawShaderMaterial, Raycaster, RepeatWrapping, ReplaceStencilOp, Scene, ShaderChunk, ShaderMaterial, ShapeGeometry, SkinnedMesh, Sphere, Spherical, TOUCH, TangentSpaceNormalMap, Texture, TextureLoader, UVMapping, Uniform, UniformsUtils, UnsignedByteType, Vector2, Vector3, Vector4, VideoTexture, WebGLCubeRenderTarget, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
11
|
+
import { AdditiveBlending, AlwaysStencilFunc, AnimationMixer, Audio, AudioListener, AudioLoader, BackSide, Box2, Box3, BoxGeometry, BufferAttribute, BufferGeometry, Camera, CatmullRomCurve3, ClampToEdgeWrapping, Color, CubeCamera, CubeReflectionMapping, CubeTextureLoader, CubicBezierCurve3, DataTexture, DefaultLoadingManager, DepthTexture, DirectionalLight, DoubleSide, DynamicDrawUsage, EdgesGeometry, EqualStencilFunc, EquirectangularReflectionMapping, Euler, FloatType, FramebufferTexture, FrontSide, Group, HalfFloatType, IcosahedronGeometry, InstancedBufferAttribute, InstancedMesh, InterleavedBuffer, InterleavedBufferAttribute, KeepStencilOp, LOD, LinearFilter, MOUSE, MathUtils, Matrix4, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshLambertMaterial, MeshPhysicalMaterial, MeshStandardMaterial, NearestFilter, NoBlending, NoToneMapping, NotEqualStencilFunc, Object3D, OrthographicCamera, PerspectiveCamera, Plane, PlaneGeometry, Points, PointsMaterial, QuadraticBezierCurve3, Quaternion, REVISION, RGBAFormat, RawShaderMaterial, Raycaster, RepeatWrapping, ReplaceStencilOp, Scene, ShaderChunk, ShaderMaterial, ShapeGeometry, SkinnedMesh, Sphere, Spherical, TOUCH, TangentSpaceNormalMap, Texture, TextureLoader, UVMapping, Uniform, UniformsUtils, UnsignedByteType, Vector2, Vector3, Vector4, VideoTexture, WebGLCubeRenderTarget, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
12
12
|
import { onKeyStroke, tryOnScopeDispose, useDebounceFn, useDraggable, useElementSize, useEventListener, useMagicKeys, useMouse, useResizeObserver, useScroll, useWindowScroll, useWindowSize, watchThrottled, whenever } from "@vueuse/core";
|
|
13
|
-
import { DRACOLoader, DecalGeometry, FBXLoader, FontLoader, GLTFExporter, GLTFLoader, HorizontalBlurShader, Line2, LineGeometry, LineMaterial, MapControls, MarchingCubes, MeshSurfaceSampler, OrbitControls, PointerLockControls, PositionalAudioHelper, RGBELoader, Reflector, RoundedBoxGeometry, SVGLoader, SimplexNoise, Sky, TextGeometry, TransformControls, VerticalBlurShader, Water, toCreasedNormals } from "three-stdlib";
|
|
13
|
+
import { DRACOLoader, DecalGeometry, FBXLoader, FontLoader, GLTFExporter, GLTFLoader, HorizontalBlurShader, Line2, LineGeometry, LineMaterial, MapControls, MarchingCubes, MeshSurfaceSampler, OrbitControls, PointerLockControls, PositionalAudioHelper, RGBELoader, Reflector, Refractor, RoundedBoxGeometry, SVGLoader, SimplexNoise, Sky, TextGeometry, TransformControls, VerticalBlurShader, Water, toCreasedNormals } from "three-stdlib";
|
|
14
14
|
import BaseCameraControls, { default as CameraControls } from "camera-controls";
|
|
15
15
|
import StatsImpl from "stats.js";
|
|
16
16
|
import StatsGlImpl from "stats-gl";
|
|
@@ -92,6 +92,7 @@ var Align_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
92
92
|
if (!outer.value || !inner.value || !ref$1.value) return;
|
|
93
93
|
outer.value.matrixWorld.identity();
|
|
94
94
|
box3.setFromObject(inner.value, props.precise);
|
|
95
|
+
if (box3.isEmpty()) return;
|
|
95
96
|
const width = box3.max.x - box3.min.x;
|
|
96
97
|
const height = box3.max.y - box3.min.y;
|
|
97
98
|
const depth = box3.max.z - box3.min.z;
|
|
@@ -1162,12 +1163,12 @@ function useDecalEditor() {
|
|
|
1162
1163
|
|
|
1163
1164
|
//#endregion
|
|
1164
1165
|
//#region src/core/abstractions/Decal/DecalItem.vue?vue&type=script&setup=true&lang.ts
|
|
1165
|
-
const _hoisted_1$
|
|
1166
|
+
const _hoisted_1$67 = [
|
|
1166
1167
|
"name",
|
|
1167
1168
|
"render-order",
|
|
1168
1169
|
"material-polygonOffsetFactor"
|
|
1169
1170
|
];
|
|
1170
|
-
const _hoisted_2$
|
|
1171
|
+
const _hoisted_2$32 = [
|
|
1171
1172
|
"geometry",
|
|
1172
1173
|
"visible",
|
|
1173
1174
|
"name"
|
|
@@ -1389,7 +1390,7 @@ var DecalItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
1389
1390
|
color: __props.edgeColor,
|
|
1390
1391
|
"depth-test": false,
|
|
1391
1392
|
transparent: true
|
|
1392
|
-
}, null, 8, _hoisted_3$9)], 8, _hoisted_2$
|
|
1393
|
+
}, null, 8, _hoisted_3$9)], 8, _hoisted_2$32)) : createCommentVNode("v-if", true)], 40, _hoisted_1$67);
|
|
1393
1394
|
};
|
|
1394
1395
|
}
|
|
1395
1396
|
});
|
|
@@ -1400,7 +1401,7 @@ var DecalItem_default = DecalItem_vue_vue_type_script_setup_true_lang_default;
|
|
|
1400
1401
|
|
|
1401
1402
|
//#endregion
|
|
1402
1403
|
//#region src/core/abstractions/Decal/DecalEditor.vue?vue&type=script&setup=true&lang.ts
|
|
1403
|
-
const _hoisted_1$
|
|
1404
|
+
const _hoisted_1$66 = ["visible"];
|
|
1404
1405
|
const DRAG_THRESHOLD_SQ = 25;
|
|
1405
1406
|
var DecalEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1406
1407
|
__name: "DecalEditor",
|
|
@@ -1683,7 +1684,7 @@ var DecalEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
1683
1684
|
color: "#0000ff",
|
|
1684
1685
|
"depth-test": false,
|
|
1685
1686
|
transparent: true
|
|
1686
|
-
}, null, -1)])], 8, _hoisted_1$
|
|
1687
|
+
}, null, -1)])], 8, _hoisted_1$66), renderSlot(_ctx.$slots, "default")], 64);
|
|
1687
1688
|
};
|
|
1688
1689
|
}
|
|
1689
1690
|
});
|
|
@@ -2141,11 +2142,11 @@ function getTextureLabel(tex) {
|
|
|
2141
2142
|
|
|
2142
2143
|
//#endregion
|
|
2143
2144
|
//#region src/core/abstractions/Decal/DebugUI/Handle.vue?vue&type=script&setup=true&lang.ts
|
|
2144
|
-
const _hoisted_1$
|
|
2145
|
+
const _hoisted_1$65 = {
|
|
2145
2146
|
class: "snap-vignette",
|
|
2146
2147
|
"aria-hidden": "true"
|
|
2147
2148
|
};
|
|
2148
|
-
const _hoisted_2$
|
|
2149
|
+
const _hoisted_2$31 = {
|
|
2149
2150
|
class: "snap-ticks",
|
|
2150
2151
|
viewBox: "0 0 100 100",
|
|
2151
2152
|
"aria-hidden": "true"
|
|
@@ -2340,8 +2341,8 @@ var Handle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
2340
2341
|
style: normalizeStyle(innerStyle.value),
|
|
2341
2342
|
class: "handle-inner"
|
|
2342
2343
|
}, [
|
|
2343
|
-
withDirectives(createElementVNode("div", _hoisted_1$
|
|
2344
|
-
withDirectives((openBlock(), createElementBlock("svg", _hoisted_2$
|
|
2344
|
+
withDirectives(createElementVNode("div", _hoisted_1$65, null, 512), [[vShow, unref(isSnapEnabled)]]),
|
|
2345
|
+
withDirectives((openBlock(), createElementBlock("svg", _hoisted_2$31, [(openBlock(true), createElementBlock(Fragment, null, renderList(snapTicks.value, (angle, i) => {
|
|
2345
2346
|
return openBlock(), createElementBlock("g", {
|
|
2346
2347
|
key: i,
|
|
2347
2348
|
transform: `rotate(${angle} 50 50)`
|
|
@@ -2378,11 +2379,11 @@ var Handle_default = Handle_vue_vue_type_script_setup_true_lang_default;
|
|
|
2378
2379
|
|
|
2379
2380
|
//#endregion
|
|
2380
2381
|
//#region src/core/abstractions/Decal/DebugUI/Dock.vue?vue&type=script&setup=true&lang.ts
|
|
2381
|
-
const _hoisted_1$
|
|
2382
|
+
const _hoisted_1$64 = {
|
|
2382
2383
|
key: 0,
|
|
2383
2384
|
class: "dock"
|
|
2384
2385
|
};
|
|
2385
|
-
const _hoisted_2$
|
|
2386
|
+
const _hoisted_2$30 = {
|
|
2386
2387
|
key: 0,
|
|
2387
2388
|
class: "tint-popover",
|
|
2388
2389
|
role: "dialog",
|
|
@@ -2555,7 +2556,7 @@ var Dock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
2555
2556
|
return openBlock(), createElementBlock("div", { class: normalizeClass(["dock-stack", isVisible.value ? "is-visible" : ""]) }, [
|
|
2556
2557
|
createCommentVNode(" Top row: edit-only tools, slides in/out as edits start/end. "),
|
|
2557
2558
|
createVNode(Transition, { name: "edit-dock" }, {
|
|
2558
|
-
default: withCtx(() => [isEditing.value && !isDraggingTexture.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2559
|
+
default: withCtx(() => [isEditing.value && !isDraggingTexture.value ? (openBlock(), createElementBlock("div", _hoisted_1$64, [
|
|
2559
2560
|
createElementVNode("button", {
|
|
2560
2561
|
class: normalizeClass(["icon-btn", { "is-active": unref(isSnapEnabled) }]),
|
|
2561
2562
|
title: "Snap rotation (15°)",
|
|
@@ -2641,7 +2642,7 @@ var Dock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
2641
2642
|
key: 0,
|
|
2642
2643
|
class: "tint-swatch",
|
|
2643
2644
|
style: normalizeStyle({ backgroundColor: editingColor.value })
|
|
2644
|
-
}, null, 4)) : createCommentVNode("v-if", true)], 2), isTintOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2645
|
+
}, null, 4)) : createCommentVNode("v-if", true)], 2), isTintOpen.value ? (openBlock(), createElementBlock("div", _hoisted_2$30, [
|
|
2645
2646
|
createElementVNode("div", _hoisted_3$7, [
|
|
2646
2647
|
_cache[10] || (_cache[10] = createElementVNode("span", { class: "tint-row__label" }, "Color", -1)),
|
|
2647
2648
|
createElementVNode("input", {
|
|
@@ -2925,8 +2926,8 @@ var Dock_default = Dock_vue_vue_type_script_setup_true_lang_default;
|
|
|
2925
2926
|
|
|
2926
2927
|
//#endregion
|
|
2927
2928
|
//#region src/core/abstractions/Decal/DebugUI/LayerList.vue?vue&type=script&setup=true&lang.ts
|
|
2928
|
-
const _hoisted_1$
|
|
2929
|
-
const _hoisted_2$
|
|
2929
|
+
const _hoisted_1$63 = { class: "dock decal-list" };
|
|
2930
|
+
const _hoisted_2$29 = { class: "list-header" };
|
|
2930
2931
|
const _hoisted_3$6 = { class: "list-header__count" };
|
|
2931
2932
|
const _hoisted_4$4 = {
|
|
2932
2933
|
key: 0,
|
|
@@ -3095,8 +3096,8 @@ var LayerList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
3095
3096
|
dragOverPosition.value = null;
|
|
3096
3097
|
}
|
|
3097
3098
|
return (_ctx, _cache) => {
|
|
3098
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3099
|
-
createElementVNode("header", _hoisted_2$
|
|
3099
|
+
return openBlock(), createElementBlock("div", _hoisted_1$63, [
|
|
3100
|
+
createElementVNode("header", _hoisted_2$29, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "list-header__title" }, "Layers", -1)), createElementVNode("span", _hoisted_3$6, toDisplayString(totalCount.value), 1)]),
|
|
3100
3101
|
totalCount.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_4$4, " No decals yet ")) : createCommentVNode("v-if", true),
|
|
3101
3102
|
(openBlock(true), createElementBlock(Fragment, null, renderList(groups.value, (group) => {
|
|
3102
3103
|
return openBlock(), createElementBlock("section", {
|
|
@@ -3386,7 +3387,7 @@ var DecalDebugUI_default = DecalDebugUI_vue_vue_type_script_setup_true_lang_defa
|
|
|
3386
3387
|
|
|
3387
3388
|
//#endregion
|
|
3388
3389
|
//#region src/core/abstractions/Edges.vue?vue&type=script&setup=true&lang.ts
|
|
3389
|
-
const _hoisted_1$
|
|
3390
|
+
const _hoisted_1$62 = ["color"];
|
|
3390
3391
|
var Edges_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
3391
3392
|
__name: "Edges",
|
|
3392
3393
|
props: {
|
|
@@ -3424,7 +3425,7 @@ var Edges_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
3424
3425
|
return openBlock(), createElementBlock("TresLineSegments", {
|
|
3425
3426
|
ref_key: "lineSegmentsRef",
|
|
3426
3427
|
ref: lineSegmentsRef
|
|
3427
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresLineBasicMaterial", { color: unref(color) }, null, 8, _hoisted_1$
|
|
3428
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresLineBasicMaterial", { color: unref(color) }, null, 8, _hoisted_1$62)])], 512);
|
|
3428
3429
|
};
|
|
3429
3430
|
}
|
|
3430
3431
|
});
|
|
@@ -3598,7 +3599,7 @@ var Levioso_default = Levioso_vue_vue_type_script_setup_true_lang_default;
|
|
|
3598
3599
|
|
|
3599
3600
|
//#endregion
|
|
3600
3601
|
//#region src/core/abstractions/Mask/component.vue?vue&type=script&setup=true&lang.ts
|
|
3601
|
-
const _hoisted_1$
|
|
3602
|
+
const _hoisted_1$61 = ["render-order"];
|
|
3602
3603
|
var component_vue_vue_type_script_setup_true_lang_default$18 = /* @__PURE__ */ defineComponent({
|
|
3603
3604
|
__name: "component",
|
|
3604
3605
|
props: {
|
|
@@ -3640,7 +3641,7 @@ var component_vue_vue_type_script_setup_true_lang_default$18 = /* @__PURE__ */ d
|
|
|
3640
3641
|
ref_key: "meshRef",
|
|
3641
3642
|
ref: meshRef,
|
|
3642
3643
|
"render-order": -props.id
|
|
3643
|
-
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
3644
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$61);
|
|
3644
3645
|
};
|
|
3645
3646
|
}
|
|
3646
3647
|
});
|
|
@@ -4030,7 +4031,7 @@ var ScreenSizer_default = ScreenSizer_vue_vue_type_script_setup_true_lang_defaul
|
|
|
4030
4031
|
|
|
4031
4032
|
//#endregion
|
|
4032
4033
|
//#region src/core/abstractions/ScreenSpace.vue?vue&type=script&setup=true&lang.ts
|
|
4033
|
-
const _hoisted_1$
|
|
4034
|
+
const _hoisted_1$60 = ["position"];
|
|
4034
4035
|
var ScreenSpace_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4035
4036
|
__name: "ScreenSpace",
|
|
4036
4037
|
props: {
|
|
@@ -4097,7 +4098,7 @@ var ScreenSpace_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4097
4098
|
return openBlock(), createElementBlock("TresGroup", {
|
|
4098
4099
|
ref_key: "outerRef",
|
|
4099
4100
|
ref: outerRef
|
|
4100
|
-
}, [createElementVNode("TresGroup", { position: innerPosition.value }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
4101
|
+
}, [createElementVNode("TresGroup", { position: innerPosition.value }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$60)], 512);
|
|
4101
4102
|
};
|
|
4102
4103
|
}
|
|
4103
4104
|
});
|
|
@@ -4124,6 +4125,392 @@ function useMask(id, inverse = false) {
|
|
|
4124
4125
|
return result;
|
|
4125
4126
|
}
|
|
4126
4127
|
|
|
4128
|
+
//#endregion
|
|
4129
|
+
//#region src/core/abstractions/Instances/const.ts
|
|
4130
|
+
const INSTANCES_INJECTION_KEY = Symbol("tresInstances");
|
|
4131
|
+
const MERGED_INJECTION_KEY = Symbol("tresMergedInstances");
|
|
4132
|
+
|
|
4133
|
+
//#endregion
|
|
4134
|
+
//#region src/core/abstractions/Instances/PositionMesh.ts
|
|
4135
|
+
const scratchMesh = new Mesh();
|
|
4136
|
+
const scratchIntersects = [];
|
|
4137
|
+
/**
|
|
4138
|
+
* Geometry-less placeholder standing in for a single instance of an `InstancedMesh`.
|
|
4139
|
+
*
|
|
4140
|
+
* It renders nothing (`Object3D` never enters the render list) but borrows its batch's
|
|
4141
|
+
* geometry and material while raycasting, so pointer events resolve to this node instead
|
|
4142
|
+
* of the whole batch.
|
|
4143
|
+
*/
|
|
4144
|
+
var PositionMesh = class extends Object3D {
|
|
4145
|
+
color = new Color("white");
|
|
4146
|
+
batch = null;
|
|
4147
|
+
raycast(raycaster, intersects) {
|
|
4148
|
+
const mesh = this.batch?.mesh.value;
|
|
4149
|
+
if (!mesh?.geometry || !mesh.material) return;
|
|
4150
|
+
scratchMesh.geometry = mesh.geometry;
|
|
4151
|
+
scratchMesh.material = mesh.material;
|
|
4152
|
+
scratchMesh.matrixWorld.copy(this.matrixWorld);
|
|
4153
|
+
scratchIntersects.length = 0;
|
|
4154
|
+
scratchMesh.raycast(raycaster, scratchIntersects);
|
|
4155
|
+
for (const hit of scratchIntersects) intersects.push({
|
|
4156
|
+
...hit,
|
|
4157
|
+
object: this
|
|
4158
|
+
});
|
|
4159
|
+
scratchIntersects.length = 0;
|
|
4160
|
+
}
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
//#endregion
|
|
4164
|
+
//#region src/core/abstractions/Instances/Instance.vue?vue&type=script&setup=true&lang.ts
|
|
4165
|
+
const _hoisted_1$59 = ["object"];
|
|
4166
|
+
var Instance_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4167
|
+
__name: "Instance",
|
|
4168
|
+
props: {
|
|
4169
|
+
batch: {
|
|
4170
|
+
type: String,
|
|
4171
|
+
required: false
|
|
4172
|
+
},
|
|
4173
|
+
name: {
|
|
4174
|
+
type: String,
|
|
4175
|
+
required: false
|
|
4176
|
+
},
|
|
4177
|
+
color: {
|
|
4178
|
+
type: [
|
|
4179
|
+
Object,
|
|
4180
|
+
String,
|
|
4181
|
+
Number
|
|
4182
|
+
],
|
|
4183
|
+
required: false
|
|
4184
|
+
}
|
|
4185
|
+
},
|
|
4186
|
+
setup(__props, { expose: __expose }) {
|
|
4187
|
+
const props = __props;
|
|
4188
|
+
const node = shallowRef(new PositionMesh());
|
|
4189
|
+
const merged = inject(MERGED_INJECTION_KEY, null);
|
|
4190
|
+
const single = inject(INSTANCES_INJECTION_KEY, null);
|
|
4191
|
+
const target = computed(() => props.batch ? merged?.[props.batch] ?? null : single);
|
|
4192
|
+
watch(target, (next, previous) => {
|
|
4193
|
+
previous?.unregister(node.value);
|
|
4194
|
+
node.value.batch = next;
|
|
4195
|
+
next?.register(node.value);
|
|
4196
|
+
if (next && props.color !== void 0) next.requestColorBuffer();
|
|
4197
|
+
}, { immediate: true });
|
|
4198
|
+
watch(() => props.color, (color) => {
|
|
4199
|
+
if (color === void 0) return;
|
|
4200
|
+
node.value.color.set(color);
|
|
4201
|
+
target.value?.requestColorBuffer();
|
|
4202
|
+
}, { immediate: true });
|
|
4203
|
+
watch(() => props.name, (name) => node.value.name = name ?? "", { immediate: true });
|
|
4204
|
+
onScopeDispose(() => target.value?.unregister(node.value));
|
|
4205
|
+
/**
|
|
4206
|
+
* A `PositionMesh` with no batch renders nothing and reports nothing, and the key a batch
|
|
4207
|
+
* registers under is not always the name of the mesh it came from, so a plausible-looking
|
|
4208
|
+
* `batch` fails silently. Checked a tick after mount, by which point a sibling `<Instances>`
|
|
4209
|
+
* has registered.
|
|
4210
|
+
*/
|
|
4211
|
+
onMounted(() => nextTick(() => {
|
|
4212
|
+
if (target.value) return;
|
|
4213
|
+
if (!merged && !single) {
|
|
4214
|
+
logWarning("Instance: no batch to join, so this renders nothing. An <Instance> belongs inside <Instances> or <Merged>.");
|
|
4215
|
+
return;
|
|
4216
|
+
}
|
|
4217
|
+
if (!merged) {
|
|
4218
|
+
logWarning(`Instance: \`batch\` picks a batch out of a <Merged>, and there is none above this one, so "${props.batch}" renders nothing. Drop \`batch\` to join the enclosing <Instances>.`);
|
|
4219
|
+
return;
|
|
4220
|
+
}
|
|
4221
|
+
if (!props.batch) {
|
|
4222
|
+
logWarning("Instance: <Merged> keys its batches, so an instance inside one needs a `batch` to pick one. This renders nothing.");
|
|
4223
|
+
return;
|
|
4224
|
+
}
|
|
4225
|
+
const available = Object.keys(merged);
|
|
4226
|
+
if (available.length > 0) logWarning(`Instance: no batch named "${props.batch}", so this renders nothing. Available: ${available.join(", ")}.`);
|
|
4227
|
+
}));
|
|
4228
|
+
__expose({ instance: node });
|
|
4229
|
+
return (_ctx, _cache) => {
|
|
4230
|
+
return openBlock(), createElementBlock("primitive", { object: node.value }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$59);
|
|
4231
|
+
};
|
|
4232
|
+
}
|
|
4233
|
+
});
|
|
4234
|
+
|
|
4235
|
+
//#endregion
|
|
4236
|
+
//#region src/core/abstractions/Instances/Instance.vue
|
|
4237
|
+
var Instance_default = Instance_vue_vue_type_script_setup_true_lang_default;
|
|
4238
|
+
|
|
4239
|
+
//#endregion
|
|
4240
|
+
//#region src/core/abstractions/Instances/useInstancesBatch.ts
|
|
4241
|
+
function createMatrixAttribute(capacity) {
|
|
4242
|
+
const attribute = new InstancedBufferAttribute(new Float32Array(capacity * 16), 16);
|
|
4243
|
+
attribute.setUsage(DynamicDrawUsage);
|
|
4244
|
+
return attribute;
|
|
4245
|
+
}
|
|
4246
|
+
function createColorAttribute(capacity) {
|
|
4247
|
+
const attribute = new InstancedBufferAttribute(new Float32Array(capacity * 3).fill(1), 3);
|
|
4248
|
+
attribute.setUsage(DynamicDrawUsage);
|
|
4249
|
+
return attribute;
|
|
4250
|
+
}
|
|
4251
|
+
const scratchColor = [
|
|
4252
|
+
0,
|
|
4253
|
+
0,
|
|
4254
|
+
0
|
|
4255
|
+
];
|
|
4256
|
+
/**
|
|
4257
|
+
* Writes `source` into `target` at `offset`, reporting whether anything actually moved.
|
|
4258
|
+
*
|
|
4259
|
+
* `Math.fround` is load-bearing: `target` narrows to float32 on write, so comparing raw
|
|
4260
|
+
* doubles against it reports a change every frame for values float32 can't represent.
|
|
4261
|
+
*/
|
|
4262
|
+
function writeIfChanged(target, offset, source, length) {
|
|
4263
|
+
let changed = false;
|
|
4264
|
+
for (let i = 0; i < length; i++) {
|
|
4265
|
+
const value = Math.fround(source[i]);
|
|
4266
|
+
if (target[offset + i] !== value) {
|
|
4267
|
+
target[offset + i] = value;
|
|
4268
|
+
changed = true;
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
return changed;
|
|
4272
|
+
}
|
|
4273
|
+
/**
|
|
4274
|
+
* Owns a single `InstancedMesh` and the placeholders registered against it.
|
|
4275
|
+
*
|
|
4276
|
+
* The registry identity is stable across geometry/material/limit changes, so descendants
|
|
4277
|
+
* that injected it stay bound when the underlying mesh is rebuilt.
|
|
4278
|
+
*/
|
|
4279
|
+
function useInstancesBatch(source) {
|
|
4280
|
+
const mesh = shallowRef(null);
|
|
4281
|
+
const nodes = [];
|
|
4282
|
+
const parentInverse = new Matrix4();
|
|
4283
|
+
const instanceMatrix = new Matrix4();
|
|
4284
|
+
let capacity = 0;
|
|
4285
|
+
let hasColors = false;
|
|
4286
|
+
function disposeMesh() {
|
|
4287
|
+
const current = mesh.value;
|
|
4288
|
+
if (!current) return;
|
|
4289
|
+
current.instanceMatrix.dispose();
|
|
4290
|
+
current.instanceColor?.dispose();
|
|
4291
|
+
current.dispose();
|
|
4292
|
+
mesh.value = null;
|
|
4293
|
+
}
|
|
4294
|
+
function build() {
|
|
4295
|
+
disposeMesh();
|
|
4296
|
+
const { geometry, material, limit } = source();
|
|
4297
|
+
capacity = Math.max(1, Math.floor(limit), nodes.length);
|
|
4298
|
+
const next = new InstancedMesh(geometry, material, capacity);
|
|
4299
|
+
next.instanceMatrix = createMatrixAttribute(capacity);
|
|
4300
|
+
next.count = 0;
|
|
4301
|
+
next.frustumCulled = false;
|
|
4302
|
+
next.raycast = () => null;
|
|
4303
|
+
if (hasColors) next.instanceColor = createColorAttribute(capacity);
|
|
4304
|
+
mesh.value = next;
|
|
4305
|
+
}
|
|
4306
|
+
function grow(needed) {
|
|
4307
|
+
const current = mesh.value;
|
|
4308
|
+
if (!current || needed <= capacity) return;
|
|
4309
|
+
const next = Math.max(needed, capacity * 2);
|
|
4310
|
+
const matrixAttribute = createMatrixAttribute(next);
|
|
4311
|
+
matrixAttribute.array.set(current.instanceMatrix.array);
|
|
4312
|
+
current.instanceMatrix.dispose();
|
|
4313
|
+
current.instanceMatrix = matrixAttribute;
|
|
4314
|
+
if (current.instanceColor) {
|
|
4315
|
+
const colorAttribute = createColorAttribute(next);
|
|
4316
|
+
colorAttribute.array.set(current.instanceColor.array);
|
|
4317
|
+
current.instanceColor.dispose();
|
|
4318
|
+
current.instanceColor = colorAttribute;
|
|
4319
|
+
}
|
|
4320
|
+
capacity = next;
|
|
4321
|
+
logWarning(`Instances: more instances registered than \`limit\` allows, reallocated for ${next}. Set \`:limit="${next}"\` to avoid reallocating at runtime.`);
|
|
4322
|
+
}
|
|
4323
|
+
const api = {
|
|
4324
|
+
mesh,
|
|
4325
|
+
register(node) {
|
|
4326
|
+
nodes.push(node);
|
|
4327
|
+
grow(nodes.length);
|
|
4328
|
+
},
|
|
4329
|
+
unregister(node) {
|
|
4330
|
+
const index = nodes.indexOf(node);
|
|
4331
|
+
if (index !== -1) nodes.splice(index, 1);
|
|
4332
|
+
},
|
|
4333
|
+
requestColorBuffer() {
|
|
4334
|
+
if (hasColors) return;
|
|
4335
|
+
hasColors = true;
|
|
4336
|
+
const current = mesh.value;
|
|
4337
|
+
if (current && !current.instanceColor) current.instanceColor = createColorAttribute(capacity);
|
|
4338
|
+
}
|
|
4339
|
+
};
|
|
4340
|
+
function update() {
|
|
4341
|
+
const current = mesh.value;
|
|
4342
|
+
if (!current) return;
|
|
4343
|
+
current.updateWorldMatrix(true, false);
|
|
4344
|
+
parentInverse.copy(current.matrixWorld).invert();
|
|
4345
|
+
const colorAttribute = current.instanceColor;
|
|
4346
|
+
const matrices = current.instanceMatrix.array;
|
|
4347
|
+
const colors = colorAttribute?.array;
|
|
4348
|
+
let matricesChanged = false;
|
|
4349
|
+
let colorsChanged = false;
|
|
4350
|
+
let visible = 0;
|
|
4351
|
+
for (const node of nodes) {
|
|
4352
|
+
if (!node.visible) continue;
|
|
4353
|
+
node.updateWorldMatrix(true, false);
|
|
4354
|
+
instanceMatrix.multiplyMatrices(parentInverse, node.matrixWorld);
|
|
4355
|
+
matricesChanged = writeIfChanged(matrices, visible * 16, instanceMatrix.elements, 16) || matricesChanged;
|
|
4356
|
+
if (colors) {
|
|
4357
|
+
const { r, g, b } = node.color;
|
|
4358
|
+
scratchColor[0] = r;
|
|
4359
|
+
scratchColor[1] = g;
|
|
4360
|
+
scratchColor[2] = b;
|
|
4361
|
+
colorsChanged = writeIfChanged(colors, visible * 3, scratchColor, 3) || colorsChanged;
|
|
4362
|
+
}
|
|
4363
|
+
visible++;
|
|
4364
|
+
}
|
|
4365
|
+
current.count = visible;
|
|
4366
|
+
if (matricesChanged) current.instanceMatrix.needsUpdate = true;
|
|
4367
|
+
if (colorsChanged && colorAttribute) colorAttribute.needsUpdate = true;
|
|
4368
|
+
}
|
|
4369
|
+
watch(source, build, { immediate: true });
|
|
4370
|
+
onScopeDispose(disposeMesh);
|
|
4371
|
+
return {
|
|
4372
|
+
mesh,
|
|
4373
|
+
api,
|
|
4374
|
+
update
|
|
4375
|
+
};
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
//#endregion
|
|
4379
|
+
//#region src/core/abstractions/Instances/Instances.vue?vue&type=script&setup=true&lang.ts
|
|
4380
|
+
const _hoisted_1$58 = [
|
|
4381
|
+
"object",
|
|
4382
|
+
"cast-shadow",
|
|
4383
|
+
"receive-shadow"
|
|
4384
|
+
];
|
|
4385
|
+
var Instances_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4386
|
+
__name: "Instances",
|
|
4387
|
+
props: {
|
|
4388
|
+
geometry: {
|
|
4389
|
+
type: Object,
|
|
4390
|
+
required: true
|
|
4391
|
+
},
|
|
4392
|
+
material: {
|
|
4393
|
+
type: [Object, Array],
|
|
4394
|
+
required: true
|
|
4395
|
+
},
|
|
4396
|
+
limit: {
|
|
4397
|
+
type: Number,
|
|
4398
|
+
required: false,
|
|
4399
|
+
default: 1e3
|
|
4400
|
+
},
|
|
4401
|
+
batch: {
|
|
4402
|
+
type: String,
|
|
4403
|
+
required: false
|
|
4404
|
+
},
|
|
4405
|
+
name: {
|
|
4406
|
+
type: String,
|
|
4407
|
+
required: false
|
|
4408
|
+
},
|
|
4409
|
+
castShadow: {
|
|
4410
|
+
type: Boolean,
|
|
4411
|
+
required: false,
|
|
4412
|
+
default: false
|
|
4413
|
+
},
|
|
4414
|
+
receiveShadow: {
|
|
4415
|
+
type: Boolean,
|
|
4416
|
+
required: false,
|
|
4417
|
+
default: false
|
|
4418
|
+
}
|
|
4419
|
+
},
|
|
4420
|
+
setup(__props, { expose: __expose }) {
|
|
4421
|
+
const props = __props;
|
|
4422
|
+
const { mesh, api, update } = useInstancesBatch(() => ({
|
|
4423
|
+
geometry: props.geometry,
|
|
4424
|
+
material: props.material,
|
|
4425
|
+
limit: props.limit
|
|
4426
|
+
}));
|
|
4427
|
+
provide(INSTANCES_INJECTION_KEY, api);
|
|
4428
|
+
const merged = inject(MERGED_INJECTION_KEY, null);
|
|
4429
|
+
if (merged) {
|
|
4430
|
+
watch(() => props.batch, (batch, previous) => {
|
|
4431
|
+
if (previous) delete merged[previous];
|
|
4432
|
+
if (batch) merged[batch] = api;
|
|
4433
|
+
}, { immediate: true });
|
|
4434
|
+
onScopeDispose(() => {
|
|
4435
|
+
if (props.batch && merged[props.batch] === api) delete merged[props.batch];
|
|
4436
|
+
});
|
|
4437
|
+
}
|
|
4438
|
+
watch([mesh, () => props.name], ([current, name]) => {
|
|
4439
|
+
if (current) current.name = name ?? "";
|
|
4440
|
+
}, { immediate: true });
|
|
4441
|
+
useLoop().onBeforeRender(update);
|
|
4442
|
+
__expose({ instance: mesh });
|
|
4443
|
+
return (_ctx, _cache) => {
|
|
4444
|
+
return unref(mesh) ? (openBlock(), createElementBlock("primitive", {
|
|
4445
|
+
key: 0,
|
|
4446
|
+
object: unref(mesh),
|
|
4447
|
+
"cast-shadow": __props.castShadow,
|
|
4448
|
+
"receive-shadow": __props.receiveShadow
|
|
4449
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$58)) : createCommentVNode("v-if", true);
|
|
4450
|
+
};
|
|
4451
|
+
}
|
|
4452
|
+
});
|
|
4453
|
+
|
|
4454
|
+
//#endregion
|
|
4455
|
+
//#region src/core/abstractions/Instances/Instances.vue
|
|
4456
|
+
var Instances_default = Instances_vue_vue_type_script_setup_true_lang_default;
|
|
4457
|
+
|
|
4458
|
+
//#endregion
|
|
4459
|
+
//#region src/core/abstractions/Instances/Merged.vue?vue&type=script&setup=true&lang.ts
|
|
4460
|
+
var Merged_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4461
|
+
__name: "Merged",
|
|
4462
|
+
props: {
|
|
4463
|
+
meshes: {
|
|
4464
|
+
type: Object,
|
|
4465
|
+
required: true
|
|
4466
|
+
},
|
|
4467
|
+
limit: {
|
|
4468
|
+
type: Number,
|
|
4469
|
+
required: false,
|
|
4470
|
+
default: 100
|
|
4471
|
+
},
|
|
4472
|
+
castShadow: {
|
|
4473
|
+
type: Boolean,
|
|
4474
|
+
required: false,
|
|
4475
|
+
default: false
|
|
4476
|
+
},
|
|
4477
|
+
receiveShadow: {
|
|
4478
|
+
type: Boolean,
|
|
4479
|
+
required: false,
|
|
4480
|
+
default: false
|
|
4481
|
+
}
|
|
4482
|
+
},
|
|
4483
|
+
setup(__props, { expose: __expose }) {
|
|
4484
|
+
const registry = shallowReactive({});
|
|
4485
|
+
provide(MERGED_INJECTION_KEY, registry);
|
|
4486
|
+
__expose({ instances: registry });
|
|
4487
|
+
return (_ctx, _cache) => {
|
|
4488
|
+
return openBlock(), createElementBlock(Fragment, null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.meshes, (mesh, key) => {
|
|
4489
|
+
return openBlock(), createBlock(Instances_default, {
|
|
4490
|
+
key,
|
|
4491
|
+
batch: key,
|
|
4492
|
+
geometry: mesh.geometry,
|
|
4493
|
+
material: mesh.material,
|
|
4494
|
+
limit: __props.limit,
|
|
4495
|
+
"cast-shadow": __props.castShadow,
|
|
4496
|
+
"receive-shadow": __props.receiveShadow
|
|
4497
|
+
}, null, 8, [
|
|
4498
|
+
"batch",
|
|
4499
|
+
"geometry",
|
|
4500
|
+
"material",
|
|
4501
|
+
"limit",
|
|
4502
|
+
"cast-shadow",
|
|
4503
|
+
"receive-shadow"
|
|
4504
|
+
]);
|
|
4505
|
+
}), 128)), renderSlot(_ctx.$slots, "default")], 64);
|
|
4506
|
+
};
|
|
4507
|
+
}
|
|
4508
|
+
});
|
|
4509
|
+
|
|
4510
|
+
//#endregion
|
|
4511
|
+
//#region src/core/abstractions/Instances/Merged.vue
|
|
4512
|
+
var Merged_default = Merged_vue_vue_type_script_setup_true_lang_default;
|
|
4513
|
+
|
|
4127
4514
|
//#endregion
|
|
4128
4515
|
//#region src/utils/types.ts
|
|
4129
4516
|
const isPerspectiveCamera$1 = (camera) => Boolean(camera && camera.isPerspectiveCamera);
|
|
@@ -4131,7 +4518,7 @@ const isOrthographicCamera$1 = (camera) => Boolean(camera && camera.isOrthograph
|
|
|
4131
4518
|
|
|
4132
4519
|
//#endregion
|
|
4133
4520
|
//#region src/core/controls/CameraControls.vue?vue&type=script&setup=true&lang.ts
|
|
4134
|
-
const _hoisted_1$
|
|
4521
|
+
const _hoisted_1$57 = [
|
|
4135
4522
|
"min-polar-angle",
|
|
4136
4523
|
"max-polar-angle",
|
|
4137
4524
|
"min-azimuth-angle",
|
|
@@ -4400,7 +4787,7 @@ var CameraControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4400
4787
|
args: [__props.camera || unref(activeCamera), __props.domElement || unref(renderer).domElement],
|
|
4401
4788
|
"mouse-buttons": mouseButtons.value,
|
|
4402
4789
|
touches: touches.value
|
|
4403
|
-
}, null, 8, _hoisted_1$
|
|
4790
|
+
}, null, 8, _hoisted_1$57)) : createCommentVNode("v-if", true);
|
|
4404
4791
|
};
|
|
4405
4792
|
}
|
|
4406
4793
|
});
|
|
@@ -4448,7 +4835,8 @@ var KeyboardControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
4448
4835
|
});
|
|
4449
4836
|
const sidewardMove = ref(0);
|
|
4450
4837
|
const forwardMove = ref(0);
|
|
4451
|
-
const
|
|
4838
|
+
const verticalMove = ref(0);
|
|
4839
|
+
const { KeyW, KeyA, KeyS, KeyD, Up, Down, Left, Right, KeyQ, KeyE } = useMagicKeys();
|
|
4452
4840
|
watchEffect(() => {
|
|
4453
4841
|
if (KeyA.value || Left.value) sidewardMove.value = -moveSpeed.value;
|
|
4454
4842
|
else if (KeyD.value || Right.value) sidewardMove.value = moveSpeed.value;
|
|
@@ -4456,6 +4844,9 @@ var KeyboardControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
4456
4844
|
if (KeyW.value || Up.value) forwardMove.value = moveSpeed.value;
|
|
4457
4845
|
else if (KeyS.value || Down.value) forwardMove.value = -moveSpeed.value;
|
|
4458
4846
|
else forwardMove.value = 0;
|
|
4847
|
+
if (KeyE.value) verticalMove.value = moveSpeed.value;
|
|
4848
|
+
else if (KeyQ.value) verticalMove.value = -moveSpeed.value;
|
|
4849
|
+
else verticalMove.value = 0;
|
|
4459
4850
|
});
|
|
4460
4851
|
__expose({ instance: controls });
|
|
4461
4852
|
const isActive = (isLock) => {
|
|
@@ -4479,11 +4870,20 @@ var KeyboardControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
4479
4870
|
emit("change", controls.value);
|
|
4480
4871
|
}
|
|
4481
4872
|
};
|
|
4873
|
+
const moveUp = (movementSpeed) => {
|
|
4874
|
+
if (!activeCamera.value?.position) return;
|
|
4875
|
+
activeCamera.value.position.y += movementSpeed;
|
|
4876
|
+
if (verticalMove.value) {
|
|
4877
|
+
invalidate();
|
|
4878
|
+
emit("change", controls.value);
|
|
4879
|
+
}
|
|
4880
|
+
};
|
|
4482
4881
|
const { onBeforeRender } = useLoop();
|
|
4483
4882
|
onBeforeRender(({ delta }) => {
|
|
4484
4883
|
if (controls.value instanceof PointerLockControls && controls.value?.isLocked) {
|
|
4485
4884
|
moveForward(delta, forwardMove.value);
|
|
4486
4885
|
controls.value.moveRight(sidewardMove.value);
|
|
4886
|
+
moveUp(verticalMove.value);
|
|
4487
4887
|
}
|
|
4488
4888
|
});
|
|
4489
4889
|
return (_ctx, _cache) => {
|
|
@@ -4491,7 +4891,7 @@ var KeyboardControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
4491
4891
|
key: 0,
|
|
4492
4892
|
selector: __props.selector,
|
|
4493
4893
|
"make-default": __props.makeDefault,
|
|
4494
|
-
camera: __props.camera || unref(activeCamera),
|
|
4894
|
+
camera: __props.camera || unref(activeCamera)?.value,
|
|
4495
4895
|
"dom-element": __props.domElement || unref(renderer).domElement,
|
|
4496
4896
|
onIsLock: isActive,
|
|
4497
4897
|
onChange: hasChange
|
|
@@ -4568,7 +4968,7 @@ function useOrbitLikeControls(controlsRef, props, emit) {
|
|
|
4568
4968
|
|
|
4569
4969
|
//#endregion
|
|
4570
4970
|
//#region src/core/controls/MapControls.vue?vue&type=script&setup=true&lang.ts
|
|
4571
|
-
const _hoisted_1$
|
|
4971
|
+
const _hoisted_1$56 = [
|
|
4572
4972
|
"args",
|
|
4573
4973
|
"target",
|
|
4574
4974
|
"auto-rotate",
|
|
@@ -4756,7 +5156,7 @@ var MapControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
4756
5156
|
"rotate-speed": __props.rotateSpeed,
|
|
4757
5157
|
"mouse-buttons": __props.mouseButtons,
|
|
4758
5158
|
"screen-space-panning": __props.screenSpacePanning
|
|
4759
|
-
}, null, 8, _hoisted_1$
|
|
5159
|
+
}, null, 8, _hoisted_1$56)) : createCommentVNode("v-if", true);
|
|
4760
5160
|
};
|
|
4761
5161
|
}
|
|
4762
5162
|
});
|
|
@@ -4767,7 +5167,7 @@ var MapControls_default = MapControls_vue_vue_type_script_setup_true_lang_defaul
|
|
|
4767
5167
|
|
|
4768
5168
|
//#endregion
|
|
4769
5169
|
//#region src/core/controls/OrbitControls.vue?vue&type=script&setup=true&lang.ts
|
|
4770
|
-
const _hoisted_1$
|
|
5170
|
+
const _hoisted_1$55 = [
|
|
4771
5171
|
"args",
|
|
4772
5172
|
"target",
|
|
4773
5173
|
"auto-rotate",
|
|
@@ -4955,7 +5355,7 @@ var OrbitControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
4955
5355
|
"rotate-speed": __props.rotateSpeed,
|
|
4956
5356
|
"mouse-buttons": __props.mouseButtons,
|
|
4957
5357
|
"screen-space-panning": __props.screenSpacePanning
|
|
4958
|
-
}, null, 8, _hoisted_1$
|
|
5358
|
+
}, null, 8, _hoisted_1$55)) : createCommentVNode("v-if", true);
|
|
4959
5359
|
};
|
|
4960
5360
|
}
|
|
4961
5361
|
});
|
|
@@ -4966,7 +5366,7 @@ var OrbitControls_default = OrbitControls_vue_vue_type_script_setup_true_lang_de
|
|
|
4966
5366
|
|
|
4967
5367
|
//#endregion
|
|
4968
5368
|
//#region src/core/controls/PointerLockControls.vue?vue&type=script&setup=true&lang.ts
|
|
4969
|
-
const _hoisted_1$
|
|
5369
|
+
const _hoisted_1$54 = ["args"];
|
|
4970
5370
|
var PointerLockControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4971
5371
|
__name: "PointerLockControls",
|
|
4972
5372
|
props: {
|
|
@@ -5038,7 +5438,7 @@ var PointerLockControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE
|
|
|
5038
5438
|
ref_key: "controlsRef",
|
|
5039
5439
|
ref: controlsRef,
|
|
5040
5440
|
args: [__props.camera || unref(activeCamera), __props.domElement || unref(renderer).domElement]
|
|
5041
|
-
}, null, 8, _hoisted_1$
|
|
5441
|
+
}, null, 8, _hoisted_1$54)) : createCommentVNode("v-if", true);
|
|
5042
5442
|
};
|
|
5043
5443
|
}
|
|
5044
5444
|
});
|
|
@@ -5191,7 +5591,7 @@ var ScrollControls_default = ScrollControls_vue_vue_type_script_setup_true_lang_
|
|
|
5191
5591
|
|
|
5192
5592
|
//#endregion
|
|
5193
5593
|
//#region src/core/controls/TransformControls.vue?vue&type=script&setup=true&lang.ts
|
|
5194
|
-
const _hoisted_1$
|
|
5594
|
+
const _hoisted_1$53 = [
|
|
5195
5595
|
"object",
|
|
5196
5596
|
"args",
|
|
5197
5597
|
"mode",
|
|
@@ -5354,7 +5754,7 @@ var TransformControls_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
5354
5754
|
"show-y": unref(showY),
|
|
5355
5755
|
"show-z": unref(showZ),
|
|
5356
5756
|
visible: true
|
|
5357
|
-
}, null, 8, _hoisted_1$
|
|
5757
|
+
}, null, 8, _hoisted_1$53)) : createCommentVNode("v-if", true);
|
|
5358
5758
|
};
|
|
5359
5759
|
}
|
|
5360
5760
|
});
|
|
@@ -5689,60 +6089,71 @@ var RandomizedLights = class extends Group {
|
|
|
5689
6089
|
castShadow = true;
|
|
5690
6090
|
/** Default shadow bias */
|
|
5691
6091
|
bias = 0;
|
|
6092
|
+
_mapSize = 512;
|
|
6093
|
+
_size = 10;
|
|
6094
|
+
_near = .5;
|
|
6095
|
+
_far = 500;
|
|
5692
6096
|
constructor(config = {}) {
|
|
5693
6097
|
super();
|
|
5694
6098
|
Object.assign(this, config);
|
|
5695
6099
|
if (this.count === 0) this.count = 8;
|
|
5696
|
-
if (!config.mapSize) this.mapSize = 512;
|
|
5697
|
-
if (!config.size) this.size = 10;
|
|
5698
|
-
if (!config.near) this.near = .5;
|
|
5699
|
-
if (!config.far) this.far = 500;
|
|
5700
6100
|
}
|
|
5701
6101
|
get length() {
|
|
5702
6102
|
return this.position.length();
|
|
5703
6103
|
}
|
|
5704
6104
|
set count(n) {
|
|
6105
|
+
for (const light of this.lights) light.dispose();
|
|
5705
6106
|
this.clear();
|
|
5706
6107
|
for (let i = 0; i < n; i++) this.add(new DirectionalLight("white", this.intensity));
|
|
6108
|
+
this.configureShadows();
|
|
5707
6109
|
}
|
|
5708
6110
|
get count() {
|
|
5709
6111
|
return this.children.filter((c) => "isDirectionalLight" in c).length;
|
|
5710
6112
|
}
|
|
5711
6113
|
get mapSize() {
|
|
5712
|
-
return this.
|
|
6114
|
+
return this._mapSize;
|
|
5713
6115
|
}
|
|
5714
6116
|
set mapSize(n) {
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
light.shadow.map?.setSize(n, n);
|
|
5718
|
-
}
|
|
6117
|
+
this._mapSize = n;
|
|
6118
|
+
this.configureShadows();
|
|
5719
6119
|
}
|
|
5720
6120
|
get size() {
|
|
5721
|
-
return this.
|
|
6121
|
+
return this._size;
|
|
5722
6122
|
}
|
|
5723
6123
|
set size(n) {
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
light.shadow.camera.right = n;
|
|
5727
|
-
light.shadow.camera.top = n;
|
|
5728
|
-
light.shadow.camera.bottom = -n;
|
|
5729
|
-
}
|
|
6124
|
+
this._size = n;
|
|
6125
|
+
this.configureShadows();
|
|
5730
6126
|
}
|
|
5731
6127
|
get near() {
|
|
5732
|
-
return this.
|
|
6128
|
+
return this._near;
|
|
5733
6129
|
}
|
|
5734
6130
|
set near(n) {
|
|
5735
|
-
|
|
6131
|
+
this._near = n;
|
|
6132
|
+
this.configureShadows();
|
|
5736
6133
|
}
|
|
5737
6134
|
get far() {
|
|
5738
|
-
return this.
|
|
6135
|
+
return this._far;
|
|
5739
6136
|
}
|
|
5740
6137
|
set far(n) {
|
|
5741
|
-
|
|
6138
|
+
this._far = n;
|
|
6139
|
+
this.configureShadows();
|
|
5742
6140
|
}
|
|
5743
6141
|
get lights() {
|
|
5744
6142
|
return this.children.filter((c) => "isDirectionalLight" in c);
|
|
5745
6143
|
}
|
|
6144
|
+
configureShadows() {
|
|
6145
|
+
for (const light of this.lights) {
|
|
6146
|
+
light.shadow.mapSize.set(this._mapSize, this._mapSize);
|
|
6147
|
+
light.shadow.map?.setSize(this._mapSize, this._mapSize);
|
|
6148
|
+
light.shadow.camera.left = -this._size;
|
|
6149
|
+
light.shadow.camera.right = this._size;
|
|
6150
|
+
light.shadow.camera.top = this._size;
|
|
6151
|
+
light.shadow.camera.bottom = -this._size;
|
|
6152
|
+
light.shadow.camera.near = this._near;
|
|
6153
|
+
light.shadow.camera.far = this._far;
|
|
6154
|
+
light.shadow.camera.updateProjectionMatrix();
|
|
6155
|
+
}
|
|
6156
|
+
}
|
|
5746
6157
|
update() {
|
|
5747
6158
|
const lights = this.lights;
|
|
5748
6159
|
const lightIntensity = this.intensity / lights.length;
|
|
@@ -5762,7 +6173,7 @@ var RandomizedLights = class extends Group {
|
|
|
5762
6173
|
|
|
5763
6174
|
//#endregion
|
|
5764
6175
|
//#region src/core/light-shadow/RandomizedLights/component.vue?vue&type=script&setup=true&lang.ts
|
|
5765
|
-
const _hoisted_1$
|
|
6176
|
+
const _hoisted_1$52 = [
|
|
5766
6177
|
"count",
|
|
5767
6178
|
"radius",
|
|
5768
6179
|
"intensity",
|
|
@@ -5863,7 +6274,7 @@ var component_vue_vue_type_script_setup_true_lang_default$14 = /* @__PURE__ */ d
|
|
|
5863
6274
|
near: __props.near,
|
|
5864
6275
|
far: __props.far,
|
|
5865
6276
|
position: pos.value
|
|
5866
|
-
}, null, 8, _hoisted_1$
|
|
6277
|
+
}, null, 8, _hoisted_1$52);
|
|
5867
6278
|
};
|
|
5868
6279
|
}
|
|
5869
6280
|
});
|
|
@@ -5957,6 +6368,8 @@ var ProgressiveLightMap = class {
|
|
|
5957
6368
|
this.renderer.clear();
|
|
5958
6369
|
this.renderer.setRenderTarget(null);
|
|
5959
6370
|
this.renderer.setClearColor(this.clearColor, this.clearAlpha);
|
|
6371
|
+
}
|
|
6372
|
+
prepare() {
|
|
5960
6373
|
this.lights = [];
|
|
5961
6374
|
this.meshes = [];
|
|
5962
6375
|
this.scene.traverse((object) => {
|
|
@@ -5970,8 +6383,6 @@ var ProgressiveLightMap = class {
|
|
|
5970
6383
|
intensity: object.intensity
|
|
5971
6384
|
});
|
|
5972
6385
|
});
|
|
5973
|
-
}
|
|
5974
|
-
prepare() {
|
|
5975
6386
|
this.lights.forEach((light) => light.object.intensity = 0);
|
|
5976
6387
|
this.meshes.forEach((mesh) => mesh.object.material = this.discardMat);
|
|
5977
6388
|
}
|
|
@@ -5990,13 +6401,22 @@ var ProgressiveLightMap = class {
|
|
|
5990
6401
|
const activeMap = this.buffer1Active ? this.progressiveLightMap1 : this.progressiveLightMap2;
|
|
5991
6402
|
const inactiveMap = this.buffer1Active ? this.progressiveLightMap2 : this.progressiveLightMap1;
|
|
5992
6403
|
const oldBg = this.scene.background;
|
|
6404
|
+
const oldEnv = this.scene.environment;
|
|
5993
6405
|
this.scene.background = null;
|
|
6406
|
+
this.scene.environment = null;
|
|
5994
6407
|
this.renderer.setRenderTarget(activeMap);
|
|
5995
6408
|
this.previousShadowMap.value = inactiveMap.texture;
|
|
5996
6409
|
this.buffer1Active = !this.buffer1Active;
|
|
5997
6410
|
this.renderer.render(this.scene, camera);
|
|
5998
6411
|
this.renderer.setRenderTarget(null);
|
|
5999
6412
|
this.scene.background = oldBg;
|
|
6413
|
+
this.scene.environment = oldEnv;
|
|
6414
|
+
}
|
|
6415
|
+
dispose() {
|
|
6416
|
+
this.progressiveLightMap1.dispose();
|
|
6417
|
+
this.progressiveLightMap2.dispose();
|
|
6418
|
+
this.discardMat.dispose();
|
|
6419
|
+
this.targetMat.dispose();
|
|
6000
6420
|
}
|
|
6001
6421
|
};
|
|
6002
6422
|
|
|
@@ -6027,8 +6447,8 @@ const SoftShadowMaterial = /* @__PURE__ */ shaderMaterial({
|
|
|
6027
6447
|
|
|
6028
6448
|
//#endregion
|
|
6029
6449
|
//#region src/core/light-shadow/AccumulativeShadows/component.vue?vue&type=script&setup=true&lang.ts
|
|
6030
|
-
const _hoisted_1$
|
|
6031
|
-
const _hoisted_2$
|
|
6450
|
+
const _hoisted_1$51 = ["scale", "rotation"];
|
|
6451
|
+
const _hoisted_2$28 = [
|
|
6032
6452
|
"alpha-test",
|
|
6033
6453
|
"blend",
|
|
6034
6454
|
"color",
|
|
@@ -6113,6 +6533,8 @@ var component_vue_vue_type_script_setup_true_lang_default$13 = /* @__PURE__ */ d
|
|
|
6113
6533
|
const gLights = shallowRef(new Group());
|
|
6114
6534
|
const progressiveLightMap = computed(() => new ProgressiveLightMap(renderer, scene.value, props.resolution));
|
|
6115
6535
|
const shadowMapTexture = shallowRef();
|
|
6536
|
+
watch(progressiveLightMap, (_, previous) => previous.dispose());
|
|
6537
|
+
onUnmounted(() => progressiveLightMap.value.dispose());
|
|
6116
6538
|
let frameCount = 0;
|
|
6117
6539
|
let frameLimitRemaining = props.limit;
|
|
6118
6540
|
function reset() {
|
|
@@ -6226,7 +6648,7 @@ var component_vue_vue_type_script_setup_true_lang_default$13 = /* @__PURE__ */ d
|
|
|
6226
6648
|
opacity: __props.opacity,
|
|
6227
6649
|
"tone-mapped": __props.toneMapped,
|
|
6228
6650
|
transparent: true
|
|
6229
|
-
}, null, 8, _hoisted_2$
|
|
6651
|
+
}, null, 8, _hoisted_2$28)], 8, _hoisted_1$51)], 512);
|
|
6230
6652
|
};
|
|
6231
6653
|
}
|
|
6232
6654
|
});
|
|
@@ -6252,8 +6674,8 @@ const BakeShadows = defineComponent({
|
|
|
6252
6674
|
|
|
6253
6675
|
//#endregion
|
|
6254
6676
|
//#region src/core/light-shadow/CircleShadow.vue?vue&type=script&setup=true&lang.ts
|
|
6255
|
-
const _hoisted_1$
|
|
6256
|
-
const _hoisted_2$
|
|
6677
|
+
const _hoisted_1$50 = ["rotation-x"];
|
|
6678
|
+
const _hoisted_2$27 = [
|
|
6257
6679
|
"opacity",
|
|
6258
6680
|
"fog",
|
|
6259
6681
|
"depth-write",
|
|
@@ -6326,7 +6748,7 @@ var CircleShadow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
6326
6748
|
"depth-write": __props.depthWrite,
|
|
6327
6749
|
side: unref(DoubleSide),
|
|
6328
6750
|
map: unref(texture$1)
|
|
6329
|
-
}, null, 8, _hoisted_2$
|
|
6751
|
+
}, null, 8, _hoisted_2$27)], 8, _hoisted_1$50);
|
|
6330
6752
|
};
|
|
6331
6753
|
}
|
|
6332
6754
|
});
|
|
@@ -6337,7 +6759,7 @@ var CircleShadow_default = CircleShadow_vue_vue_type_script_setup_true_lang_defa
|
|
|
6337
6759
|
|
|
6338
6760
|
//#endregion
|
|
6339
6761
|
//#region src/core/light-shadow/ContactShadows.vue?vue&type=script&setup=true&lang.ts
|
|
6340
|
-
const _hoisted_1$
|
|
6762
|
+
const _hoisted_1$49 = ["object"];
|
|
6341
6763
|
var ContactShadows_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6342
6764
|
__name: "ContactShadows",
|
|
6343
6765
|
props: {
|
|
@@ -6545,7 +6967,7 @@ var ContactShadows_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
6545
6967
|
});
|
|
6546
6968
|
__expose({ instance: pool.shadowGroup });
|
|
6547
6969
|
return (_ctx, _cache) => {
|
|
6548
|
-
return openBlock(), createElementBlock("primitive", { object: unref(pool).shadowGroup }, null, 8, _hoisted_1$
|
|
6970
|
+
return openBlock(), createElementBlock("primitive", { object: unref(pool).shadowGroup }, null, 8, _hoisted_1$49);
|
|
6549
6971
|
};
|
|
6550
6972
|
}
|
|
6551
6973
|
});
|
|
@@ -7572,8 +7994,8 @@ function useSVG(path, options = {}) {
|
|
|
7572
7994
|
|
|
7573
7995
|
//#endregion
|
|
7574
7996
|
//#region src/core/loaders/useSVG/component.vue?vue&type=script&setup=true&lang.ts
|
|
7575
|
-
const _hoisted_1$
|
|
7576
|
-
const _hoisted_2$
|
|
7997
|
+
const _hoisted_1$48 = { key: 0 };
|
|
7998
|
+
const _hoisted_2$26 = ["geometry", "render-order"];
|
|
7577
7999
|
var component_vue_vue_type_script_setup_true_lang_default$11 = /* @__PURE__ */ defineComponent({
|
|
7578
8000
|
__name: "component",
|
|
7579
8001
|
props: {
|
|
@@ -7630,11 +8052,11 @@ var component_vue_vue_type_script_setup_true_lang_default$11 = /* @__PURE__ */ d
|
|
|
7630
8052
|
dispose();
|
|
7631
8053
|
});
|
|
7632
8054
|
return (_ctx, _cache) => {
|
|
7633
|
-
return !unref(isLoading) ? (openBlock(), createElementBlock("TresGroup", _hoisted_1$
|
|
8055
|
+
return !unref(isLoading) ? (openBlock(), createElementBlock("TresGroup", _hoisted_1$48, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(layers), ({ geometry, material, isStroke }, i) => {
|
|
7634
8056
|
return openBlock(), createElementBlock("TresMesh", mergeProps({ key: `${i}` }, { ref_for: true }, isStroke ? props.strokeMeshProps : props.fillMeshProps, {
|
|
7635
8057
|
geometry,
|
|
7636
8058
|
"render-order": props.depth === "renderOrder" ? i : 0
|
|
7637
|
-
}), [createElementVNode("TresMeshBasicMaterial", mergeProps({ ref_for: true }, material), null, 16)], 16, _hoisted_2$
|
|
8059
|
+
}), [createElementVNode("TresMeshBasicMaterial", mergeProps({ ref_for: true }, material), null, 16)], 16, _hoisted_2$26);
|
|
7638
8060
|
}), 128))])) : createCommentVNode("v-if", true);
|
|
7639
8061
|
};
|
|
7640
8062
|
}
|
|
@@ -7681,7 +8103,7 @@ function useFBX(path, options) {
|
|
|
7681
8103
|
|
|
7682
8104
|
//#endregion
|
|
7683
8105
|
//#region src/core/loaders/useFBX/component.vue?vue&type=script&setup=true&lang.ts
|
|
7684
|
-
const _hoisted_1$
|
|
8106
|
+
const _hoisted_1$47 = ["object"];
|
|
7685
8107
|
var component_vue_vue_type_script_setup_true_lang_default$10 = /* @__PURE__ */ defineComponent({
|
|
7686
8108
|
__name: "component",
|
|
7687
8109
|
props: {
|
|
@@ -7716,7 +8138,7 @@ var component_vue_vue_type_script_setup_true_lang_default$10 = /* @__PURE__ */ d
|
|
|
7716
8138
|
return !unref(isLoading) && unref(model) ? (openBlock(), createElementBlock("primitive", {
|
|
7717
8139
|
key: 0,
|
|
7718
8140
|
object: unref(model)
|
|
7719
|
-
}, null, 8, _hoisted_1$
|
|
8141
|
+
}, null, 8, _hoisted_1$47)) : createCommentVNode("v-if", true);
|
|
7720
8142
|
};
|
|
7721
8143
|
}
|
|
7722
8144
|
});
|
|
@@ -7739,6 +8161,17 @@ var component_default$5 = component_vue_vue_type_script_setup_true_lang_default$
|
|
|
7739
8161
|
* const { state: model } = useGLTF('/path/to/model.glb', { draco: true })
|
|
7740
8162
|
* ```
|
|
7741
8163
|
*
|
|
8164
|
+
* The shape of `nodes` and `materials` is only known once the model is loaded, so both
|
|
8165
|
+
* default to a loose record. Pass the model's own shape to get them typed — `tres gltf`
|
|
8166
|
+
* generates those interfaces for you:
|
|
8167
|
+
*
|
|
8168
|
+
* @example
|
|
8169
|
+
* ```ts
|
|
8170
|
+
* interface ModelNodes { Body: SkinnedMesh }
|
|
8171
|
+
* interface ModelMaterials { Skin: MeshStandardMaterial }
|
|
8172
|
+
* const { nodes, materials } = useGLTF<ModelNodes, ModelMaterials>('/path/to/model.glb')
|
|
8173
|
+
* ```
|
|
8174
|
+
*
|
|
7742
8175
|
* @param {MaybeRef<string>} path - Path to the GLTF model file
|
|
7743
8176
|
* @param {UseGLTFOptions} options - Options for loading the model
|
|
7744
8177
|
* @returns {{ state: GLTF, isLoading: boolean, execute: () => Promise<void> }} Object containing the model state, loading state and reload function
|
|
@@ -7771,7 +8204,7 @@ function useGLTF(path, options) {
|
|
|
7771
8204
|
|
|
7772
8205
|
//#endregion
|
|
7773
8206
|
//#region src/core/loaders/useGLTF/component.vue?vue&type=script&setup=true&lang.ts
|
|
7774
|
-
const _hoisted_1$
|
|
8207
|
+
const _hoisted_1$46 = ["object"];
|
|
7775
8208
|
var component_vue_vue_type_script_setup_true_lang_default$9 = /* @__PURE__ */ defineComponent({
|
|
7776
8209
|
__name: "component",
|
|
7777
8210
|
props: {
|
|
@@ -7819,7 +8252,7 @@ var component_vue_vue_type_script_setup_true_lang_default$9 = /* @__PURE__ */ de
|
|
|
7819
8252
|
return !unref(isLoading) && unref(state)?.scene ? (openBlock(), createElementBlock("primitive", {
|
|
7820
8253
|
key: 0,
|
|
7821
8254
|
object: unref(state)?.scene
|
|
7822
|
-
}, null, 8, _hoisted_1$
|
|
8255
|
+
}, null, 8, _hoisted_1$46)) : createCommentVNode("v-if", true);
|
|
7823
8256
|
};
|
|
7824
8257
|
}
|
|
7825
8258
|
});
|
|
@@ -7881,7 +8314,8 @@ function useProgress() {
|
|
|
7881
8314
|
const progress = ref(0);
|
|
7882
8315
|
const items = ref([]);
|
|
7883
8316
|
return new Promise((resolve) => {
|
|
7884
|
-
DefaultLoadingManager.onStart = () => {
|
|
8317
|
+
DefaultLoadingManager.onStart = (_url, itemsLoaded) => {
|
|
8318
|
+
saveLastTotalLoaded = itemsLoaded;
|
|
7885
8319
|
hasFinishLoading.value = false;
|
|
7886
8320
|
};
|
|
7887
8321
|
DefaultLoadingManager.onLoad = () => {
|
|
@@ -8020,8 +8454,8 @@ function useTextures(paths) {
|
|
|
8020
8454
|
|
|
8021
8455
|
//#endregion
|
|
8022
8456
|
//#region src/core/materials/customShaderMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8023
|
-
const _hoisted_1$
|
|
8024
|
-
var index_vue_vue_type_script_setup_true_lang_default$
|
|
8457
|
+
const _hoisted_1$45 = ["args"];
|
|
8458
|
+
var index_vue_vue_type_script_setup_true_lang_default$8 = /* @__PURE__ */ defineComponent({
|
|
8025
8459
|
__name: "index",
|
|
8026
8460
|
props: {
|
|
8027
8461
|
baseMaterial: {
|
|
@@ -8059,14 +8493,14 @@ var index_vue_vue_type_script_setup_true_lang_default$7 = /* @__PURE__ */ define
|
|
|
8059
8493
|
ref_key: "customShaderMaterialClass",
|
|
8060
8494
|
ref: customShaderMaterialClass,
|
|
8061
8495
|
args: [props]
|
|
8062
|
-
}, null, 8, _hoisted_1$
|
|
8496
|
+
}, null, 8, _hoisted_1$45);
|
|
8063
8497
|
};
|
|
8064
8498
|
}
|
|
8065
8499
|
});
|
|
8066
8500
|
|
|
8067
8501
|
//#endregion
|
|
8068
8502
|
//#region src/core/materials/customShaderMaterial/index.vue
|
|
8069
|
-
var customShaderMaterial_default = index_vue_vue_type_script_setup_true_lang_default$
|
|
8503
|
+
var customShaderMaterial_default = index_vue_vue_type_script_setup_true_lang_default$8;
|
|
8070
8504
|
|
|
8071
8505
|
//#endregion
|
|
8072
8506
|
//#region src/core/materials/holographicMaterial/HolographicMaterialParameters.ts
|
|
@@ -8247,7 +8681,7 @@ var HolographicMaterialParameters_default = HolographicMaterial;
|
|
|
8247
8681
|
|
|
8248
8682
|
//#endregion
|
|
8249
8683
|
//#region src/core/materials/holographicMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8250
|
-
const _hoisted_1$
|
|
8684
|
+
const _hoisted_1$44 = [
|
|
8251
8685
|
"uniforms-fresnelAmount-value",
|
|
8252
8686
|
"uniforms-enableBlinking-value",
|
|
8253
8687
|
"uniforms-fresnelOpacity-value",
|
|
@@ -8260,7 +8694,7 @@ const _hoisted_1$42 = [
|
|
|
8260
8694
|
"enableAdditive",
|
|
8261
8695
|
"side"
|
|
8262
8696
|
];
|
|
8263
|
-
var index_vue_vue_type_script_setup_true_lang_default$
|
|
8697
|
+
var index_vue_vue_type_script_setup_true_lang_default$7 = /* @__PURE__ */ defineComponent({
|
|
8264
8698
|
__name: "index",
|
|
8265
8699
|
props: {
|
|
8266
8700
|
fresnelAmount: {
|
|
@@ -8348,18 +8782,18 @@ var index_vue_vue_type_script_setup_true_lang_default$6 = /* @__PURE__ */ define
|
|
|
8348
8782
|
"uniforms-blinkFresnelOnly-value": props.blinkFresnelOnly,
|
|
8349
8783
|
enableAdditive: props.enableAdditive,
|
|
8350
8784
|
side: props.side
|
|
8351
|
-
}, null, 8, _hoisted_1$
|
|
8785
|
+
}, null, 8, _hoisted_1$44);
|
|
8352
8786
|
};
|
|
8353
8787
|
}
|
|
8354
8788
|
});
|
|
8355
8789
|
|
|
8356
8790
|
//#endregion
|
|
8357
8791
|
//#region src/core/materials/holographicMaterial/index.vue
|
|
8358
|
-
var holographicMaterial_default = index_vue_vue_type_script_setup_true_lang_default$
|
|
8792
|
+
var holographicMaterial_default = index_vue_vue_type_script_setup_true_lang_default$7;
|
|
8359
8793
|
|
|
8360
8794
|
//#endregion
|
|
8361
8795
|
//#region src/core/materials/meshDiscardMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8362
|
-
var index_vue_vue_type_script_setup_true_lang_default$
|
|
8796
|
+
var index_vue_vue_type_script_setup_true_lang_default$6 = /* @__PURE__ */ defineComponent({
|
|
8363
8797
|
__name: "index",
|
|
8364
8798
|
setup(__props, { expose: __expose }) {
|
|
8365
8799
|
const meshDiscardMaterialRef = shallowRef();
|
|
@@ -8377,7 +8811,7 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /* @__PURE__ */ define
|
|
|
8377
8811
|
|
|
8378
8812
|
//#endregion
|
|
8379
8813
|
//#region src/core/materials/meshDiscardMaterial/index.vue
|
|
8380
|
-
var meshDiscardMaterial_default = index_vue_vue_type_script_setup_true_lang_default$
|
|
8814
|
+
var meshDiscardMaterial_default = index_vue_vue_type_script_setup_true_lang_default$6;
|
|
8381
8815
|
|
|
8382
8816
|
//#endregion
|
|
8383
8817
|
//#region src/core/materials/meshGlassMaterial/material.ts
|
|
@@ -8479,7 +8913,7 @@ var material_default = MeshGlassMaterial;
|
|
|
8479
8913
|
|
|
8480
8914
|
//#endregion
|
|
8481
8915
|
//#region src/core/materials/meshGlassMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8482
|
-
var index_vue_vue_type_script_setup_true_lang_default$
|
|
8916
|
+
var index_vue_vue_type_script_setup_true_lang_default$5 = /* @__PURE__ */ defineComponent({
|
|
8483
8917
|
__name: "index",
|
|
8484
8918
|
setup(__props, { expose: __expose }) {
|
|
8485
8919
|
const MeshGlassMaterialClass = shallowRef();
|
|
@@ -8487,17 +8921,216 @@ var index_vue_vue_type_script_setup_true_lang_default$4 = /* @__PURE__ */ define
|
|
|
8487
8921
|
extend$1({ MeshGlassMaterial: material_default });
|
|
8488
8922
|
__expose({ instance: MeshGlassMaterialClass });
|
|
8489
8923
|
return (_ctx, _cache) => {
|
|
8490
|
-
return openBlock(), createElementBlock("TresMeshGlassMaterial", {
|
|
8491
|
-
ref_key: "MeshGlassMaterialClass",
|
|
8492
|
-
ref: MeshGlassMaterialClass
|
|
8493
|
-
}, null, 512);
|
|
8924
|
+
return openBlock(), createElementBlock("TresMeshGlassMaterial", {
|
|
8925
|
+
ref_key: "MeshGlassMaterialClass",
|
|
8926
|
+
ref: MeshGlassMaterialClass
|
|
8927
|
+
}, null, 512);
|
|
8928
|
+
};
|
|
8929
|
+
}
|
|
8930
|
+
});
|
|
8931
|
+
|
|
8932
|
+
//#endregion
|
|
8933
|
+
//#region src/core/materials/meshGlassMaterial/index.vue
|
|
8934
|
+
var meshGlassMaterial_default = index_vue_vue_type_script_setup_true_lang_default$5;
|
|
8935
|
+
|
|
8936
|
+
//#endregion
|
|
8937
|
+
//#region src/core/materials/meshPortalMaterial/PortalMaterialImpl.ts
|
|
8938
|
+
/**
|
|
8939
|
+
* Window-pass material for MeshPortalMaterial.
|
|
8940
|
+
* Samples the portal FBO in screen space so the mesh becomes a perspective-correct
|
|
8941
|
+
* cutout window into the portal scene. Empty portal areas (alpha 0) show the world.
|
|
8942
|
+
* Ported from drei's PortalMaterialImpl (blur/sdf deferred).
|
|
8943
|
+
*/
|
|
8944
|
+
var PortalMaterialImpl = class extends ShaderMaterial {
|
|
8945
|
+
constructor() {
|
|
8946
|
+
super({
|
|
8947
|
+
transparent: true,
|
|
8948
|
+
uniforms: {
|
|
8949
|
+
map: { value: null },
|
|
8950
|
+
resolution: { value: new Vector2() }
|
|
8951
|
+
},
|
|
8952
|
+
vertexShader: `
|
|
8953
|
+
void main() {
|
|
8954
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8955
|
+
}
|
|
8956
|
+
`,
|
|
8957
|
+
fragmentShader: `
|
|
8958
|
+
uniform sampler2D map;
|
|
8959
|
+
uniform vec2 resolution;
|
|
8960
|
+
void main() {
|
|
8961
|
+
// Sample the portal FBO in screen space so the mesh reads as a window.
|
|
8962
|
+
vec2 uv = gl_FragCoord.xy / resolution.xy;
|
|
8963
|
+
vec4 t = texture2D(map, uv);
|
|
8964
|
+
gl_FragColor = vec4(t.rgb, t.a);
|
|
8965
|
+
#include <tonemapping_fragment>
|
|
8966
|
+
#include <colorspace_fragment>
|
|
8967
|
+
}
|
|
8968
|
+
`
|
|
8969
|
+
});
|
|
8970
|
+
}
|
|
8971
|
+
get map() {
|
|
8972
|
+
return this.uniforms.map.value;
|
|
8973
|
+
}
|
|
8974
|
+
set map(v) {
|
|
8975
|
+
this.uniforms.map.value = v;
|
|
8976
|
+
}
|
|
8977
|
+
};
|
|
8978
|
+
|
|
8979
|
+
//#endregion
|
|
8980
|
+
//#region src/core/materials/meshPortalMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8981
|
+
var index_vue_vue_type_script_setup_true_lang_default$4 = /* @__PURE__ */ defineComponent({
|
|
8982
|
+
__name: "index",
|
|
8983
|
+
props: {
|
|
8984
|
+
blend: {
|
|
8985
|
+
type: Number,
|
|
8986
|
+
required: false,
|
|
8987
|
+
default: 0
|
|
8988
|
+
},
|
|
8989
|
+
resolution: {
|
|
8990
|
+
type: Number,
|
|
8991
|
+
required: false,
|
|
8992
|
+
default: 512
|
|
8993
|
+
},
|
|
8994
|
+
worldUnits: {
|
|
8995
|
+
type: Boolean,
|
|
8996
|
+
required: false,
|
|
8997
|
+
default: false
|
|
8998
|
+
},
|
|
8999
|
+
renderPriority: {
|
|
9000
|
+
type: Number,
|
|
9001
|
+
required: false,
|
|
9002
|
+
default: 0
|
|
9003
|
+
}
|
|
9004
|
+
},
|
|
9005
|
+
setup(__props, { expose: __expose }) {
|
|
9006
|
+
const props = __props;
|
|
9007
|
+
const { extend: extend$1, invalidate } = useTres();
|
|
9008
|
+
extend$1({ PortalMaterialImpl });
|
|
9009
|
+
const materialRef = shallowRef();
|
|
9010
|
+
const portalScene = new Scene();
|
|
9011
|
+
portalScene.matrixAutoUpdate = false;
|
|
9012
|
+
provide(INJECTION_KEY, {
|
|
9013
|
+
...useTresContext(),
|
|
9014
|
+
scene: shallowRef(portalScene)
|
|
9015
|
+
});
|
|
9016
|
+
const rtOptions = {
|
|
9017
|
+
minFilter: LinearFilter,
|
|
9018
|
+
magFilter: LinearFilter,
|
|
9019
|
+
type: HalfFloatType
|
|
9020
|
+
};
|
|
9021
|
+
const fboMap = new WebGLRenderTarget(props.resolution, props.resolution, rtOptions);
|
|
9022
|
+
const buffer1 = new WebGLRenderTarget(1, 1, rtOptions);
|
|
9023
|
+
const buffer2 = new WebGLRenderTarget(1, 1, rtOptions);
|
|
9024
|
+
watch(() => props.resolution, (res) => fboMap.setSize(res, res));
|
|
9025
|
+
const quadScene = new Scene();
|
|
9026
|
+
const quadCamera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
9027
|
+
const quadMaterial = new ShaderMaterial({
|
|
9028
|
+
uniforms: {
|
|
9029
|
+
a: { value: buffer1.texture },
|
|
9030
|
+
b: { value: buffer2.texture },
|
|
9031
|
+
blend: { value: 0 }
|
|
9032
|
+
},
|
|
9033
|
+
vertexShader: `
|
|
9034
|
+
varying vec2 vUv;
|
|
9035
|
+
void main() { vUv = uv; gl_Position = vec4(position, 1.0); }
|
|
9036
|
+
`,
|
|
9037
|
+
fragmentShader: `
|
|
9038
|
+
uniform sampler2D a;
|
|
9039
|
+
uniform sampler2D b;
|
|
9040
|
+
uniform float blend;
|
|
9041
|
+
varying vec2 vUv;
|
|
9042
|
+
void main() { gl_FragColor = mix(texture2D(b, vUv), texture2D(a, vUv), blend); }
|
|
9043
|
+
`
|
|
9044
|
+
});
|
|
9045
|
+
const quadGeometry = new PlaneGeometry(2, 2);
|
|
9046
|
+
quadScene.add(new Mesh(quadGeometry, quadMaterial));
|
|
9047
|
+
const { onBeforeRender, onRender } = useLoop();
|
|
9048
|
+
const drawSize = new Vector2();
|
|
9049
|
+
let hasWarnedWebGPU = false;
|
|
9050
|
+
function isWebGL(r) {
|
|
9051
|
+
if (r?.isWebGPURenderer) {
|
|
9052
|
+
if (!hasWarnedWebGPU) {
|
|
9053
|
+
logWarning("MeshPortalMaterial: WebGPURenderer is not supported yet");
|
|
9054
|
+
hasWarnedWebGPU = true;
|
|
9055
|
+
}
|
|
9056
|
+
return false;
|
|
9057
|
+
}
|
|
9058
|
+
return r instanceof WebGLRenderer;
|
|
9059
|
+
}
|
|
9060
|
+
onBeforeRender(({ renderer, camera }) => {
|
|
9061
|
+
const mat = materialRef.value;
|
|
9062
|
+
if (!mat || !isWebGL(renderer)) return;
|
|
9063
|
+
const host = mat.__tres?.parent;
|
|
9064
|
+
const cam = camera.value;
|
|
9065
|
+
if (!host || !cam) return;
|
|
9066
|
+
if (props.worldUnits) portalScene.matrixWorld.identity();
|
|
9067
|
+
else {
|
|
9068
|
+
if (props.blend === 1) host.updateWorldMatrix(true, false);
|
|
9069
|
+
portalScene.matrixWorld.copy(host.matrixWorld);
|
|
9070
|
+
}
|
|
9071
|
+
invalidate();
|
|
9072
|
+
renderer.getDrawingBufferSize(drawSize);
|
|
9073
|
+
mat.uniforms.resolution.value.copy(drawSize);
|
|
9074
|
+
const prevAlpha = renderer.getClearAlpha();
|
|
9075
|
+
renderer.setClearAlpha(0);
|
|
9076
|
+
renderer.setRenderTarget(fboMap);
|
|
9077
|
+
renderer.clear();
|
|
9078
|
+
renderer.render(portalScene, cam);
|
|
9079
|
+
renderer.setRenderTarget(null);
|
|
9080
|
+
renderer.setClearAlpha(prevAlpha);
|
|
9081
|
+
mat.map = fboMap.texture;
|
|
9082
|
+
}, Number.POSITIVE_INFINITY);
|
|
9083
|
+
onRender(({ renderer, scene, camera }) => {
|
|
9084
|
+
if (!materialRef.value || !isWebGL(renderer)) return;
|
|
9085
|
+
const cam = camera.value;
|
|
9086
|
+
if (!cam) return;
|
|
9087
|
+
const blend = props.blend;
|
|
9088
|
+
if (blend <= 0) return;
|
|
9089
|
+
if (blend >= 1) {
|
|
9090
|
+
renderer.render(portalScene, cam);
|
|
9091
|
+
return;
|
|
9092
|
+
}
|
|
9093
|
+
renderer.getDrawingBufferSize(drawSize);
|
|
9094
|
+
if (buffer1.width !== drawSize.x || buffer1.height !== drawSize.y) {
|
|
9095
|
+
buffer1.setSize(drawSize.x, drawSize.y);
|
|
9096
|
+
buffer2.setSize(drawSize.x, drawSize.y);
|
|
9097
|
+
}
|
|
9098
|
+
quadMaterial.uniforms.blend.value = blend;
|
|
9099
|
+
const prevAlpha = renderer.getClearAlpha();
|
|
9100
|
+
renderer.setClearAlpha(1);
|
|
9101
|
+
renderer.setRenderTarget(buffer1);
|
|
9102
|
+
renderer.clear();
|
|
9103
|
+
renderer.render(portalScene, cam);
|
|
9104
|
+
renderer.setRenderTarget(buffer2);
|
|
9105
|
+
renderer.clear();
|
|
9106
|
+
renderer.render(scene.value, cam);
|
|
9107
|
+
renderer.setRenderTarget(null);
|
|
9108
|
+
renderer.render(quadScene, quadCamera);
|
|
9109
|
+
renderer.setClearAlpha(prevAlpha);
|
|
9110
|
+
}, props.renderPriority);
|
|
9111
|
+
onBeforeUnmount(() => {
|
|
9112
|
+
fboMap.dispose();
|
|
9113
|
+
buffer1.dispose();
|
|
9114
|
+
buffer2.dispose();
|
|
9115
|
+
quadGeometry.dispose();
|
|
9116
|
+
quadMaterial.dispose();
|
|
9117
|
+
});
|
|
9118
|
+
__expose({ instance: materialRef });
|
|
9119
|
+
return (_ctx, _cache) => {
|
|
9120
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("TresPortalMaterialImpl", {
|
|
9121
|
+
ref_key: "materialRef",
|
|
9122
|
+
ref: materialRef
|
|
9123
|
+
}, null, 512), createVNode(unref(TresPortal), { to: unref(portalScene) }, {
|
|
9124
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
9125
|
+
_: 3
|
|
9126
|
+
}, 8, ["to"])], 64);
|
|
8494
9127
|
};
|
|
8495
9128
|
}
|
|
8496
9129
|
});
|
|
8497
9130
|
|
|
8498
9131
|
//#endregion
|
|
8499
|
-
//#region src/core/materials/
|
|
8500
|
-
var
|
|
9132
|
+
//#region src/core/materials/meshPortalMaterial/index.vue
|
|
9133
|
+
var meshPortalMaterial_default = index_vue_vue_type_script_setup_true_lang_default$4;
|
|
8501
9134
|
|
|
8502
9135
|
//#endregion
|
|
8503
9136
|
//#region src/utils/constants.ts
|
|
@@ -8916,7 +9549,7 @@ var MeshReflectionMaterial = class extends MeshStandardMaterial {
|
|
|
8916
9549
|
|
|
8917
9550
|
//#endregion
|
|
8918
9551
|
//#region src/core/materials/meshReflectionMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
8919
|
-
const _hoisted_1$
|
|
9552
|
+
const _hoisted_1$43 = [
|
|
8920
9553
|
"texture-matrix",
|
|
8921
9554
|
"t-sharp",
|
|
8922
9555
|
"t-depth",
|
|
@@ -9168,6 +9801,10 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /* @__PURE__ */ define
|
|
|
9168
9801
|
const hasDepth = computed(() => props.sharpDepthScale > 0 || props.blurDepthScale > 0);
|
|
9169
9802
|
const hasDistortion = computed(() => !!props.distortionMap);
|
|
9170
9803
|
const hasRoughness = computed(() => !!props.roughnessMap);
|
|
9804
|
+
const tresProps = computed(() => {
|
|
9805
|
+
const { resolution: _r, blurSize: _bs, blurDepthEdgeMin: _bdemin, blurDepthEdgeMax: _bdemax, blurDepthScale: _bds, blurDepthBias: _bdb, reflectorOffset: _ro, ...rest } = props;
|
|
9806
|
+
return rest;
|
|
9807
|
+
});
|
|
9171
9808
|
const materialRef = shallowRef();
|
|
9172
9809
|
let blurpass;
|
|
9173
9810
|
const state = {
|
|
@@ -9314,7 +9951,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /* @__PURE__ */ define
|
|
|
9314
9951
|
key: `key${hasBlur.value ? "0" : "1"}${hasDepth.value ? "0" : "1"}${hasDistortion.value ? "0" : "1"}${hasRoughness.value ? "0" : "1"}`,
|
|
9315
9952
|
ref_key: "materialRef",
|
|
9316
9953
|
ref: materialRef
|
|
9317
|
-
},
|
|
9954
|
+
}, tresProps.value, {
|
|
9318
9955
|
"texture-matrix": state.textureMatrix,
|
|
9319
9956
|
"t-sharp": unref(fboSharp)?.texture,
|
|
9320
9957
|
"t-depth": unref(fboSharp)?.depthTexture,
|
|
@@ -9322,7 +9959,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /* @__PURE__ */ define
|
|
|
9322
9959
|
"defines-USE_BLUR": hasBlur.value ? "" : void 0,
|
|
9323
9960
|
"defines-USE_DEPTH": hasDepth.value ? "" : void 0,
|
|
9324
9961
|
"defines-USE_DISTORTION": hasDistortion.value ? "" : void 0
|
|
9325
|
-
}), null, 16, _hoisted_1$
|
|
9962
|
+
}), null, 16, _hoisted_1$43);
|
|
9326
9963
|
};
|
|
9327
9964
|
}
|
|
9328
9965
|
});
|
|
@@ -9578,7 +10215,7 @@ var MeshTransmissionMaterial = class extends MeshPhysicalMaterial {
|
|
|
9578
10215
|
|
|
9579
10216
|
//#endregion
|
|
9580
10217
|
//#region src/core/materials/meshTransmissionMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
9581
|
-
const _hoisted_1$
|
|
10218
|
+
const _hoisted_1$42 = ["args"];
|
|
9582
10219
|
var index_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({
|
|
9583
10220
|
__name: "index",
|
|
9584
10221
|
props: {
|
|
@@ -9781,7 +10418,7 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ define
|
|
|
9781
10418
|
ref_key: "materialRef",
|
|
9782
10419
|
ref: materialRef,
|
|
9783
10420
|
args: constructorArgs.value
|
|
9784
|
-
}, tresProps.value), null, 16, _hoisted_1$
|
|
10421
|
+
}, tresProps.value), null, 16, _hoisted_1$42);
|
|
9785
10422
|
};
|
|
9786
10423
|
}
|
|
9787
10424
|
});
|
|
@@ -9833,7 +10470,7 @@ var WobbleMaterialImpl = class extends MeshStandardMaterial {
|
|
|
9833
10470
|
|
|
9834
10471
|
//#endregion
|
|
9835
10472
|
//#region src/core/materials/meshWobbleMaterial/index.vue?vue&type=script&setup=true&lang.ts
|
|
9836
|
-
const _hoisted_1$
|
|
10473
|
+
const _hoisted_1$41 = ["factor"];
|
|
9837
10474
|
var index_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
|
|
9838
10475
|
__name: "index",
|
|
9839
10476
|
props: {
|
|
@@ -9869,7 +10506,7 @@ var index_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ define
|
|
|
9869
10506
|
ref_key: "materialRef",
|
|
9870
10507
|
ref: materialRef,
|
|
9871
10508
|
factor: __props.factor
|
|
9872
|
-
}, null, 8, _hoisted_1$
|
|
10509
|
+
}, null, 8, _hoisted_1$41);
|
|
9873
10510
|
};
|
|
9874
10511
|
}
|
|
9875
10512
|
});
|
|
@@ -9902,7 +10539,7 @@ var PointMaterial = class extends PointsMaterial {
|
|
|
9902
10539
|
|
|
9903
10540
|
//#endregion
|
|
9904
10541
|
//#region src/core/materials/pointMaterial/component.vue?vue&type=script&setup=true&lang.ts
|
|
9905
|
-
const _hoisted_1$
|
|
10542
|
+
const _hoisted_1$40 = ["object"];
|
|
9906
10543
|
var component_vue_vue_type_script_setup_true_lang_default$7 = /* @__PURE__ */ defineComponent({
|
|
9907
10544
|
__name: "component",
|
|
9908
10545
|
props: { sizeAttenuation: {
|
|
@@ -9922,7 +10559,7 @@ var component_vue_vue_type_script_setup_true_lang_default$7 = /* @__PURE__ */ de
|
|
|
9922
10559
|
});
|
|
9923
10560
|
__expose({ instance: materialRef });
|
|
9924
10561
|
return (_ctx, _cache) => {
|
|
9925
|
-
return openBlock(), createElementBlock("primitive", { object: materialRef.value }, null, 8, _hoisted_1$
|
|
10562
|
+
return openBlock(), createElementBlock("primitive", { object: materialRef.value }, null, 8, _hoisted_1$40);
|
|
9926
10563
|
};
|
|
9927
10564
|
}
|
|
9928
10565
|
});
|
|
@@ -10175,7 +10812,7 @@ function _resetGoal(goal) {
|
|
|
10175
10812
|
|
|
10176
10813
|
//#endregion
|
|
10177
10814
|
//#region src/core/miscellaneous/Bounds/component.vue?vue&type=script&setup=true&lang.ts
|
|
10178
|
-
const _hoisted_1$
|
|
10815
|
+
const _hoisted_1$39 = [
|
|
10179
10816
|
"object",
|
|
10180
10817
|
"duration",
|
|
10181
10818
|
"offset"
|
|
@@ -10264,7 +10901,7 @@ var component_vue_vue_type_script_setup_true_lang_default$6 = /* @__PURE__ */ de
|
|
|
10264
10901
|
object: unref(bounds),
|
|
10265
10902
|
duration: __props.duration,
|
|
10266
10903
|
offset: __props.offset
|
|
10267
|
-
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
10904
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$39);
|
|
10268
10905
|
};
|
|
10269
10906
|
}
|
|
10270
10907
|
});
|
|
@@ -10384,7 +11021,7 @@ var MouseParallax_default = MouseParallax_vue_vue_type_script_setup_true_lang_de
|
|
|
10384
11021
|
|
|
10385
11022
|
//#endregion
|
|
10386
11023
|
//#region src/core/miscellaneous/PositionalAudio.vue?vue&type=script&setup=true&lang.ts
|
|
10387
|
-
const _hoisted_1$
|
|
11024
|
+
const _hoisted_1$38 = ["args"];
|
|
10388
11025
|
var PositionalAudio_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
10389
11026
|
__name: "PositionalAudio",
|
|
10390
11027
|
props: {
|
|
@@ -10539,7 +11176,7 @@ var PositionalAudio_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
10539
11176
|
ref_key: "positionalAudioRef",
|
|
10540
11177
|
ref: positionalAudioRef,
|
|
10541
11178
|
args: [unref(listener)]
|
|
10542
|
-
}, null, 8, _hoisted_1$
|
|
11179
|
+
}, null, 8, _hoisted_1$38);
|
|
10543
11180
|
};
|
|
10544
11181
|
}
|
|
10545
11182
|
});
|
|
@@ -10553,8 +11190,19 @@ var PositionalAudio_default = PositionalAudio_vue_vue_type_script_setup_true_lan
|
|
|
10553
11190
|
/**
|
|
10554
11191
|
* Creates an AnimationMixer and returns it.
|
|
10555
11192
|
*
|
|
11193
|
+
* `actions` is keyed by clip name. Pass the model's clip names as `TName` to get those
|
|
11194
|
+
* keys typed instead of a bare string index — `tres gltf` generates that union for you.
|
|
11195
|
+
*
|
|
11196
|
+
* @example
|
|
11197
|
+
* ```ts
|
|
11198
|
+
* type ActionName = 'Idle' | 'Run'
|
|
11199
|
+
* const { actions } = useAnimations<AnimationClip, ActionName>(animations, modelRef)
|
|
11200
|
+
* actions.Idle?.play()
|
|
11201
|
+
* ```
|
|
11202
|
+
*
|
|
10556
11203
|
* @export
|
|
10557
11204
|
* @template T
|
|
11205
|
+
* @template TName
|
|
10558
11206
|
* @param {T[]} animations
|
|
10559
11207
|
* @param {(Scene | Ref<Object3D | undefined | null>)} [modelRef]
|
|
10560
11208
|
* @return {*}
|
|
@@ -10565,7 +11213,7 @@ function useAnimations(animations, modelRef, options) {
|
|
|
10565
11213
|
const actions = shallowReactive({});
|
|
10566
11214
|
const setupActions = () => {
|
|
10567
11215
|
const items = unref(animations);
|
|
10568
|
-
if (items && items.length > 0) {
|
|
11216
|
+
if (reference.value && items && items.length > 0) {
|
|
10569
11217
|
Object.keys(actions).forEach((key) => delete actions[key]);
|
|
10570
11218
|
items.forEach((animation) => {
|
|
10571
11219
|
const action = mixer.value.clipAction(animation, reference.value);
|
|
@@ -10575,14 +11223,15 @@ function useAnimations(animations, modelRef, options) {
|
|
|
10575
11223
|
};
|
|
10576
11224
|
watch(animations, setupActions, {
|
|
10577
11225
|
deep: true,
|
|
10578
|
-
immediate: true
|
|
11226
|
+
immediate: true,
|
|
11227
|
+
flush: "post"
|
|
10579
11228
|
});
|
|
10580
11229
|
watch(reference, (newRef) => {
|
|
10581
11230
|
if (newRef) {
|
|
10582
11231
|
mixer.value.uncacheRoot(reference.value);
|
|
10583
11232
|
setupActions();
|
|
10584
11233
|
}
|
|
10585
|
-
});
|
|
11234
|
+
}, { flush: "post" });
|
|
10586
11235
|
if (!options?.manualUpdate) {
|
|
10587
11236
|
const { onBeforeRender } = useLoop();
|
|
10588
11237
|
onBeforeRender(({ delta }) => {
|
|
@@ -10942,8 +11591,8 @@ function groupAtlasFramesByKey(frames) {
|
|
|
10942
11591
|
|
|
10943
11592
|
//#endregion
|
|
10944
11593
|
//#region src/core/objects/AnimatedSprite/component.vue?vue&type=script&setup=true&lang.ts
|
|
10945
|
-
const _hoisted_1$
|
|
10946
|
-
const _hoisted_2$
|
|
11594
|
+
const _hoisted_1$37 = ["scale", "position"];
|
|
11595
|
+
const _hoisted_2$25 = ["map", "alphaTest"];
|
|
10947
11596
|
const _hoisted_3$5 = ["scale", "position"];
|
|
10948
11597
|
const _hoisted_4$3 = [
|
|
10949
11598
|
"side",
|
|
@@ -11170,7 +11819,7 @@ var component_vue_vue_type_script_setup_true_lang_default$5 = /* @__PURE__ */ de
|
|
|
11170
11819
|
map: unref(texture$1),
|
|
11171
11820
|
transparent: true,
|
|
11172
11821
|
alphaTest: props.alphaTest
|
|
11173
|
-
}, null, 8, _hoisted_2$
|
|
11822
|
+
}, null, 8, _hoisted_2$25)], 8, _hoisted_1$37)) : (openBlock(), createElementBlock("TresMesh", {
|
|
11174
11823
|
key: 1,
|
|
11175
11824
|
scale: [
|
|
11176
11825
|
scaleX.value,
|
|
@@ -11241,7 +11890,7 @@ function useCubeCamera(props) {
|
|
|
11241
11890
|
|
|
11242
11891
|
//#endregion
|
|
11243
11892
|
//#region src/core/objects/CubeCamera/component.vue?vue&type=script&setup=true&lang.ts
|
|
11244
|
-
const _hoisted_1$
|
|
11893
|
+
const _hoisted_1$36 = ["object"];
|
|
11245
11894
|
var component_vue_vue_type_script_setup_true_lang_default$4 = /* @__PURE__ */ defineComponent({
|
|
11246
11895
|
__name: "component",
|
|
11247
11896
|
props: {
|
|
@@ -11305,7 +11954,7 @@ var component_vue_vue_type_script_setup_true_lang_default$4 = /* @__PURE__ */ de
|
|
|
11305
11954
|
return openBlock(), createElementBlock("TresGroup", {
|
|
11306
11955
|
ref_key: "groupRef",
|
|
11307
11956
|
ref: groupRef
|
|
11308
|
-
}, [createElementVNode("primitive", { object: unref(camera) }, null, 8, _hoisted_1$
|
|
11957
|
+
}, [createElementVNode("primitive", { object: unref(camera) }, null, 8, _hoisted_1$36), renderSlot(_ctx.$slots, "default")], 512);
|
|
11309
11958
|
};
|
|
11310
11959
|
}
|
|
11311
11960
|
});
|
|
@@ -11392,7 +12041,7 @@ var component_default$6 = component_vue_vue_type_script_setup_true_lang_default$
|
|
|
11392
12041
|
|
|
11393
12042
|
//#endregion
|
|
11394
12043
|
//#region src/core/objects/GradientTexture.vue?vue&type=script&setup=true&lang.ts
|
|
11395
|
-
const _hoisted_1$
|
|
12044
|
+
const _hoisted_1$35 = [
|
|
11396
12045
|
"color-space",
|
|
11397
12046
|
"args",
|
|
11398
12047
|
"attach"
|
|
@@ -11486,7 +12135,7 @@ var GradientTexture_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
11486
12135
|
"color-space": unref(renderer).outputColorSpace,
|
|
11487
12136
|
args: [unref(canvas)],
|
|
11488
12137
|
attach: props.attach
|
|
11489
|
-
}, null, 8, _hoisted_1$
|
|
12138
|
+
}, null, 8, _hoisted_1$35);
|
|
11490
12139
|
};
|
|
11491
12140
|
}
|
|
11492
12141
|
});
|
|
@@ -11642,7 +12291,7 @@ const getObjectCSSMatrix = (matrix, factor) => {
|
|
|
11642
12291
|
|
|
11643
12292
|
//#endregion
|
|
11644
12293
|
//#region src/core/objects/html/HTML.vue?vue&type=script&setup=true&lang.ts
|
|
11645
|
-
const _hoisted_1$
|
|
12294
|
+
const _hoisted_1$34 = [
|
|
11646
12295
|
"material",
|
|
11647
12296
|
"cast-shadow",
|
|
11648
12297
|
"receive-shadow",
|
|
@@ -12010,7 +12659,7 @@ var HTML_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
12010
12659
|
"cast-shadow": unref(castShadow),
|
|
12011
12660
|
"receive-shadow": unref(receiveShadow),
|
|
12012
12661
|
geometry: unref(geometry) || unref(defaultPlaneGeometry)
|
|
12013
|
-
}, null, 8, _hoisted_1$
|
|
12662
|
+
}, null, 8, _hoisted_1$34)) : createCommentVNode("v-if", true)], 512);
|
|
12014
12663
|
};
|
|
12015
12664
|
}
|
|
12016
12665
|
});
|
|
@@ -12115,8 +12764,8 @@ var ImageMaterial_default = ImageMaterial_vue_vue_type_script_setup_true_lang_de
|
|
|
12115
12764
|
|
|
12116
12765
|
//#endregion
|
|
12117
12766
|
//#region src/core/objects/Image/component.vue?vue&type=script&setup=true&lang.ts
|
|
12118
|
-
const _hoisted_1$
|
|
12119
|
-
const _hoisted_2$
|
|
12767
|
+
const _hoisted_1$33 = ["scale"];
|
|
12768
|
+
const _hoisted_2$24 = ["args"];
|
|
12120
12769
|
var component_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({
|
|
12121
12770
|
__name: "component",
|
|
12122
12771
|
props: {
|
|
@@ -12210,7 +12859,7 @@ var component_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ de
|
|
|
12210
12859
|
1,
|
|
12211
12860
|
props.segments,
|
|
12212
12861
|
props.segments
|
|
12213
|
-
] }, null, 8, _hoisted_2$
|
|
12862
|
+
] }, null, 8, _hoisted_2$24)]), createVNode(ImageMaterial_default, {
|
|
12214
12863
|
color: props.color,
|
|
12215
12864
|
map: texture$1.value,
|
|
12216
12865
|
zoom: props.zoom,
|
|
@@ -12236,7 +12885,7 @@ var component_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ de
|
|
|
12236
12885
|
"toneMapped",
|
|
12237
12886
|
"transparent",
|
|
12238
12887
|
"side"
|
|
12239
|
-
])], 8, _hoisted_1$
|
|
12888
|
+
])], 8, _hoisted_1$33);
|
|
12240
12889
|
};
|
|
12241
12890
|
}
|
|
12242
12891
|
});
|
|
@@ -12300,7 +12949,7 @@ var MarchingCube_default = MarchingCube_vue_vue_type_script_setup_true_lang_defa
|
|
|
12300
12949
|
|
|
12301
12950
|
//#endregion
|
|
12302
12951
|
//#region src/core/objects/MarchingCubes/MarchingCubes.vue?vue&type=script&setup=true&lang.ts
|
|
12303
|
-
const _hoisted_1$
|
|
12952
|
+
const _hoisted_1$32 = ["object"];
|
|
12304
12953
|
var MarchingCubes_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12305
12954
|
__name: "MarchingCubes",
|
|
12306
12955
|
props: {
|
|
@@ -12340,7 +12989,7 @@ var MarchingCubes_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
12340
12989
|
});
|
|
12341
12990
|
__expose({ instance: marchingCubes });
|
|
12342
12991
|
return (_ctx, _cache) => {
|
|
12343
|
-
return openBlock(), createElementBlock("primitive", { object: marchingCubes.value }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
12992
|
+
return openBlock(), createElementBlock("primitive", { object: marchingCubes.value }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$32);
|
|
12344
12993
|
};
|
|
12345
12994
|
}
|
|
12346
12995
|
});
|
|
@@ -12392,9 +13041,81 @@ var MarchingPlane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
12392
13041
|
//#region src/core/objects/MarchingCubes/MarchingPlane.vue
|
|
12393
13042
|
var MarchingPlane_default = MarchingPlane_vue_vue_type_script_setup_true_lang_default;
|
|
12394
13043
|
|
|
13044
|
+
//#endregion
|
|
13045
|
+
//#region src/core/objects/Refractor.vue?vue&type=script&setup=true&lang.ts
|
|
13046
|
+
const _hoisted_1$31 = ["args", "material-uniforms-color-value"];
|
|
13047
|
+
var Refractor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13048
|
+
__name: "Refractor",
|
|
13049
|
+
props: {
|
|
13050
|
+
color: {
|
|
13051
|
+
type: null,
|
|
13052
|
+
required: false,
|
|
13053
|
+
default: "#7f7f7f"
|
|
13054
|
+
},
|
|
13055
|
+
textureWidth: {
|
|
13056
|
+
type: Number,
|
|
13057
|
+
required: false,
|
|
13058
|
+
default: 512
|
|
13059
|
+
},
|
|
13060
|
+
textureHeight: {
|
|
13061
|
+
type: Number,
|
|
13062
|
+
required: false,
|
|
13063
|
+
default: 512
|
|
13064
|
+
},
|
|
13065
|
+
clipBias: {
|
|
13066
|
+
type: Number,
|
|
13067
|
+
required: false,
|
|
13068
|
+
default: 0
|
|
13069
|
+
},
|
|
13070
|
+
multisample: {
|
|
13071
|
+
type: Number,
|
|
13072
|
+
required: false,
|
|
13073
|
+
default: 4
|
|
13074
|
+
},
|
|
13075
|
+
shader: {
|
|
13076
|
+
type: Object,
|
|
13077
|
+
required: false,
|
|
13078
|
+
default: Refractor.RefractorShader
|
|
13079
|
+
}
|
|
13080
|
+
},
|
|
13081
|
+
setup(__props, { expose: __expose }) {
|
|
13082
|
+
const props = __props;
|
|
13083
|
+
const { extend: extend$1, invalidate } = useTres();
|
|
13084
|
+
const refractorRef = shallowRef();
|
|
13085
|
+
extend$1({ Refractor });
|
|
13086
|
+
const { color, textureWidth, textureHeight, clipBias, multisample, shader } = toRefs(props);
|
|
13087
|
+
const colorValue = computed(() => new Color(color.value));
|
|
13088
|
+
watch(props, () => {
|
|
13089
|
+
invalidate();
|
|
13090
|
+
});
|
|
13091
|
+
onBeforeUnmount(() => {
|
|
13092
|
+
refractorRef.value?.dispose();
|
|
13093
|
+
});
|
|
13094
|
+
__expose({ instance: refractorRef });
|
|
13095
|
+
return (_ctx, _cache) => {
|
|
13096
|
+
return openBlock(), createElementBlock("TresRefractor", {
|
|
13097
|
+
ref_key: "refractorRef",
|
|
13098
|
+
ref: refractorRef,
|
|
13099
|
+
args: [void 0, {
|
|
13100
|
+
textureWidth: unref(textureWidth),
|
|
13101
|
+
textureHeight: unref(textureHeight),
|
|
13102
|
+
clipBias: unref(clipBias),
|
|
13103
|
+
multisample: unref(multisample),
|
|
13104
|
+
shader: unref(shader)
|
|
13105
|
+
}],
|
|
13106
|
+
"material-uniforms-color-value": colorValue.value
|
|
13107
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createElementVNode("TresPlaneGeometry", { args: [5, 5] }, null, -1))])], 8, _hoisted_1$31);
|
|
13108
|
+
};
|
|
13109
|
+
}
|
|
13110
|
+
});
|
|
13111
|
+
|
|
13112
|
+
//#endregion
|
|
13113
|
+
//#region src/core/objects/Refractor.vue
|
|
13114
|
+
var Refractor_default = Refractor_vue_vue_type_script_setup_true_lang_default;
|
|
13115
|
+
|
|
12395
13116
|
//#endregion
|
|
12396
13117
|
//#region src/core/objects/Reflector.vue?vue&type=script&setup=true&lang.ts
|
|
12397
|
-
const _hoisted_1$
|
|
13118
|
+
const _hoisted_1$30 = ["args", "material-uniforms-color-value"];
|
|
12398
13119
|
var Reflector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12399
13120
|
__name: "Reflector",
|
|
12400
13121
|
props: {
|
|
@@ -12435,10 +13156,13 @@ var Reflector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
12435
13156
|
const reflectorRef = shallowRef();
|
|
12436
13157
|
extend$1({ Reflector });
|
|
12437
13158
|
const { color, textureWidth, textureHeight, clipBias, multisample, shader } = toRefs(props);
|
|
12438
|
-
const colorValue = computed(() =>
|
|
13159
|
+
const colorValue = computed(() => new Color(color.value));
|
|
12439
13160
|
watch(props, () => {
|
|
12440
13161
|
invalidate();
|
|
12441
13162
|
});
|
|
13163
|
+
onBeforeUnmount(() => {
|
|
13164
|
+
reflectorRef.value?.dispose();
|
|
13165
|
+
});
|
|
12442
13166
|
__expose({ instance: reflectorRef });
|
|
12443
13167
|
return (_ctx, _cache) => {
|
|
12444
13168
|
return openBlock(), createElementBlock("TresReflector", {
|
|
@@ -12452,7 +13176,7 @@ var Reflector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
12452
13176
|
shader: unref(shader)
|
|
12453
13177
|
}],
|
|
12454
13178
|
"material-uniforms-color-value": colorValue.value
|
|
12455
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createElementVNode("TresPlaneGeometry", { args: [5, 5] }, null, -1))])], 8, _hoisted_1$
|
|
13179
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createElementVNode("TresPlaneGeometry", { args: [5, 5] }, null, -1))])], 8, _hoisted_1$30);
|
|
12456
13180
|
};
|
|
12457
13181
|
}
|
|
12458
13182
|
});
|
|
@@ -12463,7 +13187,7 @@ var Reflector_default = Reflector_vue_vue_type_script_setup_true_lang_default;
|
|
|
12463
13187
|
|
|
12464
13188
|
//#endregion
|
|
12465
13189
|
//#region src/core/objects/Text3D.vue?vue&type=script&setup=true&lang.ts
|
|
12466
|
-
const _hoisted_1$
|
|
13190
|
+
const _hoisted_1$29 = ["args", "center"];
|
|
12467
13191
|
var Text3D_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12468
13192
|
__name: "Text3D",
|
|
12469
13193
|
props: {
|
|
@@ -12581,7 +13305,7 @@ var Text3D_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
12581
13305
|
key: 0,
|
|
12582
13306
|
args: [localText.value, textOptions.value],
|
|
12583
13307
|
center: unref(center)
|
|
12584
|
-
}, null, 8, _hoisted_1$
|
|
13308
|
+
}, null, 8, _hoisted_1$29)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 512)) : createCommentVNode("v-if", true);
|
|
12585
13309
|
};
|
|
12586
13310
|
}
|
|
12587
13311
|
});
|
|
@@ -12592,8 +13316,8 @@ var Text3D_default = Text3D_vue_vue_type_script_setup_true_lang_default;
|
|
|
12592
13316
|
|
|
12593
13317
|
//#endregion
|
|
12594
13318
|
//#region src/core/shapes/Box.vue?vue&type=script&setup=true&lang.ts
|
|
12595
|
-
const _hoisted_1$
|
|
12596
|
-
const _hoisted_2$
|
|
13319
|
+
const _hoisted_1$28 = ["args"];
|
|
13320
|
+
const _hoisted_2$23 = ["color"];
|
|
12597
13321
|
var Box_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12598
13322
|
__name: "Box",
|
|
12599
13323
|
props: {
|
|
@@ -12625,7 +13349,7 @@ var Box_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
|
|
|
12625
13349
|
return openBlock(), createElementBlock("TresMesh", {
|
|
12626
13350
|
ref_key: "boxRef",
|
|
12627
13351
|
ref: boxRef
|
|
12628
|
-
}, [createElementVNode("TresBoxGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
13352
|
+
}, [createElementVNode("TresBoxGeometry", { args: unref(args) }, null, 8, _hoisted_1$28), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$23)])], 512);
|
|
12629
13353
|
};
|
|
12630
13354
|
}
|
|
12631
13355
|
});
|
|
@@ -12636,7 +13360,7 @@ var Box_default = Box_vue_vue_type_script_setup_true_lang_default;
|
|
|
12636
13360
|
|
|
12637
13361
|
//#endregion
|
|
12638
13362
|
//#region src/core/shapes/Line2.vue?vue&type=script&setup=true&lang.ts
|
|
12639
|
-
const _hoisted_1$
|
|
13363
|
+
const _hoisted_1$27 = ["object"];
|
|
12640
13364
|
var Line2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12641
13365
|
__name: "Line2",
|
|
12642
13366
|
props: {
|
|
@@ -12791,7 +13515,7 @@ var Line2_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
12791
13515
|
return openBlock(), createElementBlock("primitive", {
|
|
12792
13516
|
ref: lineRef.value,
|
|
12793
13517
|
object: unref(line$1)
|
|
12794
|
-
}, null, 8, _hoisted_1$
|
|
13518
|
+
}, null, 8, _hoisted_1$27);
|
|
12795
13519
|
};
|
|
12796
13520
|
}
|
|
12797
13521
|
});
|
|
@@ -12919,8 +13643,8 @@ var CatmullRomCurve3_default = CatmullRomCurve3_vue_vue_type_script_setup_true_l
|
|
|
12919
13643
|
|
|
12920
13644
|
//#endregion
|
|
12921
13645
|
//#region src/core/shapes/Circle.vue?vue&type=script&setup=true&lang.ts
|
|
12922
|
-
const _hoisted_1$
|
|
12923
|
-
const _hoisted_2$
|
|
13646
|
+
const _hoisted_1$26 = ["args"];
|
|
13647
|
+
const _hoisted_2$22 = ["color"];
|
|
12924
13648
|
var Circle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12925
13649
|
__name: "Circle",
|
|
12926
13650
|
props: {
|
|
@@ -12953,7 +13677,7 @@ var Circle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
12953
13677
|
return openBlock(), createElementBlock("TresMesh", {
|
|
12954
13678
|
ref_key: "circleRef",
|
|
12955
13679
|
ref: circleRef
|
|
12956
|
-
}, [createElementVNode("TresCircleGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
13680
|
+
}, [createElementVNode("TresCircleGeometry", { args: unref(args) }, null, 8, _hoisted_1$26), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$22)])], 512);
|
|
12957
13681
|
};
|
|
12958
13682
|
}
|
|
12959
13683
|
});
|
|
@@ -12964,8 +13688,8 @@ var Circle_default = Circle_vue_vue_type_script_setup_true_lang_default;
|
|
|
12964
13688
|
|
|
12965
13689
|
//#endregion
|
|
12966
13690
|
//#region src/core/shapes/Cone.vue?vue&type=script&setup=true&lang.ts
|
|
12967
|
-
const _hoisted_1$
|
|
12968
|
-
const _hoisted_2$
|
|
13691
|
+
const _hoisted_1$25 = ["args"];
|
|
13692
|
+
const _hoisted_2$21 = ["color"];
|
|
12969
13693
|
var Cone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12970
13694
|
__name: "Cone",
|
|
12971
13695
|
props: {
|
|
@@ -13001,7 +13725,7 @@ var Cone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
13001
13725
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13002
13726
|
ref_key: "coneRef",
|
|
13003
13727
|
ref: coneRef
|
|
13004
|
-
}, [createElementVNode("TresConeGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
13728
|
+
}, [createElementVNode("TresConeGeometry", { args: unref(args) }, null, 8, _hoisted_1$25), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$21)])], 512);
|
|
13005
13729
|
};
|
|
13006
13730
|
}
|
|
13007
13731
|
});
|
|
@@ -13062,8 +13786,8 @@ var CubicBezierLine_default = CubicBezierLine_vue_vue_type_script_setup_true_lan
|
|
|
13062
13786
|
|
|
13063
13787
|
//#endregion
|
|
13064
13788
|
//#region src/core/shapes/Cylinder.vue?vue&type=script&setup=true&lang.ts
|
|
13065
|
-
const _hoisted_1$
|
|
13066
|
-
const _hoisted_2$
|
|
13789
|
+
const _hoisted_1$24 = ["args"];
|
|
13790
|
+
const _hoisted_2$20 = ["color"];
|
|
13067
13791
|
var Cylinder_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13068
13792
|
__name: "Cylinder",
|
|
13069
13793
|
props: {
|
|
@@ -13100,7 +13824,7 @@ var Cylinder_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
13100
13824
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13101
13825
|
ref_key: "cylinderRef",
|
|
13102
13826
|
ref: cylinderRef
|
|
13103
|
-
}, [createElementVNode("TresCylinderGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
13827
|
+
}, [createElementVNode("TresCylinderGeometry", { args: unref(args) }, null, 8, _hoisted_1$24), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$20)])], 512);
|
|
13104
13828
|
};
|
|
13105
13829
|
}
|
|
13106
13830
|
});
|
|
@@ -13111,8 +13835,8 @@ var Cylinder_default = Cylinder_vue_vue_type_script_setup_true_lang_default;
|
|
|
13111
13835
|
|
|
13112
13836
|
//#endregion
|
|
13113
13837
|
//#region src/core/shapes/Dodecahedron.vue?vue&type=script&setup=true&lang.ts
|
|
13114
|
-
const _hoisted_1$
|
|
13115
|
-
const _hoisted_2$
|
|
13838
|
+
const _hoisted_1$23 = ["args"];
|
|
13839
|
+
const _hoisted_2$19 = ["color"];
|
|
13116
13840
|
var Dodecahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13117
13841
|
__name: "Dodecahedron",
|
|
13118
13842
|
props: {
|
|
@@ -13140,7 +13864,7 @@ var Dodecahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
13140
13864
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13141
13865
|
ref_key: "dodecahedronRef",
|
|
13142
13866
|
ref: dodecahedronRef
|
|
13143
|
-
}, [createElementVNode("TresDodecahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
13867
|
+
}, [createElementVNode("TresDodecahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$23), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$19)])], 512);
|
|
13144
13868
|
};
|
|
13145
13869
|
}
|
|
13146
13870
|
});
|
|
@@ -13151,7 +13875,7 @@ var Dodecahedron_default = Dodecahedron_vue_vue_type_script_setup_true_lang_defa
|
|
|
13151
13875
|
|
|
13152
13876
|
//#endregion
|
|
13153
13877
|
//#region src/core/shapes/Grid.vue?vue&type=script&setup=true&lang.ts
|
|
13154
|
-
const _hoisted_1$
|
|
13878
|
+
const _hoisted_1$22 = [
|
|
13155
13879
|
"side",
|
|
13156
13880
|
"cell-size",
|
|
13157
13881
|
"section-size",
|
|
@@ -13165,7 +13889,7 @@ const _hoisted_1$21 = [
|
|
|
13165
13889
|
"infinite-grid",
|
|
13166
13890
|
"follow-camera"
|
|
13167
13891
|
];
|
|
13168
|
-
const _hoisted_2$
|
|
13892
|
+
const _hoisted_2$18 = ["args"];
|
|
13169
13893
|
var Grid_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13170
13894
|
__name: "Grid",
|
|
13171
13895
|
props: {
|
|
@@ -13353,7 +14077,7 @@ var Grid_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
13353
14077
|
"fade-from": props.fadeFrom,
|
|
13354
14078
|
"infinite-grid": props.infiniteGrid,
|
|
13355
14079
|
"follow-camera": props.followCamera
|
|
13356
|
-
}, null, 8, _hoisted_1$
|
|
14080
|
+
}, null, 8, _hoisted_1$22), createElementVNode("TresPlaneGeometry", { args: props.args }, null, 8, _hoisted_2$18)], 512);
|
|
13357
14081
|
};
|
|
13358
14082
|
}
|
|
13359
14083
|
});
|
|
@@ -13364,8 +14088,8 @@ var Grid_default = Grid_vue_vue_type_script_setup_true_lang_default;
|
|
|
13364
14088
|
|
|
13365
14089
|
//#endregion
|
|
13366
14090
|
//#region src/core/shapes/Icosahedron.vue?vue&type=script&setup=true&lang.ts
|
|
13367
|
-
const _hoisted_1$
|
|
13368
|
-
const _hoisted_2$
|
|
14091
|
+
const _hoisted_1$21 = ["args"];
|
|
14092
|
+
const _hoisted_2$17 = ["color"];
|
|
13369
14093
|
var Icosahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13370
14094
|
__name: "Icosahedron",
|
|
13371
14095
|
props: {
|
|
@@ -13393,7 +14117,7 @@ var Icosahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
13393
14117
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13394
14118
|
ref_key: "icosahedronRef",
|
|
13395
14119
|
ref: icosahedronRef
|
|
13396
|
-
}, [createElementVNode("TresIcosahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
14120
|
+
}, [createElementVNode("TresIcosahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$21), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$17)])], 512);
|
|
13397
14121
|
};
|
|
13398
14122
|
}
|
|
13399
14123
|
});
|
|
@@ -13404,8 +14128,8 @@ var Icosahedron_default = Icosahedron_vue_vue_type_script_setup_true_lang_defaul
|
|
|
13404
14128
|
|
|
13405
14129
|
//#endregion
|
|
13406
14130
|
//#region src/core/shapes/Octahedron.vue?vue&type=script&setup=true&lang.ts
|
|
13407
|
-
const _hoisted_1$
|
|
13408
|
-
const _hoisted_2$
|
|
14131
|
+
const _hoisted_1$20 = ["args"];
|
|
14132
|
+
const _hoisted_2$16 = ["color"];
|
|
13409
14133
|
var Octahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13410
14134
|
__name: "Octahedron",
|
|
13411
14135
|
props: {
|
|
@@ -13433,7 +14157,7 @@ var Octahedron_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
13433
14157
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13434
14158
|
ref_key: "octahedronRef",
|
|
13435
14159
|
ref: octahedronRef
|
|
13436
|
-
}, [createElementVNode("TresOctahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
14160
|
+
}, [createElementVNode("TresOctahedronGeometry", { args: unref(args) }, null, 8, _hoisted_1$20), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$16)])], 512);
|
|
13437
14161
|
};
|
|
13438
14162
|
}
|
|
13439
14163
|
});
|
|
@@ -13444,8 +14168,8 @@ var Octahedron_default = Octahedron_vue_vue_type_script_setup_true_lang_default;
|
|
|
13444
14168
|
|
|
13445
14169
|
//#endregion
|
|
13446
14170
|
//#region src/core/shapes/Plane.vue?vue&type=script&setup=true&lang.ts
|
|
13447
|
-
const _hoisted_1$
|
|
13448
|
-
const _hoisted_2$
|
|
14171
|
+
const _hoisted_1$19 = ["rotation"];
|
|
14172
|
+
const _hoisted_2$15 = ["args"];
|
|
13449
14173
|
const _hoisted_3$4 = ["color"];
|
|
13450
14174
|
var Plane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13451
14175
|
__name: "Plane",
|
|
@@ -13479,7 +14203,7 @@ var Plane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
13479
14203
|
0,
|
|
13480
14204
|
0
|
|
13481
14205
|
]
|
|
13482
|
-
}, [createElementVNode("TresPlaneGeometry", { args: unref(args) }, null, 8, _hoisted_2$
|
|
14206
|
+
}, [createElementVNode("TresPlaneGeometry", { args: unref(args) }, null, 8, _hoisted_2$15), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_3$4)])], 8, _hoisted_1$19);
|
|
13483
14207
|
};
|
|
13484
14208
|
}
|
|
13485
14209
|
});
|
|
@@ -13536,8 +14260,8 @@ var QuadraticBezierLine_default = QuadraticBezierLine_vue_vue_type_script_setup_
|
|
|
13536
14260
|
|
|
13537
14261
|
//#endregion
|
|
13538
14262
|
//#region src/core/shapes/Ring.vue?vue&type=script&setup=true&lang.ts
|
|
13539
|
-
const _hoisted_1$
|
|
13540
|
-
const _hoisted_2$
|
|
14263
|
+
const _hoisted_1$18 = ["args"];
|
|
14264
|
+
const _hoisted_2$14 = ["color"];
|
|
13541
14265
|
var Ring_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13542
14266
|
__name: "Ring",
|
|
13543
14267
|
props: {
|
|
@@ -13568,7 +14292,7 @@ var Ring_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
13568
14292
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13569
14293
|
ref_key: "ringRef",
|
|
13570
14294
|
ref: ringRef
|
|
13571
|
-
}, [createElementVNode("TresRingGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
14295
|
+
}, [createElementVNode("TresRingGeometry", { args: unref(args) }, null, 8, _hoisted_1$18), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$14)])], 512);
|
|
13572
14296
|
};
|
|
13573
14297
|
}
|
|
13574
14298
|
});
|
|
@@ -13579,8 +14303,8 @@ var Ring_default = Ring_vue_vue_type_script_setup_true_lang_default;
|
|
|
13579
14303
|
|
|
13580
14304
|
//#endregion
|
|
13581
14305
|
//#region src/core/shapes/RoundedBox.vue?vue&type=script&setup=true&lang.ts
|
|
13582
|
-
const _hoisted_1$
|
|
13583
|
-
const _hoisted_2$
|
|
14306
|
+
const _hoisted_1$17 = ["args"];
|
|
14307
|
+
const _hoisted_2$13 = ["color"];
|
|
13584
14308
|
var RoundedBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13585
14309
|
__name: "RoundedBox",
|
|
13586
14310
|
props: {
|
|
@@ -13614,7 +14338,7 @@ var RoundedBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
13614
14338
|
return openBlock(), createElementBlock("TresMesh", {
|
|
13615
14339
|
ref_key: "roundedBoxRef",
|
|
13616
14340
|
ref: roundedBoxRef
|
|
13617
|
-
}, [createElementVNode("TresRoundedBoxGeometry", { args: unref(args) }, null, 8, _hoisted_1$
|
|
14341
|
+
}, [createElementVNode("TresRoundedBoxGeometry", { args: unref(args) }, null, 8, _hoisted_1$17), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$13)])], 512);
|
|
13618
14342
|
};
|
|
13619
14343
|
}
|
|
13620
14344
|
});
|
|
@@ -13623,6 +14347,158 @@ var RoundedBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
13623
14347
|
//#region src/core/shapes/RoundedBox.vue
|
|
13624
14348
|
var RoundedBox_default = RoundedBox_vue_vue_type_script_setup_true_lang_default;
|
|
13625
14349
|
|
|
14350
|
+
//#endregion
|
|
14351
|
+
//#region src/core/shapes/RoundedPlaneGeometry.ts
|
|
14352
|
+
/**
|
|
14353
|
+
* A plane geometry with rounded corners.
|
|
14354
|
+
*
|
|
14355
|
+
* Vendored from pmndrs/maath (MIT) to avoid an extra dependency.
|
|
14356
|
+
* @see https://github.com/pmndrs/maath/blob/main/packages/maath/src/geometry.ts
|
|
14357
|
+
* @see https://discourse.threejs.org/t/roundedrectangle-squircle/28645/20
|
|
14358
|
+
*/
|
|
14359
|
+
var RoundedPlaneGeometry = class extends BufferGeometry {
|
|
14360
|
+
parameters;
|
|
14361
|
+
constructor(width = 1, height = 1, radius = .2, segments = 16) {
|
|
14362
|
+
super();
|
|
14363
|
+
this.parameters = {
|
|
14364
|
+
width,
|
|
14365
|
+
height,
|
|
14366
|
+
radius,
|
|
14367
|
+
segments
|
|
14368
|
+
};
|
|
14369
|
+
const wi = width / 2 - radius;
|
|
14370
|
+
const hi = height / 2 - radius;
|
|
14371
|
+
const ul = radius / width;
|
|
14372
|
+
const ur = (width - radius) / width;
|
|
14373
|
+
const vl = radius / height;
|
|
14374
|
+
const vh = (height - radius) / height;
|
|
14375
|
+
const positions = [
|
|
14376
|
+
wi,
|
|
14377
|
+
hi,
|
|
14378
|
+
0,
|
|
14379
|
+
-wi,
|
|
14380
|
+
hi,
|
|
14381
|
+
0,
|
|
14382
|
+
-wi,
|
|
14383
|
+
-hi,
|
|
14384
|
+
0,
|
|
14385
|
+
wi,
|
|
14386
|
+
-hi,
|
|
14387
|
+
0
|
|
14388
|
+
];
|
|
14389
|
+
const uvs = [
|
|
14390
|
+
ur,
|
|
14391
|
+
vh,
|
|
14392
|
+
ul,
|
|
14393
|
+
vh,
|
|
14394
|
+
ul,
|
|
14395
|
+
vl,
|
|
14396
|
+
ur,
|
|
14397
|
+
vl
|
|
14398
|
+
];
|
|
14399
|
+
const n = [
|
|
14400
|
+
3 * (segments + 1) + 3,
|
|
14401
|
+
3 * (segments + 1) + 4,
|
|
14402
|
+
segments + 4,
|
|
14403
|
+
segments + 5,
|
|
14404
|
+
2 * (segments + 1) + 4,
|
|
14405
|
+
2,
|
|
14406
|
+
1,
|
|
14407
|
+
2 * (segments + 1) + 3,
|
|
14408
|
+
3,
|
|
14409
|
+
4 * (segments + 1) + 3,
|
|
14410
|
+
4,
|
|
14411
|
+
0
|
|
14412
|
+
];
|
|
14413
|
+
const indices = [
|
|
14414
|
+
n[0],
|
|
14415
|
+
n[1],
|
|
14416
|
+
n[2],
|
|
14417
|
+
n[0],
|
|
14418
|
+
n[2],
|
|
14419
|
+
n[3],
|
|
14420
|
+
n[4],
|
|
14421
|
+
n[5],
|
|
14422
|
+
n[6],
|
|
14423
|
+
n[4],
|
|
14424
|
+
n[6],
|
|
14425
|
+
n[7],
|
|
14426
|
+
n[8],
|
|
14427
|
+
n[9],
|
|
14428
|
+
n[10],
|
|
14429
|
+
n[8],
|
|
14430
|
+
n[10],
|
|
14431
|
+
n[11]
|
|
14432
|
+
];
|
|
14433
|
+
let phi, cos, sin, xc, yc, uc, vc, idx;
|
|
14434
|
+
for (let i = 0; i < 4; i++) {
|
|
14435
|
+
xc = i < 1 || i > 2 ? wi : -wi;
|
|
14436
|
+
yc = i < 2 ? hi : -hi;
|
|
14437
|
+
uc = i < 1 || i > 2 ? ur : ul;
|
|
14438
|
+
vc = i < 2 ? vh : vl;
|
|
14439
|
+
for (let j = 0; j <= segments; j++) {
|
|
14440
|
+
phi = Math.PI / 2 * (i + j / segments);
|
|
14441
|
+
cos = Math.cos(phi);
|
|
14442
|
+
sin = Math.sin(phi);
|
|
14443
|
+
positions.push(xc + radius * cos, yc + radius * sin, 0);
|
|
14444
|
+
uvs.push(uc + ul * cos, vc + vl * sin);
|
|
14445
|
+
if (j < segments) {
|
|
14446
|
+
idx = (segments + 1) * i + j + 4;
|
|
14447
|
+
indices.push(i, idx, idx + 1);
|
|
14448
|
+
}
|
|
14449
|
+
}
|
|
14450
|
+
}
|
|
14451
|
+
this.setIndex(new BufferAttribute(new Uint32Array(indices), 1));
|
|
14452
|
+
this.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
|
|
14453
|
+
this.setAttribute("uv", new BufferAttribute(new Float32Array(uvs), 2));
|
|
14454
|
+
}
|
|
14455
|
+
};
|
|
14456
|
+
|
|
14457
|
+
//#endregion
|
|
14458
|
+
//#region src/core/shapes/RoundedPlane.vue?vue&type=script&setup=true&lang.ts
|
|
14459
|
+
const _hoisted_1$16 = ["args"];
|
|
14460
|
+
const _hoisted_2$12 = ["color"];
|
|
14461
|
+
var RoundedPlane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
14462
|
+
__name: "RoundedPlane",
|
|
14463
|
+
props: {
|
|
14464
|
+
args: {
|
|
14465
|
+
type: Array,
|
|
14466
|
+
required: false,
|
|
14467
|
+
default: () => [
|
|
14468
|
+
1,
|
|
14469
|
+
1,
|
|
14470
|
+
.2,
|
|
14471
|
+
16
|
|
14472
|
+
]
|
|
14473
|
+
},
|
|
14474
|
+
color: {
|
|
14475
|
+
type: null,
|
|
14476
|
+
required: false,
|
|
14477
|
+
default: "#ffffff"
|
|
14478
|
+
}
|
|
14479
|
+
},
|
|
14480
|
+
setup(__props, { expose: __expose }) {
|
|
14481
|
+
const { args, color } = toRefs(__props);
|
|
14482
|
+
const { invalidate, extend: extend$1 } = useTres();
|
|
14483
|
+
extend$1({ RoundedPlaneGeometry });
|
|
14484
|
+
watch(args, () => {
|
|
14485
|
+
invalidate();
|
|
14486
|
+
});
|
|
14487
|
+
const roundedPlaneRef = shallowRef();
|
|
14488
|
+
__expose({ instance: roundedPlaneRef });
|
|
14489
|
+
return (_ctx, _cache) => {
|
|
14490
|
+
return openBlock(), createElementBlock("TresMesh", {
|
|
14491
|
+
ref_key: "roundedPlaneRef",
|
|
14492
|
+
ref: roundedPlaneRef
|
|
14493
|
+
}, [createElementVNode("TresRoundedPlaneGeometry", { args: unref(args) }, null, 8, _hoisted_1$16), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("TresMeshBasicMaterial", { color: unref(color) }, null, 8, _hoisted_2$12)])], 512);
|
|
14494
|
+
};
|
|
14495
|
+
}
|
|
14496
|
+
});
|
|
14497
|
+
|
|
14498
|
+
//#endregion
|
|
14499
|
+
//#region src/core/shapes/RoundedPlane.vue
|
|
14500
|
+
var RoundedPlane_default = RoundedPlane_vue_vue_type_script_setup_true_lang_default;
|
|
14501
|
+
|
|
13626
14502
|
//#endregion
|
|
13627
14503
|
//#region src/core/shapes/ScreenQuad.vue?vue&type=script&setup=true&lang.ts
|
|
13628
14504
|
const _hoisted_1$15 = ["geometry"];
|
|
@@ -14731,7 +15607,7 @@ const _hoisted_1$5 = [
|
|
|
14731
15607
|
"transparent",
|
|
14732
15608
|
"size-attenuation"
|
|
14733
15609
|
];
|
|
14734
|
-
const _hoisted_2$3 = ["position"
|
|
15610
|
+
const _hoisted_2$3 = ["position"];
|
|
14735
15611
|
var Precipitation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
14736
15612
|
__name: "Precipitation",
|
|
14737
15613
|
props: {
|
|
@@ -14814,15 +15690,15 @@ var Precipitation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
14814
15690
|
setup(__props, { expose: __expose }) {
|
|
14815
15691
|
const { size, area, color, alphaMap: alphaMapUrl, map: mapUrl, opacity, alphaTest, depthWrite, transparent, sizeAttenuation, count, speed, randomness } = toRefs(__props);
|
|
14816
15692
|
const geometryRef = shallowRef();
|
|
14817
|
-
|
|
14818
|
-
let velocityArray =
|
|
15693
|
+
const positionArray = shallowRef(new Float32Array());
|
|
15694
|
+
let velocityArray = new Float32Array();
|
|
14819
15695
|
const setPosition = () => {
|
|
14820
|
-
positionArray = new Float32Array(count.value * 3);
|
|
15696
|
+
positionArray.value = new Float32Array(count.value * 3);
|
|
14821
15697
|
for (let i = 0; i < count.value; i++) {
|
|
14822
15698
|
const i3 = i * 3;
|
|
14823
|
-
positionArray[i3] = (Math.random() - .5) * area.value[0];
|
|
14824
|
-
positionArray[i3 + 1] = (Math.random() - .5) * area.value[1];
|
|
14825
|
-
positionArray[i3 + 2] = (Math.random() - .5) * area.value[2];
|
|
15699
|
+
positionArray.value[i3] = (Math.random() - .5) * area.value[0];
|
|
15700
|
+
positionArray.value[i3 + 1] = (Math.random() - .5) * area.value[1];
|
|
15701
|
+
positionArray.value[i3 + 2] = (Math.random() - .5) * area.value[2];
|
|
14826
15702
|
}
|
|
14827
15703
|
};
|
|
14828
15704
|
const setSpeed = () => {
|
|
@@ -14834,12 +15710,15 @@ var Precipitation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
14834
15710
|
};
|
|
14835
15711
|
setSpeed();
|
|
14836
15712
|
setPosition();
|
|
14837
|
-
watch(
|
|
15713
|
+
watch(count, () => {
|
|
15714
|
+
setPosition();
|
|
14838
15715
|
setSpeed();
|
|
14839
15716
|
});
|
|
14840
|
-
|
|
14841
|
-
if (
|
|
14842
|
-
|
|
15717
|
+
watch(area, (newVal, oldVal) => {
|
|
15718
|
+
if (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1] || newVal[2] !== oldVal[2]) setPosition();
|
|
15719
|
+
}, { deep: true });
|
|
15720
|
+
watch([randomness, speed], () => {
|
|
15721
|
+
setSpeed();
|
|
14843
15722
|
});
|
|
14844
15723
|
const alphaMapTexture = shallowRef(null);
|
|
14845
15724
|
const mapTexture = shallowRef(null);
|
|
@@ -14887,8 +15766,7 @@ var Precipitation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
14887
15766
|
}, null, 8, _hoisted_1$5), createElementVNode("TresBufferGeometry", {
|
|
14888
15767
|
ref_key: "geometryRef",
|
|
14889
15768
|
ref: geometryRef,
|
|
14890
|
-
position: [
|
|
14891
|
-
velocity: [unref(velocityArray)]
|
|
15769
|
+
position: [positionArray.value, 3]
|
|
14892
15770
|
}, null, 8, _hoisted_2$3)], 512);
|
|
14893
15771
|
};
|
|
14894
15772
|
}
|
|
@@ -15723,6 +16601,41 @@ var component_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
15723
16601
|
//#region src/core/staging/Sparkles/component.vue
|
|
15724
16602
|
var component_default$16 = component_vue_vue_type_script_setup_true_lang_default;
|
|
15725
16603
|
|
|
16604
|
+
//#endregion
|
|
16605
|
+
//#region src/utils/index.ts
|
|
16606
|
+
/**
|
|
16607
|
+
* Update the function signature to explicitly specify the type of the props parameter
|
|
16608
|
+
*
|
|
16609
|
+
* @export
|
|
16610
|
+
* @template T
|
|
16611
|
+
* @template K
|
|
16612
|
+
* @param {T} obj
|
|
16613
|
+
* @param {K[]} props
|
|
16614
|
+
* @return {*} {Pick<T, K>}
|
|
16615
|
+
*/
|
|
16616
|
+
function pick(obj, props) {
|
|
16617
|
+
const pickedProperties = {};
|
|
16618
|
+
for (const prop of props) if (Object.hasOwn(obj, prop)) pickedProperties[prop] = obj[prop];
|
|
16619
|
+
return pickedProperties;
|
|
16620
|
+
}
|
|
16621
|
+
/**
|
|
16622
|
+
* Check if the object has a setter for the given property
|
|
16623
|
+
*
|
|
16624
|
+
* @export
|
|
16625
|
+
* @param {*} obj
|
|
16626
|
+
* @param {string} prop
|
|
16627
|
+
* @return {*} {boolean}
|
|
16628
|
+
*/
|
|
16629
|
+
function hasSetter(obj, prop) {
|
|
16630
|
+
return obj[`set${prop[0].toUpperCase()}${prop.slice(1)}`] !== void 0;
|
|
16631
|
+
}
|
|
16632
|
+
function extractBindingPosition(binding) {
|
|
16633
|
+
let observer = binding.value;
|
|
16634
|
+
if (binding.value && binding.value?.value?.isMesh) observer = binding.value.value.position;
|
|
16635
|
+
if (Array.isArray(binding.value)) observer = new Vector3(...observer);
|
|
16636
|
+
return observer;
|
|
16637
|
+
}
|
|
16638
|
+
|
|
15726
16639
|
//#endregion
|
|
15727
16640
|
//#region src/core/staging/Stage.vue?vue&type=script&setup=true&lang.ts
|
|
15728
16641
|
const _hoisted_1$1 = { key: 0 };
|
|
@@ -15756,7 +16669,8 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15756
16669
|
type: [
|
|
15757
16670
|
Boolean,
|
|
15758
16671
|
String,
|
|
15759
|
-
Object
|
|
16672
|
+
Object,
|
|
16673
|
+
null
|
|
15760
16674
|
],
|
|
15761
16675
|
required: false,
|
|
15762
16676
|
default: "contact"
|
|
@@ -15834,7 +16748,7 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15834
16748
|
}
|
|
15835
16749
|
};
|
|
15836
16750
|
const radius = ref(2);
|
|
15837
|
-
const
|
|
16751
|
+
const floor = ref(0);
|
|
15838
16752
|
const stageRef = shallowRef();
|
|
15839
16753
|
const boundsRef = shallowRef();
|
|
15840
16754
|
const alignRef = shallowRef();
|
|
@@ -15865,15 +16779,31 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15865
16779
|
return lightingPresetComputed.value.fill.map((v) => v * radius.value);
|
|
15866
16780
|
});
|
|
15867
16781
|
const contactShadowsComputed = computed(() => {
|
|
15868
|
-
if (props.shadows === true || props.shadows === "contact") return {
|
|
15869
|
-
else if (typeof props.shadows === "object" && props.shadows.type === "contact") return props.shadows;
|
|
16782
|
+
if (props.shadows === true || props.shadows === "contact") return {};
|
|
16783
|
+
else if (props.shadows && typeof props.shadows === "object" && props.shadows.type === "contact") return pick(props.shadows, Object.keys(ContactShadows_default.props));
|
|
15870
16784
|
else return null;
|
|
15871
16785
|
});
|
|
15872
16786
|
const accumulativeShadowsComputed = computed(() => {
|
|
15873
|
-
if (props.shadows === "accumulative") return {
|
|
15874
|
-
else if (typeof props.shadows === "object" && props.shadows.type === "accumulative") return props.shadows;
|
|
16787
|
+
if (props.shadows === "accumulative") return {};
|
|
16788
|
+
else if (props.shadows && typeof props.shadows === "object" && props.shadows.type === "accumulative") return pick(props.shadows, Object.keys(component_default.props));
|
|
15875
16789
|
else return null;
|
|
15876
16790
|
});
|
|
16791
|
+
const randomizedLightsComputed = computed(() => {
|
|
16792
|
+
const shadows = props.shadows && typeof props.shadows === "object" ? props.shadows : {};
|
|
16793
|
+
return {
|
|
16794
|
+
count: shadows.count ?? 8,
|
|
16795
|
+
radius: shadows.radius ?? radius.value,
|
|
16796
|
+
intensity: shadows.intensity ?? 1.5,
|
|
16797
|
+
ambient: shadows.ambient ?? .5,
|
|
16798
|
+
castShadow: shadows.castShadow,
|
|
16799
|
+
near: shadows.near,
|
|
16800
|
+
far: shadows.far,
|
|
16801
|
+
bias: -(shadows.bias ?? -1e-4),
|
|
16802
|
+
mapSize: shadows.mapSize ?? shadows.size ?? 1024,
|
|
16803
|
+
size: radius.value * 4,
|
|
16804
|
+
position: shadows.position ?? lightingMainComputed.value
|
|
16805
|
+
};
|
|
16806
|
+
});
|
|
15877
16807
|
const environmentComputed = computed(() => {
|
|
15878
16808
|
if (props.environment === null) return null;
|
|
15879
16809
|
else if (!props.environment) return { preset: "city" };
|
|
@@ -15882,6 +16812,7 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15882
16812
|
});
|
|
15883
16813
|
const onAlignChange = (alignProps) => {
|
|
15884
16814
|
radius.value = alignProps.boundingSphere.radius;
|
|
16815
|
+
floor.value = props.align?.disable || props.align?.disableY ? alignProps.boundingBox.min.y : alignProps.verticalAlignment - alignProps.height / 2;
|
|
15885
16816
|
if (props.adjustCamera !== false) debouncedLookAt();
|
|
15886
16817
|
};
|
|
15887
16818
|
__expose({
|
|
@@ -15900,7 +16831,7 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15900
16831
|
position: lightingMainComputed.value,
|
|
15901
16832
|
intensity: __props.intensity * 2,
|
|
15902
16833
|
castShadow: !!__props.shadows,
|
|
15903
|
-
"shadow-bias": __props.shadows?.bias ??
|
|
16834
|
+
"shadow-bias": __props.shadows?.bias ?? -1e-4,
|
|
15904
16835
|
"shadow-normalBias": __props.shadows?.normalBias ?? 0,
|
|
15905
16836
|
"shadow-mapSize-x": __props.shadows?.size ?? 1024,
|
|
15906
16837
|
"shadow-mapSize-y": __props.shadows?.size ?? 1024
|
|
@@ -15910,14 +16841,14 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15910
16841
|
intensity: __props.intensity
|
|
15911
16842
|
}, null, 8, _hoisted_4)
|
|
15912
16843
|
])) : createCommentVNode("v-if", true),
|
|
15913
|
-
createVNode(component_default$2,
|
|
16844
|
+
createVNode(component_default$2, {
|
|
15914
16845
|
ref_key: "boundsRef",
|
|
15915
16846
|
ref: boundsRef,
|
|
15916
16847
|
clip: !!__props.adjustCamera,
|
|
15917
16848
|
offset: typeof props.adjustCamera === "boolean" ? .3 : props.adjustCamera,
|
|
15918
16849
|
"use-mounted": "",
|
|
15919
16850
|
"use-resize": ""
|
|
15920
|
-
},
|
|
16851
|
+
}, {
|
|
15921
16852
|
default: withCtx(() => [createVNode(Align_default, mergeProps({
|
|
15922
16853
|
ref_key: "alignRef",
|
|
15923
16854
|
ref: alignRef
|
|
@@ -15926,10 +16857,10 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15926
16857
|
_: 3
|
|
15927
16858
|
}, 16)]),
|
|
15928
16859
|
_: 3
|
|
15929
|
-
},
|
|
16860
|
+
}, 8, ["clip", "offset"]),
|
|
15930
16861
|
createElementVNode("TresGroup", { position: [
|
|
15931
16862
|
0,
|
|
15932
|
-
|
|
16863
|
+
floor.value - (__props.shadows?.offset ?? 0),
|
|
15933
16864
|
0
|
|
15934
16865
|
] }, [
|
|
15935
16866
|
contactShadowsComputed.value ? (openBlock(), createBlock(unref(ContactShadows_default), mergeProps({
|
|
@@ -15947,25 +16878,7 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
15947
16878
|
"tone-mapped": true,
|
|
15948
16879
|
scale: radius.value * 4
|
|
15949
16880
|
}, accumulativeShadowsComputed.value), {
|
|
15950
|
-
default: withCtx(() => [createVNode(unref(component_default$14),
|
|
15951
|
-
position: lightingMainComputed.value,
|
|
15952
|
-
count: accumulativeShadowsComputed.value.count ?? 8,
|
|
15953
|
-
radius: accumulativeShadowsComputed.value.radius ?? radius.value,
|
|
15954
|
-
intensity: accumulativeShadowsComputed.value.intensity ?? 1.5,
|
|
15955
|
-
ambient: accumulativeShadowsComputed.value.ambient ?? .5,
|
|
15956
|
-
size: radius.value * 4,
|
|
15957
|
-
bias: accumulativeShadowsComputed.value.bias ?? 0,
|
|
15958
|
-
"map-size": accumulativeShadowsComputed.value.size ?? 1024
|
|
15959
|
-
}, accumulativeShadowsComputed.value), null, 16, [
|
|
15960
|
-
"position",
|
|
15961
|
-
"count",
|
|
15962
|
-
"radius",
|
|
15963
|
-
"intensity",
|
|
15964
|
-
"ambient",
|
|
15965
|
-
"size",
|
|
15966
|
-
"bias",
|
|
15967
|
-
"map-size"
|
|
15968
|
-
])]),
|
|
16881
|
+
default: withCtx(() => [createVNode(unref(component_default$14), normalizeProps(guardReactiveProps(randomizedLightsComputed.value)), null, 16)]),
|
|
15969
16882
|
_: 1
|
|
15970
16883
|
}, 16, ["scale"])) : createCommentVNode("v-if", true),
|
|
15971
16884
|
(openBlock(), createBlock(Suspense, null, {
|
|
@@ -16088,39 +17001,4 @@ var Stars_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
16088
17001
|
var Stars_default = Stars_vue_vue_type_script_setup_true_lang_default;
|
|
16089
17002
|
|
|
16090
17003
|
//#endregion
|
|
16091
|
-
|
|
16092
|
-
/**
|
|
16093
|
-
* Update the function signature to explicitly specify the type of the props parameter
|
|
16094
|
-
*
|
|
16095
|
-
* @export
|
|
16096
|
-
* @template T
|
|
16097
|
-
* @template K
|
|
16098
|
-
* @param {T} obj
|
|
16099
|
-
* @param {K[]} props
|
|
16100
|
-
* @return {*} {Pick<T, K>}
|
|
16101
|
-
*/
|
|
16102
|
-
function pick(obj, props) {
|
|
16103
|
-
const pickedProperties = {};
|
|
16104
|
-
for (const prop of props) if (Object.hasOwn(obj, prop)) pickedProperties[prop] = obj[prop];
|
|
16105
|
-
return pickedProperties;
|
|
16106
|
-
}
|
|
16107
|
-
/**
|
|
16108
|
-
* Check if the object has a setter for the given property
|
|
16109
|
-
*
|
|
16110
|
-
* @export
|
|
16111
|
-
* @param {*} obj
|
|
16112
|
-
* @param {string} prop
|
|
16113
|
-
* @return {*} {boolean}
|
|
16114
|
-
*/
|
|
16115
|
-
function hasSetter(obj, prop) {
|
|
16116
|
-
return obj[`set${prop[0].toUpperCase()}${prop.slice(1)}`] !== void 0;
|
|
16117
|
-
}
|
|
16118
|
-
function extractBindingPosition(binding) {
|
|
16119
|
-
let observer = binding.value;
|
|
16120
|
-
if (binding.value && binding.value?.value?.isMesh) observer = binding.value.value.position;
|
|
16121
|
-
if (Array.isArray(binding.value)) observer = new Vector3(...observer);
|
|
16122
|
-
return observer;
|
|
16123
|
-
}
|
|
16124
|
-
|
|
16125
|
-
//#endregion
|
|
16126
|
-
export { component_default as AccumulativeShadows, Align_default as Align, component_default$1 as AnimatedSprite, Backdrop_default as Backdrop, BakeShadows, BaseCameraControls, Billboard_default as Billboard, component_default$2 as Bounds, Box_default as Box, CameraControls_default as CameraControls, CameraShake_default as CameraShake, CatmullRomCurve3_default as CatmullRomCurve3, Circle_default as Circle, CircleShadow_default as CircleShadow, Cone_default as Cone, ContactShadows_default as ContactShadows, component_default$3 as CubeCamera, CubicBezierLine_default as CubicBezierLine, customShaderMaterial_default as CustomShaderMaterial, Cylinder_default as Cylinder, Decal_default as Decal, DecalDebugUI_default as DecalDebugUI, Dodecahedron_default as Dodecahedron, Edges_default as Edges, component_default$4 as Environment, component_default$5 as FBXModel, component_default$6 as Fbo, Fit_default as Fit, component_default$7 as GLTFModel, GlobalAudio, GradientTexture_default as GradientTexture, Grid_default as Grid, component_default$8 as Helper, holographicMaterial_default as HolographicMaterial, HTML_default as Html, Icosahedron_default as Icosahedron, component_default$9 as Image, KeyboardControls_default as KeyboardControls, LOD_default as LOD, component_default$10 as Lensflare, Levioso_default as Levioso, lightformer_default as Lightformer, Line2_default as Line2, MapControls_default as MapControls, MarchingCube_default as MarchingCube, MarchingCubes_default as MarchingCubes, MarchingPlane_default as MarchingPlane, component_default$11 as Mask, meshDiscardMaterial_default as MeshDiscardMaterial, meshGlassMaterial_default as MeshGlassMaterial, meshReflectionMaterial_default as MeshReflectionMaterial, meshTransmissionMaterial_default as MeshTransmissionMaterial, meshWobbleMaterial_default as MeshWobbleMaterial, MouseParallax_default as MouseParallax, Ocean_default as Ocean, Octahedron_default as Octahedron, OrbitControls_default as OrbitControls, component_default$12 as Outline, Plane_default as Plane, component_default$13 as PointMaterial, PointerLockControls_default as PointerLockControls, PositionalAudio_default as PositionalAudio, Precipitation_default as Precipitation, QuadraticBezierLine_default as QuadraticBezierLine, component_default$14 as RandomizedLights, Reflector_default as Reflector, Ring_default as Ring, RoundedBox_default as RoundedBox, component_default$15 as Sampler, ScreenQuad_default as ScreenQuad, ScreenSizer_default as ScreenSizer, ScreenSpace_default as ScreenSpace, ScrollControls_default as ScrollControls, Sky_default as Sky, Smoke_default as Smoke, SoftShadows_default as SoftShadows, component_default$16 as Sparkles, Sphere_default as Sphere, Stage_default as Stage, Stars_default as Stars, Stats, StatsGl, Superformula_default as Superformula, Tetrahedron_default as Tetrahedron, Text3D_default as Text3D, Torus_default as Torus, TorusKnot_default as TorusKnot, TransformControls_default as TransformControls, Tube_default as Tube, component_default$17 as UseSVG, component_default$18 as UseTexture, ensureTextureNames, extractBindingPosition, getTextureAspect, getTextureName, hasSetter, invalidateDecalGeometry, pick, useAnimations, useBVH, useDecalEditor, useEnvironment, useFBO, useFBX, useGLTF, useGLTFExporter, useHelper, useIntersect, useMask, useProgress, useSVG, useSurfaceSampler, useTexture, useTextures, useVideoTexture };
|
|
17004
|
+
export { component_default as AccumulativeShadows, Align_default as Align, component_default$1 as AnimatedSprite, Backdrop_default as Backdrop, BakeShadows, BaseCameraControls, Billboard_default as Billboard, component_default$2 as Bounds, Box_default as Box, CameraControls_default as CameraControls, CameraShake_default as CameraShake, CatmullRomCurve3_default as CatmullRomCurve3, Circle_default as Circle, CircleShadow_default as CircleShadow, Cone_default as Cone, ContactShadows_default as ContactShadows, component_default$3 as CubeCamera, CubicBezierLine_default as CubicBezierLine, customShaderMaterial_default as CustomShaderMaterial, Cylinder_default as Cylinder, Decal_default as Decal, DecalDebugUI_default as DecalDebugUI, Dodecahedron_default as Dodecahedron, Edges_default as Edges, component_default$4 as Environment, component_default$5 as FBXModel, component_default$6 as Fbo, Fit_default as Fit, component_default$7 as GLTFModel, GlobalAudio, GradientTexture_default as GradientTexture, Grid_default as Grid, component_default$8 as Helper, holographicMaterial_default as HolographicMaterial, HTML_default as Html, INSTANCES_INJECTION_KEY, Icosahedron_default as Icosahedron, component_default$9 as Image, Instance_default as Instance, Instances_default as Instances, KeyboardControls_default as KeyboardControls, LOD_default as LOD, component_default$10 as Lensflare, Levioso_default as Levioso, lightformer_default as Lightformer, Line2_default as Line2, MERGED_INJECTION_KEY, MapControls_default as MapControls, MarchingCube_default as MarchingCube, MarchingCubes_default as MarchingCubes, MarchingPlane_default as MarchingPlane, component_default$11 as Mask, Merged_default as Merged, meshDiscardMaterial_default as MeshDiscardMaterial, meshGlassMaterial_default as MeshGlassMaterial, meshPortalMaterial_default as MeshPortalMaterial, meshReflectionMaterial_default as MeshReflectionMaterial, meshTransmissionMaterial_default as MeshTransmissionMaterial, meshWobbleMaterial_default as MeshWobbleMaterial, MouseParallax_default as MouseParallax, Ocean_default as Ocean, Octahedron_default as Octahedron, OrbitControls_default as OrbitControls, component_default$12 as Outline, Plane_default as Plane, component_default$13 as PointMaterial, PointerLockControls_default as PointerLockControls, PositionMesh, PositionalAudio_default as PositionalAudio, Precipitation_default as Precipitation, QuadraticBezierLine_default as QuadraticBezierLine, component_default$14 as RandomizedLights, Reflector_default as Reflector, Refractor_default as Refractor, Ring_default as Ring, RoundedBox_default as RoundedBox, RoundedPlane_default as RoundedPlane, component_default$15 as Sampler, ScreenQuad_default as ScreenQuad, ScreenSizer_default as ScreenSizer, ScreenSpace_default as ScreenSpace, ScrollControls_default as ScrollControls, Sky_default as Sky, Smoke_default as Smoke, SoftShadows_default as SoftShadows, component_default$16 as Sparkles, Sphere_default as Sphere, Stage_default as Stage, Stars_default as Stars, Stats, StatsGl, Superformula_default as Superformula, Tetrahedron_default as Tetrahedron, Text3D_default as Text3D, Torus_default as Torus, TorusKnot_default as TorusKnot, TransformControls_default as TransformControls, Tube_default as Tube, component_default$17 as UseSVG, component_default$18 as UseTexture, ensureTextureNames, extractBindingPosition, getTextureAspect, getTextureName, hasSetter, invalidateDecalGeometry, pick, useAnimations, useBVH, useDecalEditor, useEnvironment, useFBO, useFBX, useGLTF, useGLTFExporter, useHelper, useIntersect, useMask, useProgress, useSVG, useSurfaceSampler, useTexture, useTextures, useVideoTexture };
|