@ridp/threejs 0.0.2 → 0.2.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/common-DESmndxO.js +54 -0
- package/dist/common-nMt4tIRA.cjs +15 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/threejs.cjs +1 -1
- package/dist/threejs.js +12 -11
- package/dist/{useGLTFLoader-CoqckCZO.js → useGLTFLoader-BAoIZjEX.js} +205 -201
- package/dist/{useGLTFLoader-CkQCsokF.cjs → useGLTFLoader-CGOxhEOO.cjs} +6 -6
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +7 -6
- package/package.json +9 -2
- package/dist/common-DGdtPI9P.js +0 -28
- package/dist/common-DbWzzhhR.cjs +0 -1
- package/dist/draco/README.md +0 -32
- package/dist/draco/draco_decoder.js +0 -34
- package/dist/draco/draco_decoder.wasm +0 -0
- package/dist/draco/draco_encoder.js +0 -33
- package/dist/draco/draco_wasm_wrapper.js +0 -117
- package/dist/draco/gltf/draco_decoder.js +0 -33
- package/dist/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/draco/gltf/draco_encoder.js +0 -33
- package/dist/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/dist/hdr/slightly_overcast_sky_dome_1k.hdr +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { C as a } from "./disposeObject-CmFSSgi7.js";
|
|
2
|
+
function u(o, t = [0.3, 0.3, 0.3]) {
|
|
3
|
+
const e = document.querySelector(`#${o}`);
|
|
4
|
+
if (!e) {
|
|
5
|
+
console.log(" 获取 infoPlane 元素失败 (id) =====> :", o);
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const n = e.cloneNode(!0);
|
|
9
|
+
n.style.display = "block";
|
|
10
|
+
const r = new a(n);
|
|
11
|
+
return r.visible = !1, r.scale.set(...t), r;
|
|
12
|
+
}
|
|
13
|
+
function p(o, t) {
|
|
14
|
+
const e = c(o);
|
|
15
|
+
e.style.display = "block";
|
|
16
|
+
const n = new a(e);
|
|
17
|
+
return n.visible = !1, n.scale.set(t, t, t), n;
|
|
18
|
+
}
|
|
19
|
+
const c = (o) => {
|
|
20
|
+
const t = document.createElement("div");
|
|
21
|
+
t.style.cssText = `
|
|
22
|
+
border-radius: 50px;
|
|
23
|
+
border: 2px solid rgba(255, 255, 255, 0.5);
|
|
24
|
+
background-color: rgba(15, 20, 22, 0.562);
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: 20px 30px;
|
|
28
|
+
display: flex;
|
|
29
|
+
transform-origin: center 0;`;
|
|
30
|
+
const e = document.createElement("span");
|
|
31
|
+
return e.style.cssText = `
|
|
32
|
+
font-size: 40px;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
color: #fff;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
`, e.innerText = o, t.appendChild(e), t;
|
|
38
|
+
}, d = (o, t) => {
|
|
39
|
+
const e = {};
|
|
40
|
+
o.forEach((s) => {
|
|
41
|
+
let l = s.parent;
|
|
42
|
+
for (; l; )
|
|
43
|
+
e[l.uuid] ? e[l.uuid]++ : e[l.uuid] = 1, l = l.parent;
|
|
44
|
+
});
|
|
45
|
+
let n = null, r = 0;
|
|
46
|
+
for (const s in e)
|
|
47
|
+
e[s] > r && (r = e[s], n = t.getObjectByProperty("uuid", s));
|
|
48
|
+
return n;
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
p as a,
|
|
52
|
+
u as c,
|
|
53
|
+
d as g
|
|
54
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";const a=require("./disposeObject-BuI3II7v.cjs");function c(o,t=[.3,.3,.3]){const e=document.querySelector(`#${o}`);if(!e){console.log(" 获取 infoPlane 元素失败 (id) =====> :",o);return}const n=e.cloneNode(!0);n.style.display="block";const r=new a.CSS3DSprite(n);return r.visible=!1,r.scale.set(...t),r}function i(o,t){const e=u(o);e.style.display="block";const n=new a.CSS3DSprite(e);return n.visible=!1,n.scale.set(t,t,t),n}const u=o=>{const t=document.createElement("div");t.style.cssText=`
|
|
2
|
+
border-radius: 50px;
|
|
3
|
+
border: 2px solid rgba(255, 255, 255, 0.5);
|
|
4
|
+
background-color: rgba(15, 20, 22, 0.562);
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 20px 30px;
|
|
8
|
+
display: flex;
|
|
9
|
+
transform-origin: center 0;`;const e=document.createElement("span");return e.style.cssText=`
|
|
10
|
+
font-size: 40px;
|
|
11
|
+
line-height: 1;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
color: #fff;
|
|
14
|
+
font-weight: 700;
|
|
15
|
+
`,e.innerText=o,t.appendChild(e),t},p=(o,t)=>{const e={};o.forEach(s=>{let l=s.parent;for(;l;)e[l.uuid]?e[l.uuid]++:e[l.uuid]=1,l=l.parent});let n=null,r=0;for(const s in e)e[s]>r&&(r=e[s],n=t.getObjectByProperty("uuid",s));return n};exports.createInfoPlane=c;exports.createTagPlane=i;exports.getCommonParent=p;
|
package/dist/hooks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useGLTFLoader-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useGLTFLoader-CGOxhEOO.cjs");exports.initEnvImage=e.initEnvImage;exports.intersectColor=e.intersectColor;exports.obbObjects=e.obbObjects;exports.useGLTFLoader=e.useGLTFLoader;exports.useLight=e.useLight;exports.useObb=e.useObb;exports.useRaycaster=e.useRaycaster;exports.useThreeJs=e.useThreeJs;
|
package/dist/hooks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as a, b as o, o as r, e as t, d as b, c as u, a as i, u as c } from "./useGLTFLoader-
|
|
1
|
+
import { i as a, b as o, o as r, e as t, d as b, c as u, a as i, u as c } from "./useGLTFLoader-BAoIZjEX.js";
|
|
2
2
|
export {
|
|
3
3
|
a as initEnvImage,
|
|
4
4
|
o as intersectColor,
|
package/dist/threejs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useGLTFLoader-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useGLTFLoader-CGOxhEOO.cjs"),e=require("./disposeObject-BuI3II7v.cjs"),t=require("./common-nMt4tIRA.cjs");exports.initEnvImage=r.initEnvImage;exports.intersectColor=r.intersectColor;exports.obbObjects=r.obbObjects;exports.useGLTFLoader=r.useGLTFLoader;exports.useLight=r.useLight;exports.useObb=r.useObb;exports.useRaycaster=r.useRaycaster;exports.useThreeJs=r.useThreeJs;exports.createArrowHelper=e.createArrowHelper;exports.createAxesHelper=e.createAxesHelper;exports.createBox3Helper=e.createBox3Helper;exports.createCameraHelper=e.createCameraHelper;exports.createGridHelper=e.createGridHelper;exports.createMapControls=e.createMapControls;exports.createOrbitControl=e.createOrbitControl;exports.createRaycaster=e.createRaycaster;exports.disposeThreeObject=e.disposeThreeObject;exports.createInfoPlane=t.createInfoPlane;exports.createTagPlane=t.createTagPlane;exports.getCommonParent=t.getCommonParent;
|
package/dist/threejs.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { i as r, b as s, o as t, e as o, d as c, c as
|
|
2
|
-
import { h as
|
|
3
|
-
import { c as O, g as L } from "./common-
|
|
1
|
+
import { i as r, b as s, o as t, e as o, d as c, c as l, a as n, u as p } from "./useGLTFLoader-BAoIZjEX.js";
|
|
2
|
+
import { h as i, g as m, b as g, c as u, a as d, e as f, d as x, f as C, i as H } from "./disposeObject-CmFSSgi7.js";
|
|
3
|
+
import { c as O, a as T, g as L } from "./common-DESmndxO.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
i as createArrowHelper,
|
|
6
6
|
m as createAxesHelper,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
g as createBox3Helper,
|
|
8
|
+
u as createCameraHelper,
|
|
9
|
+
d as createGridHelper,
|
|
10
10
|
O as createInfoPlane,
|
|
11
|
-
|
|
11
|
+
f as createMapControls,
|
|
12
12
|
x as createOrbitControl,
|
|
13
13
|
C as createRaycaster,
|
|
14
|
+
T as createTagPlane,
|
|
14
15
|
H as disposeThreeObject,
|
|
15
16
|
L as getCommonParent,
|
|
16
17
|
r as initEnvImage,
|
|
@@ -18,7 +19,7 @@ export {
|
|
|
18
19
|
t as obbObjects,
|
|
19
20
|
o as useGLTFLoader,
|
|
20
21
|
c as useLight,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
l as useObb,
|
|
23
|
+
n as useRaycaster,
|
|
24
|
+
p as useThreeJs
|
|
24
25
|
};
|