@realsee/dnalogel 2.2.7 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CSS3DRenderPlugin/CSS3DRender.d.ts +48 -34
- package/dist/CSS3DRenderPlugin/Controller.d.ts +5 -5
- package/dist/CSS3DRenderPlugin/index.d.ts +2 -1
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +4 -0
- package/dist/CSS3DRenderPlugin/utils/even.d.ts +9 -0
- package/dist/CSS3DRenderPlugin/utils/generateBehindFiveElement.d.ts +2 -0
- package/dist/CSS3DRenderPlugin/utils/getAllCSS3DObject.d.ts +3 -0
- package/dist/CSS3DRenderPlugin/utils/index.d.ts +1 -1
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DGroup.d.ts +25 -0
- package/dist/CSS3DRenderPlugin/utils/{CSS3DObjectPlus.d.ts → three/CSS3DObject.d.ts} +31 -11
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +14 -0
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DScene.d.ts +12 -0
- package/dist/CSS3DRenderPlugin/utils/three/OpacityMesh.d.ts +6 -0
- package/dist/CSS3DRenderPlugin/utils/waitFiveModelLoaded.d.ts +2 -0
- package/dist/Object3DHelperPlugin/Controller.d.ts +2 -0
- package/dist/index.cjs.js +46 -46
- package/dist/index.js +4987 -4817
- package/dist/index.umd.js +39 -39
- package/dist/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.d.ts +2 -2
- package/docs/assets/highlight.css +7 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +533 -0
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +16 -16
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoTagPluginController.html +39 -39
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +12 -12
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/LinkType.html +7 -7
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +6 -5
- package/docs/functions/CameraMovementPlugin.html +6 -5
- package/docs/functions/CruisePlugin.html +6 -5
- package/docs/functions/GuideLinePlugin.html +7 -6
- package/docs/functions/ItemLabelPlugin.html +6 -5
- package/docs/functions/MapviewFloorplanPlugin.html +6 -5
- package/docs/functions/ModelChassisCompassPlugin.html +6 -5
- package/docs/functions/ModelEntryDoorGuidePlugin.html +6 -5
- package/docs/functions/ModelFloorplanPlugin.html +6 -5
- package/docs/functions/ModelItemLabelPlugin.html +6 -5
- package/docs/functions/ModelRoomLabelPlugin.html +6 -5
- package/docs/functions/ModelTVVideoPlugin.html +6 -5
- package/docs/functions/ModelViewPlugin.html +6 -5
- package/docs/functions/Object3DHelperPlugin.html +6 -5
- package/docs/functions/PanoCompassPlugin.html +6 -5
- package/docs/functions/PanoCursorRaycasterPlugin.html +6 -5
- package/docs/functions/PanoDoorLabelPlugin.html +6 -5
- package/docs/functions/PanoFloorplanRadarPlugin.html +6 -5
- package/docs/functions/PanoMeasurePlugin.html +6 -5
- package/docs/functions/PanoRulerPlugin.html +6 -5
- package/docs/functions/PanoRulerProPlugin.html +6 -5
- package/docs/functions/PanoSpatialTagPlugin.html +6 -5
- package/docs/functions/PanoTagPlugin.html +6 -5
- package/docs/functions/TopviewFloorplanPlugin.html +6 -5
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +7 -6
- package/docs/index.html +6 -5
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/ContentTypeMap.html +12 -12
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/LineJson.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +8 -8
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/OpenParameter.html +7 -7
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +7 -6
- package/docs/interfaces/PanoMeasureParameterType.html +11 -11
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +7 -6
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +7 -6
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/PointJson.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +7 -6
- package/docs/interfaces/Rooms.html +7 -6
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +7 -5
- package/docs/types/ArrayPosition.html +7 -6
- package/docs/types/CSS3DRenderExportType.html +8 -7
- package/docs/types/CSS3DRenderPluginExportType.html +7 -6
- package/docs/types/CSS3DRenderPluginParameterType.html +7 -6
- package/docs/types/Color.html +7 -6
- package/docs/types/ContentTypeConfigKey.html +7 -6
- package/docs/types/ContentTypeConfigKeyArray.html +7 -6
- package/docs/types/Create3DDomContainerReturnType.html +7 -6
- package/docs/types/Create3DElementReturnType.html +8 -7
- package/docs/types/CruisePluginExportType.html +7 -6
- package/docs/types/Direction-1.html +7 -6
- package/docs/types/Direction4.html +7 -6
- package/docs/types/FloorplanRuleLabels.html +7 -6
- package/docs/types/FloorplanServerRuleLabels.html +7 -6
- package/docs/types/GuideLinePluginExportType.html +7 -6
- package/docs/types/HelperEventMap.html +7 -6
- package/docs/types/MapviewFloorplanPluginParameterType.html +7 -6
- package/docs/types/MapviewFloorplanPluginReturnType.html +7 -6
- package/docs/types/MediaData.html +7 -6
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +7 -6
- package/docs/types/ModelFloorplanPluginParameterType.html +7 -6
- package/docs/types/ModelFloorplanPluginReturnType.html +7 -6
- package/docs/types/ModelRoomLabelPluginParameters.html +7 -6
- package/docs/types/ModelRoomLabelPluginReturnType.html +7 -6
- package/docs/types/MoveArgs.html +7 -6
- package/docs/types/MoveOpts.html +7 -6
- package/docs/types/Object3DHelperEventMap.html +7 -6
- package/docs/types/ObjectFit.html +7 -6
- package/docs/types/PaintBrushEventMap.html +7 -6
- package/docs/types/PanoCompassPluginData.html +7 -6
- package/docs/types/PanoCompassPluginExportType.html +7 -6
- package/docs/types/PanoCompassPluginParameterType.html +7 -6
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +7 -6
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +7 -6
- package/docs/types/PanoMeasurePluginEvent.html +7 -6
- package/docs/types/PanoMeasureReturnType.html +7 -6
- package/docs/types/PanoSpatialTagPluginId.html +7 -6
- package/docs/types/PanoTagPluginExportInterface.html +7 -6
- package/docs/types/PanoTagPluginParamsInterface.html +7 -6
- package/docs/types/PlaneTag.html +7 -6
- package/docs/types/PointTag.html +7 -6
- package/docs/types/Position.html +7 -6
- package/docs/types/RotateArgs.html +7 -6
- package/docs/types/RotateOpts.html +7 -6
- package/docs/types/RuleLabelsKey.html +7 -6
- package/docs/types/RuleLabelsValue.html +7 -6
- package/docs/types/Tag.html +7 -6
- package/docs/types/Tag2D.html +7 -6
- package/docs/types/Tag3D.html +7 -6
- package/docs/types/TagId.html +7 -6
- package/docs/types/TopviewFloorplanPluginParameterType.html +7 -6
- package/docs/types/TopviewFloorplanPluginReturnType.html +7 -6
- package/docs/variables/FLOOR_TYPE_MAP.html +7 -6
- package/docs/variables/PLUGIN.html +7 -6
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +7 -6
- package/docs/variables/ROOM_TYPE_MAP.html +7 -6
- package/docs/variables/VERSION.html +7 -6
- package/docs/variables/itemLabelPluginServerParams.html +7 -6
- package/docs/variables/modelItemLabelPluginServerParams.html +7 -6
- package/docs/variables/modelRoomLabelPluginServerParams.html +7 -6
- package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +48 -34
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +197 -256
- package/libs/CSS3DRenderPlugin/Controller.d.ts +5 -5
- package/libs/CSS3DRenderPlugin/Controller.js +59 -62
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -1
- package/libs/CSS3DRenderPlugin/index.js +17 -8
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +4 -0
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +22 -0
- package/libs/CSS3DRenderPlugin/utils/even.d.ts +9 -0
- package/libs/CSS3DRenderPlugin/utils/even.js +7 -0
- package/libs/CSS3DRenderPlugin/utils/generateBehindFiveElement.d.ts +2 -0
- package/libs/CSS3DRenderPlugin/utils/generateBehindFiveElement.js +29 -0
- package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.d.ts +3 -0
- package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.js +9 -0
- package/libs/CSS3DRenderPlugin/utils/index.d.ts +1 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DGroup.d.ts +25 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DGroup.js +53 -0
- package/libs/CSS3DRenderPlugin/utils/{CSS3DObjectPlus.d.ts → three/CSS3DObject.d.ts} +31 -11
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +115 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +14 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +46 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DScene.d.ts +12 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DScene.js +39 -0
- package/libs/CSS3DRenderPlugin/utils/three/OpacityMesh.d.ts +6 -0
- package/libs/CSS3DRenderPlugin/utils/three/OpacityMesh.js +18 -0
- package/libs/CSS3DRenderPlugin/utils/waitFiveModelLoaded.d.ts +2 -0
- package/libs/CSS3DRenderPlugin/utils/waitFiveModelLoaded.js +31 -0
- package/libs/CruisePlugin/Controller.js +16 -16
- package/libs/ModelTVVideoPlugin/Plugin.js +60 -52
- package/libs/ModelTVVideoPlugin/index.js +15 -7
- package/libs/Object3DHelperPlugin/Controller.d.ts +2 -0
- package/libs/Object3DHelperPlugin/Controller.js +103 -83
- package/libs/Object3DHelperPlugin/index.js +20 -12
- package/libs/PanoCompassPlugin/Controller.js +49 -41
- package/libs/PanoCompassPlugin/index.js +13 -5
- package/libs/PanoSpatialTagPlugin/Plugin.js +46 -38
- package/libs/PanoSpatialTagPlugin/index.js +13 -5
- package/libs/PanoTagPlugin/index.js +21 -13
- package/libs/index.js +102 -93
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +8 -7
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.d.ts +2 -2
- package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -0
- package/libs/shared-utils/three/index.js +2 -1
- package/package.json +15 -14
- package/dist/CSS3DRenderPlugin/utils/evenNumber.d.ts +0 -3
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +0 -66
- package/libs/CSS3DRenderPlugin/utils/evenNumber.d.ts +0 -3
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +0 -7
|
@@ -1,61 +1,73 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var e in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
D.call(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
import { CSS3DRender as
|
|
15
|
-
import "
|
|
1
|
+
var C = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var F = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var b = Object.getOwnPropertySymbols;
|
|
4
|
+
var R = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var m = (r, t, e) => t in r ? C(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, p = (r, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
R.call(t, e) && m(r, e, t[e]);
|
|
8
|
+
if (b)
|
|
9
|
+
for (var e of b(t))
|
|
10
|
+
D.call(t, e) && m(r, e, t[e]);
|
|
11
|
+
return r;
|
|
12
|
+
}, l = (r, t) => E(r, F(t));
|
|
13
|
+
var d = (r, t, e) => (m(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
import { CSS3DRender as S } from "./CSS3DRender.js";
|
|
15
|
+
import { fiveModelLoaded as $ } from "./utils/waitFiveModelLoaded.js";
|
|
16
|
+
import { generateBehindFiveElement as j } from "./utils/generateBehindFiveElement.js";
|
|
17
|
+
import "./utils/three/CSS3DRenderer.js";
|
|
16
18
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
19
|
+
import "./utils/getAllCSS3DObject.js";
|
|
20
|
+
import "./utils/createResizeObserver.js";
|
|
21
|
+
import "./utils/even.js";
|
|
17
22
|
import "../shared-utils/Subscribe.js";
|
|
18
|
-
import "
|
|
23
|
+
import "three";
|
|
19
24
|
import "./utils/positionToVector3.js";
|
|
20
|
-
import "./utils/
|
|
25
|
+
import "./utils/three/CSS3DObject.js";
|
|
21
26
|
import "./utils/centerPoint.js";
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
import "./utils/three/OpacityMesh.js";
|
|
28
|
+
import "./utils/three/CSS3DScene.js";
|
|
29
|
+
import "./utils/three/CSS3DGroup.js";
|
|
30
|
+
const x = "v2.0.1", v = `CSS3DRenderPlugin@${x}`;
|
|
31
|
+
class z extends S {
|
|
24
32
|
constructor(e) {
|
|
25
33
|
super();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
d(this, "five");
|
|
35
|
+
d(this, "behindFiveContainer");
|
|
36
|
+
d(this, "staticPrefix", "//vrlab-static.ljcdn.com");
|
|
37
|
+
d(this, "create3DDomContainer", (e, i) => {
|
|
30
38
|
if (this.state.disposed)
|
|
31
39
|
return;
|
|
32
|
-
const
|
|
33
|
-
var
|
|
34
|
-
(
|
|
35
|
-
const
|
|
40
|
+
const o = (() => {
|
|
41
|
+
var f;
|
|
42
|
+
(i == null ? void 0 : i.dpr) !== void 0 && console.warn(`${v}: please use "config.devicePixelRatio" replace "config.dpr"`);
|
|
43
|
+
const s = {
|
|
36
44
|
ratio: 216e-5,
|
|
37
|
-
devicePixelRatio: (
|
|
45
|
+
devicePixelRatio: (f = i == null ? void 0 : i.dpr) != null ? f : 1,
|
|
38
46
|
mode: "front",
|
|
39
47
|
autoRender: !0
|
|
40
48
|
};
|
|
41
|
-
return Object.assign(
|
|
42
|
-
})(),
|
|
43
|
-
if (!
|
|
44
|
-
console.error(`${
|
|
49
|
+
return Object.assign(s, i, (i == null ? void 0 : i.mode) === "behind" ? { scene: this.five.scene } : void 0);
|
|
50
|
+
})(), a = this.five.getElement();
|
|
51
|
+
if (!a) {
|
|
52
|
+
console.error(`${v}: five.getElement() is ${a}`);
|
|
45
53
|
return;
|
|
46
54
|
}
|
|
47
|
-
const { autoRender:
|
|
48
|
-
this.
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const m = this.create3DElement(this.five.camera, e, h(p({}, n), { autoRender: !1 }));
|
|
52
|
-
if (!m)
|
|
55
|
+
const { autoRender: h } = o;
|
|
56
|
+
o.mode === "behind" && o.behindFiveContainer && (this.behindFiveContainer = o.behindFiveContainer);
|
|
57
|
+
const n = this.create3DElement(this.five.camera, e, l(p({}, o), { autoRender: !1 }));
|
|
58
|
+
if (!n)
|
|
53
59
|
return;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
const c = () => {
|
|
61
|
+
const s = n.css3DObject.mode === "front" ? a.parentElement : this.getBehindFiveElement();
|
|
62
|
+
if (!s)
|
|
63
|
+
return console.error(`${v}: wrapper is ${s}`);
|
|
64
|
+
n.appendToElement(s), n.render();
|
|
65
|
+
}, u = () => {
|
|
66
|
+
n.css3DObject.mode === "front" && c(), n.css3DObject.mode === "behind" && $(this.five).then(() => {
|
|
67
|
+
c();
|
|
68
|
+
});
|
|
57
69
|
};
|
|
58
|
-
return
|
|
70
|
+
return h && u(), l(p({}, n), { render: h ? void 0 : u });
|
|
59
71
|
});
|
|
60
72
|
this.five = e;
|
|
61
73
|
}
|
|
@@ -63,29 +75,14 @@ class M extends w {
|
|
|
63
75
|
return this.dispose();
|
|
64
76
|
}
|
|
65
77
|
setState(...e) {
|
|
66
|
-
const
|
|
67
|
-
return this.five.needsRender = !0,
|
|
78
|
+
const i = super.setState(...e);
|
|
79
|
+
return this.five.needsRender = !0, i;
|
|
68
80
|
}
|
|
69
81
|
getBehindFiveElement() {
|
|
70
|
-
|
|
71
|
-
const { behindFiveContainer: e } = this;
|
|
72
|
-
if (e)
|
|
73
|
-
return e;
|
|
74
|
-
const t = document.createElement("div");
|
|
75
|
-
t.style.position = "absolute", t.style.pointerEvents = "none", t.style.top = "0", t.style.left = "0", t.style.width = "100%", t.style.height = "100%", this.behindFiveContainer = t;
|
|
76
|
-
const n = this.five.getElement();
|
|
77
|
-
if (!n)
|
|
78
|
-
return;
|
|
79
|
-
const o = (r = n == null ? void 0 : n.style.position) != null ? r : getComputedStyle(n);
|
|
80
|
-
(!o || o === "static") && console.warn(
|
|
81
|
-
"if you want to use css3DRenderPlugin behind mode, five element position is static, please set position to relative or absolute"
|
|
82
|
-
);
|
|
83
|
-
const d = n == null ? void 0 : n.parentElement;
|
|
84
|
-
if (d)
|
|
85
|
-
return d.insertBefore(t, n), t;
|
|
82
|
+
return this.behindFiveContainer ? this.behindFiveContainer : (this.behindFiveContainer = j(this.five), this.behindFiveContainer);
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
v as PLUGIN_NAME,
|
|
87
|
+
z as default
|
|
91
88
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FivePlugin } from '@realsee/five';
|
|
2
2
|
import Controller from './Controller';
|
|
3
|
-
export * from './typing';
|
|
4
3
|
export declare const CSS3DRenderPlugin: FivePlugin<void, InstanceType<typeof Controller>>;
|
|
4
|
+
export { CSS3DRender } from './CSS3DRender';
|
|
5
|
+
export * from './typing';
|
|
5
6
|
export default CSS3DRenderPlugin;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./CSS3DRender.js";
|
|
3
|
-
import "
|
|
1
|
+
import o from "./Controller.js";
|
|
2
|
+
import { CSS3DRender as w } from "./CSS3DRender.js";
|
|
3
|
+
import "./utils/waitFiveModelLoaded.js";
|
|
4
|
+
import "./utils/generateBehindFiveElement.js";
|
|
5
|
+
import "./utils/three/CSS3DRenderer.js";
|
|
4
6
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
7
|
+
import "./utils/getAllCSS3DObject.js";
|
|
8
|
+
import "./utils/createResizeObserver.js";
|
|
9
|
+
import "./utils/even.js";
|
|
5
10
|
import "../shared-utils/Subscribe.js";
|
|
6
|
-
import "
|
|
11
|
+
import "three";
|
|
7
12
|
import "./utils/positionToVector3.js";
|
|
8
|
-
import "./utils/
|
|
13
|
+
import "./utils/three/CSS3DObject.js";
|
|
9
14
|
import "./utils/centerPoint.js";
|
|
10
|
-
|
|
15
|
+
import "./utils/three/OpacityMesh.js";
|
|
16
|
+
import "./utils/three/CSS3DScene.js";
|
|
17
|
+
import "./utils/three/CSS3DGroup.js";
|
|
18
|
+
const R = (r) => new o(r);
|
|
11
19
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
w as CSS3DRender,
|
|
21
|
+
R as CSS3DRenderPlugin,
|
|
22
|
+
R as default
|
|
14
23
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { even as o } from "./even.js";
|
|
2
|
+
function u(e, i, n = !0) {
|
|
3
|
+
if (!e)
|
|
4
|
+
return console.error("createResizeObserver: element is undefined"), { observe: () => {
|
|
5
|
+
}, unobserve: () => {
|
|
6
|
+
} };
|
|
7
|
+
const r = () => {
|
|
8
|
+
const t = o(e.clientWidth, { floor: !0 }), v = o(e.clientHeight, { floor: !0 });
|
|
9
|
+
i(t, v);
|
|
10
|
+
};
|
|
11
|
+
if (typeof ResizeObserver == "undefined" || !ResizeObserver)
|
|
12
|
+
return console.warn("createResizeObserver: ResizeObserver is undefined"), { observe: () => r(), unobserve: () => {
|
|
13
|
+
} };
|
|
14
|
+
const s = new ResizeObserver(r);
|
|
15
|
+
return n && r(), {
|
|
16
|
+
observe: () => s.observe(e),
|
|
17
|
+
unobserve: () => s.unobserve(e)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as createResizeObserver
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const n = document.createElement("div");
|
|
2
|
+
n.style.position = "absolute";
|
|
3
|
+
n.style.top = "0";
|
|
4
|
+
n.style.left = "0";
|
|
5
|
+
n.style.width = "100%";
|
|
6
|
+
n.style.height = "100%";
|
|
7
|
+
function s(t) {
|
|
8
|
+
var o, r;
|
|
9
|
+
const e = (r = l(t.getElement())) != null ? r : l((o = t.getElement()) == null ? void 0 : o.parentElement);
|
|
10
|
+
if (e != null && e.parentElement)
|
|
11
|
+
return e.parentElement.insertBefore(n, e), n;
|
|
12
|
+
console.error(
|
|
13
|
+
"Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/blob/main/plugins/src/PanoTagPlugin/README.md"
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function l(t) {
|
|
17
|
+
var i;
|
|
18
|
+
if (!t)
|
|
19
|
+
return;
|
|
20
|
+
const e = (i = t.style.position) != null ? i : getComputedStyle(t).position;
|
|
21
|
+
if (e !== "fixed" && e !== "absolute" && e !== "relative")
|
|
22
|
+
return;
|
|
23
|
+
const o = getComputedStyle(t).backgroundColor;
|
|
24
|
+
if (!(o !== "transparent" && o !== "rgba(0, 0, 0, 0)"))
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
s as generateBehindFiveElement
|
|
29
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Subscribe } from '../../../shared-utils/Subscribe';
|
|
3
|
+
import type { Object3D } from 'three';
|
|
4
|
+
import type { Mode } from './CSS3DObject';
|
|
5
|
+
export declare class CSS3DGroup extends THREE.Group {
|
|
6
|
+
readonly isCSS3DGroup = true;
|
|
7
|
+
mode: Mode;
|
|
8
|
+
CSS3DObjectLength: number;
|
|
9
|
+
hooks: Subscribe<{
|
|
10
|
+
visibleChange: (visible: boolean) => void;
|
|
11
|
+
}>;
|
|
12
|
+
constructor(mode: Mode);
|
|
13
|
+
add(...objects: Object3D[]): this;
|
|
14
|
+
setVisible(visible: boolean): void;
|
|
15
|
+
remove(...objects: Object3D[]): this;
|
|
16
|
+
private updateLength;
|
|
17
|
+
}
|
|
18
|
+
export declare class CSS3DFrontGroup extends CSS3DGroup {
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
21
|
+
export declare class CSS3DBehindGroup extends CSS3DGroup {
|
|
22
|
+
private scene;
|
|
23
|
+
constructor(scene: THREE.Scene);
|
|
24
|
+
add(...objects: Object3D[]): this;
|
|
25
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var d = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var s = (r, t, e) => (d(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import * as u from "three";
|
|
5
|
+
import { Subscribe as p } from "../../../shared-utils/Subscribe.js";
|
|
6
|
+
import { getAllCSS3DObject as i } from "../getAllCSS3DObject.js";
|
|
7
|
+
class h extends u.Group {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
super();
|
|
10
|
+
s(this, "isCSS3DGroup", !0);
|
|
11
|
+
s(this, "mode");
|
|
12
|
+
s(this, "CSS3DObjectLength", 0);
|
|
13
|
+
s(this, "hooks", new p());
|
|
14
|
+
this.mode = e;
|
|
15
|
+
}
|
|
16
|
+
add(...e) {
|
|
17
|
+
return i(...e).forEach((o) => {
|
|
18
|
+
o.mode = this.mode;
|
|
19
|
+
}), super.add(...e), this.updateLength(), this;
|
|
20
|
+
}
|
|
21
|
+
setVisible(e) {
|
|
22
|
+
this.visible = e, this.hooks.emit("visibleChange", e);
|
|
23
|
+
}
|
|
24
|
+
remove(...e) {
|
|
25
|
+
return super.remove(...e), this.updateLength(), this;
|
|
26
|
+
}
|
|
27
|
+
updateLength() {
|
|
28
|
+
this.CSS3DObjectLength = i(this).length;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class m extends h {
|
|
32
|
+
constructor() {
|
|
33
|
+
super("front");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class g extends h {
|
|
37
|
+
constructor(e) {
|
|
38
|
+
super("behind");
|
|
39
|
+
s(this, "scene");
|
|
40
|
+
if (!e)
|
|
41
|
+
throw new Error("CSS3DBehindScene: scene is required");
|
|
42
|
+
this.scene = e;
|
|
43
|
+
}
|
|
44
|
+
add(...e) {
|
|
45
|
+
return i(...e).forEach((o) => {
|
|
46
|
+
this.scene.add(o.getOpacityMesh());
|
|
47
|
+
}), super.add(...e), this;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
g as CSS3DBehindGroup,
|
|
52
|
+
m as CSS3DFrontGroup
|
|
53
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
2
2
|
import { Matrix4, Quaternion, Vector3 } from 'three';
|
|
3
|
-
import { Subscribe } from '
|
|
4
|
-
import
|
|
3
|
+
import { Subscribe } from '../../../shared-utils/Subscribe';
|
|
4
|
+
import OpacityMesh from './OpacityMesh';
|
|
5
5
|
export declare const MinRatio = 0.00216;
|
|
6
6
|
export declare const DefaultRatio = 0.003;
|
|
7
7
|
export declare type Mode = 'front' | 'behind';
|
|
@@ -10,25 +10,45 @@ export declare type CSS3DRenderEventMap = {
|
|
|
10
10
|
applyMatrix4: (matrix: Matrix4) => void;
|
|
11
11
|
applyQuaternion: (quaternion: Quaternion) => void;
|
|
12
12
|
applyScaleMatrix4: (matrix: Matrix4) => void;
|
|
13
|
-
changeMode: <T extends Mode = Mode>(mode: T, prevMode: Mode, scene: T extends 'behind' ? THREE.Scene : undefined) => void;
|
|
14
13
|
};
|
|
15
14
|
export declare class CSS3DObjectPlus<T extends HTMLElement = HTMLElement> extends CSS3DObject {
|
|
16
|
-
version:
|
|
15
|
+
version: number;
|
|
16
|
+
readonly isCSS3DObjectPlus: true;
|
|
17
|
+
container: T;
|
|
17
18
|
width: number;
|
|
18
19
|
height: number;
|
|
19
20
|
domWidthPx: number;
|
|
20
21
|
domHeightPx: number;
|
|
21
22
|
cornerPoints: CornerPoints;
|
|
22
|
-
ratio: number;
|
|
23
|
-
container: T;
|
|
24
23
|
centerPosition: Vector3;
|
|
24
|
+
ratio: number;
|
|
25
25
|
mode: 'front' | 'behind';
|
|
26
26
|
readonly hooks: Subscribe<CSS3DRenderEventMap>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
opacityMesh?: OpacityMesh;
|
|
28
|
+
private selfVisible;
|
|
29
|
+
private parentVisibleListenerDisposer?;
|
|
30
|
+
constructor(params: {
|
|
31
|
+
container: T;
|
|
32
|
+
mode?: 'front' | 'behind';
|
|
33
|
+
cornerPoints: CornerPoints;
|
|
34
|
+
ratio?: number;
|
|
35
|
+
dpr?: number;
|
|
36
|
+
pointerEvents?: 'none' | 'auto';
|
|
37
|
+
});
|
|
38
|
+
setVisible(visible: boolean, params?: {
|
|
39
|
+
setSelfVisible: boolean;
|
|
40
|
+
}): void;
|
|
41
|
+
removeFromParent(): this;
|
|
42
|
+
removeOpacityMesh(): this;
|
|
43
|
+
dispose(): void;
|
|
44
|
+
getOpacityMesh(): OpacityMesh;
|
|
32
45
|
applyMatrix4(matrix: Matrix4): void;
|
|
33
46
|
applyQuaternion(quaternion: Quaternion): this;
|
|
47
|
+
applyScaleMatrix4(matrix: Matrix4): void;
|
|
48
|
+
/**
|
|
49
|
+
* @description: 生成透明Mesh
|
|
50
|
+
*/
|
|
51
|
+
private createOpacityMesh;
|
|
52
|
+
private addParentVisibleListener;
|
|
53
|
+
private removeParentVisibleListener;
|
|
34
54
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var $ = Object.defineProperty;
|
|
2
|
+
var D = (a, r, t) => r in a ? $(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
|
|
3
|
+
var i = (a, r, t) => (D(a, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
import { CSS3DObject as F } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
5
|
+
import { Vector3 as l } from "three";
|
|
6
|
+
import { even as S } from "../even.js";
|
|
7
|
+
import { centerPoint as W } from "../centerPoint.js";
|
|
8
|
+
import { Subscribe as H } from "../../../shared-utils/Subscribe.js";
|
|
9
|
+
import { OpecityMesh as k } from "./OpacityMesh.js";
|
|
10
|
+
const w = 1, A = `CSS3DObjectPlus@${w}`, Q = 216e-5, R = 3e-3;
|
|
11
|
+
class U extends F {
|
|
12
|
+
constructor(t) {
|
|
13
|
+
var v, x, V;
|
|
14
|
+
const e = t.container, s = t.cornerPoints, n = (v = t.ratio) != null ? v : R, P = (x = t.dpr) != null ? x : 1, E = (V = t.pointerEvents) != null ? V : "auto", h = Math.max(Q, n), d = s[0].distanceTo(s[1]), m = s[1].distanceTo(s[2]), c = S(d / n * P), p = S(m / n * P), y = W(...s);
|
|
15
|
+
let u;
|
|
16
|
+
if (h === n)
|
|
17
|
+
e.style.width = `${c}px`, e.style.height = `${p}px`, u = e;
|
|
18
|
+
else {
|
|
19
|
+
const o = document.createElement("div");
|
|
20
|
+
o.style.width = `${c}px`, o.style.height = `${p}px`, o.style.pointerEvents = "none";
|
|
21
|
+
const g = n / h;
|
|
22
|
+
e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.width = `${g * c}px`, e.style.height = `${g * p}px`, o.appendChild(e), u = o;
|
|
23
|
+
}
|
|
24
|
+
super(u);
|
|
25
|
+
i(this, "version", w);
|
|
26
|
+
i(this, "isCSS3DObjectPlus", !0);
|
|
27
|
+
i(this, "container");
|
|
28
|
+
i(this, "width");
|
|
29
|
+
i(this, "height");
|
|
30
|
+
i(this, "domWidthPx");
|
|
31
|
+
i(this, "domHeightPx");
|
|
32
|
+
i(this, "cornerPoints");
|
|
33
|
+
i(this, "centerPosition");
|
|
34
|
+
i(this, "ratio");
|
|
35
|
+
i(this, "mode", "front");
|
|
36
|
+
i(this, "hooks", new H());
|
|
37
|
+
i(this, "opacityMesh");
|
|
38
|
+
i(this, "selfVisible", !0);
|
|
39
|
+
i(this, "parentVisibleListenerDisposer");
|
|
40
|
+
i(this, "createOpacityMesh", (t) => {
|
|
41
|
+
const { domWidthPx: e, domHeightPx: s } = t, n = new k(e, s);
|
|
42
|
+
return n.position.copy(t.position), n.rotation.copy(t.rotation), n.scale.copy(t.scale), n;
|
|
43
|
+
});
|
|
44
|
+
i(this, "addParentVisibleListener", () => {
|
|
45
|
+
var t;
|
|
46
|
+
if ((t = this.parent) != null && t.isCSS3DGroup) {
|
|
47
|
+
const e = this.parent, s = (n) => {
|
|
48
|
+
this.setVisible(n && this.selfVisible, { setSelfVisible: !1 });
|
|
49
|
+
};
|
|
50
|
+
e.hooks.on("visibleChange", s), this.parentVisibleListenerDisposer = () => e.hooks.off("visibleChange", s);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
i(this, "removeParentVisibleListener", () => {
|
|
54
|
+
var t;
|
|
55
|
+
(t = this.parentVisibleListenerDisposer) == null || t.call(this);
|
|
56
|
+
});
|
|
57
|
+
if (e.style.pointerEvents = E, this.scale.set(h, h, h), this.cornerPoints = s, this.ratio = n, this.container = e, t.mode && (this.mode = t.mode), h === n)
|
|
58
|
+
this.width = d, this.height = m, this.domWidthPx = c, this.domHeightPx = p, this.centerPosition = y;
|
|
59
|
+
else {
|
|
60
|
+
const o = n / h;
|
|
61
|
+
this.width = o * d, this.height = o * m, this.domWidthPx = o * c, this.domHeightPx = o * p, this.centerPosition = new l().subVectors(y, s[0]).multiplyScalar(o).add(s[0]);
|
|
62
|
+
}
|
|
63
|
+
e.classList.add(`${A}__container`);
|
|
64
|
+
const L = new l().subVectors(s[1], s[0]), M = new l().subVectors(s[3], s[0]), O = new l().crossVectors(L, M).normalize();
|
|
65
|
+
this.lookAt(O);
|
|
66
|
+
const f = this.up.clone().applyQuaternion(this.quaternion), b = M.clone(), C = new l().crossVectors(f, b).normalize();
|
|
67
|
+
this.rotateOnWorldAxis(C, f.angleTo(b)), this.position.copy(y), this.addEventListener("added", () => {
|
|
68
|
+
var o;
|
|
69
|
+
this.mode === "front" && ((o = this.opacityMesh) == null || o.removeFromParent()), this.addParentVisibleListener();
|
|
70
|
+
}), this.addEventListener("removed", () => {
|
|
71
|
+
var o;
|
|
72
|
+
(o = this.opacityMesh) == null || o.removeFromParent(), this.removeParentVisibleListener();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
setVisible(t, e = { setSelfVisible: !0 }) {
|
|
76
|
+
e.setSelfVisible && (this.selfVisible = t), this.visible = t, this.opacityMesh && (this.opacityMesh.visible = t);
|
|
77
|
+
}
|
|
78
|
+
removeFromParent() {
|
|
79
|
+
var e;
|
|
80
|
+
const t = this.parent;
|
|
81
|
+
return t !== null && t.remove(this), (e = this.opacityMesh) == null || e.removeFromParent(), this;
|
|
82
|
+
}
|
|
83
|
+
removeOpacityMesh() {
|
|
84
|
+
var t;
|
|
85
|
+
return (t = this.opacityMesh) == null || t.removeFromParent(), this.opacityMesh = void 0, this;
|
|
86
|
+
}
|
|
87
|
+
dispose() {
|
|
88
|
+
var t;
|
|
89
|
+
this.container.remove(), this.removeFromParent(), (t = this.opacityMesh) == null || t.removeFromParent();
|
|
90
|
+
}
|
|
91
|
+
getOpacityMesh() {
|
|
92
|
+
if (this.opacityMesh)
|
|
93
|
+
return this.opacityMesh;
|
|
94
|
+
{
|
|
95
|
+
const t = this.createOpacityMesh(this);
|
|
96
|
+
return this.opacityMesh = t, t;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
applyMatrix4(t) {
|
|
100
|
+
var e;
|
|
101
|
+
super.applyMatrix4(t), (e = this.opacityMesh) == null || e.applyMatrix4(t);
|
|
102
|
+
}
|
|
103
|
+
applyQuaternion(t) {
|
|
104
|
+
var e;
|
|
105
|
+
return super.applyQuaternion(t), (e = this.opacityMesh) == null || e.applyQuaternion(t), this;
|
|
106
|
+
}
|
|
107
|
+
applyScaleMatrix4(t) {
|
|
108
|
+
var e;
|
|
109
|
+
this.scale.applyMatrix4(t), (e = this.opacityMesh) == null || e.scale.applyMatrix4(t);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
U as CSS3DObjectPlus,
|
|
114
|
+
Q as MinRatio
|
|
115
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
2
|
+
import type * as THREE from 'three';
|
|
3
|
+
export default class ICSS3DRenderer extends CSS3DRenderer {
|
|
4
|
+
wrapper?: HTMLElement;
|
|
5
|
+
private requestAnimationFrameId?;
|
|
6
|
+
private resizeDisoper?;
|
|
7
|
+
constructor();
|
|
8
|
+
setWrapper(wrapper: HTMLElement): this;
|
|
9
|
+
appendToElement(wrapper: HTMLElement): void;
|
|
10
|
+
renderEveryFrame(scene: THREE.Scene, camera: THREE.Camera): void;
|
|
11
|
+
stopRender(): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
14
|
+
export { ICSS3DRenderer };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var l = (r, t, e) => t in r ? d(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var s = (r, t, e) => (l(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { CSS3DRenderer as p } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
5
|
+
import { getAllCSS3DObject as h } from "../getAllCSS3DObject.js";
|
|
6
|
+
import { createResizeObserver as u } from "../createResizeObserver.js";
|
|
7
|
+
class v extends p {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
s(this, "wrapper");
|
|
11
|
+
s(this, "requestAnimationFrameId");
|
|
12
|
+
s(this, "resizeDisoper");
|
|
13
|
+
this.domElement.style.position = "absolute", this.domElement.style.top = "0", this.domElement.style.left = "0", this.domElement.style.userSelect = "none", this.domElement.style.pointerEvents = "none";
|
|
14
|
+
}
|
|
15
|
+
setWrapper(e) {
|
|
16
|
+
if (!e)
|
|
17
|
+
throw new Error("CSS3DRenderer: wrapper is required");
|
|
18
|
+
if (e.contains(this.domElement))
|
|
19
|
+
return;
|
|
20
|
+
const i = this.wrapper;
|
|
21
|
+
return i && i.contains(this.domElement) && this.domElement.remove(), this.appendToElement(e), this.wrapper = e, this;
|
|
22
|
+
}
|
|
23
|
+
appendToElement(e) {
|
|
24
|
+
e.appendChild(this.domElement);
|
|
25
|
+
const i = (m, a) => this.setSize(m, a), { observe: n, unobserve: o } = u(e, i, !0);
|
|
26
|
+
n(), this.resizeDisoper = o, this.wrapper = e;
|
|
27
|
+
}
|
|
28
|
+
renderEveryFrame(e, i) {
|
|
29
|
+
if (this.wrapper || console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)", this, e), this.requestAnimationFrameId)
|
|
30
|
+
return console.warn("CSS3DRenderer: render is running");
|
|
31
|
+
const n = () => {
|
|
32
|
+
this.requestAnimationFrameId = requestAnimationFrame(n), !!e.visible && h(e).length !== 0 && this.render(e, i);
|
|
33
|
+
};
|
|
34
|
+
n();
|
|
35
|
+
}
|
|
36
|
+
stopRender() {
|
|
37
|
+
this.requestAnimationFrameId && cancelAnimationFrame(this.requestAnimationFrameId);
|
|
38
|
+
}
|
|
39
|
+
dispose() {
|
|
40
|
+
var e;
|
|
41
|
+
this.stopRender(), (e = this.resizeDisoper) == null || e.call(this), this.domElement.remove();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
v as ICSS3DRenderer
|
|
46
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export declare class CSS3DFrontScene extends THREE.Scene {
|
|
4
|
+
constructor();
|
|
5
|
+
add(...objects: Object3D[]): this;
|
|
6
|
+
}
|
|
7
|
+
export declare class CSS3DBehindScene extends THREE.Scene {
|
|
8
|
+
private scene;
|
|
9
|
+
constructor(scene: THREE.Scene);
|
|
10
|
+
add(...objects: Object3D[]): this;
|
|
11
|
+
remove(...objects: Object3D[]): this;
|
|
12
|
+
}
|