@ridp/threejs 0.2.0 → 1.1.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/ImageLoader-CB_URfeZ.js +860 -0
- package/dist/ImageLoader-DwvBWW6h.cjs +5 -0
- package/dist/common-BHi3qsZW.cjs +15 -0
- package/dist/{common-DESmndxO.js → common-fbJUHqlj.js} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +7 -9
- package/dist/threejs.cjs +1 -1
- package/dist/threejs.js +17 -15
- package/dist/useGLTFLoader-DHxBLucO.js +5629 -0
- package/dist/useGLTFLoader-DM3-7jdq.cjs +4 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +15 -12
- package/esdoc/ast/source/.external-ecmascript.js.json +2802 -0
- package/esdoc/ast/source/hooks/index.js.json +739 -0
- package/esdoc/ast/source/hooks/useGLTFLoader.js.json +9111 -0
- package/esdoc/ast/source/hooks/useObb.js.json +16463 -0
- package/esdoc/ast/source/hooks/useRaycaster.js.json +15556 -0
- package/esdoc/ast/source/hooks/useThreeJs.js.json +52887 -0
- package/esdoc/ast/source/index.js.json +570 -0
- package/esdoc/ast/source/instance/IDBCache.js.json +40978 -0
- package/esdoc/ast/source/instance/index.js.json +232 -0
- package/esdoc/ast/source/utils/ImageLoader.js.json +7037 -0
- package/esdoc/ast/source/utils/common.js.json +5134 -0
- package/esdoc/ast/source/utils/css3dHelper.js.json +9101 -0
- package/esdoc/ast/source/utils/disposeObject.js.json +5978 -0
- package/esdoc/ast/source/utils/helper.js.json +10522 -0
- package/esdoc/ast/source/utils/index.js.json +908 -0
- package/esdoc/badge.svg +17 -0
- package/esdoc/class/src/instance/IDBCache.js~IDBCache.html +1299 -0
- package/esdoc/coverage.json +86 -0
- package/esdoc/css/github.css +83 -0
- package/esdoc/css/identifiers.css +37 -0
- package/esdoc/css/manual.css +134 -0
- package/esdoc/css/prettify-tomorrow.css +132 -0
- package/esdoc/css/search.css +84 -0
- package/esdoc/css/source.css +55 -0
- package/esdoc/css/style.css +608 -0
- package/esdoc/css/test.css +58 -0
- package/esdoc/file/src/hooks/index.js.html +79 -0
- package/esdoc/file/src/hooks/useGLTFLoader.js.html +146 -0
- package/esdoc/file/src/hooks/useObb.js.html +149 -0
- package/esdoc/file/src/hooks/useRaycaster.js.html +153 -0
- package/esdoc/file/src/hooks/useThreeJs.js.html +362 -0
- package/esdoc/file/src/index.js.html +78 -0
- package/esdoc/file/src/instance/IDBCache.js.html +312 -0
- package/esdoc/file/src/instance/index.js.html +76 -0
- package/esdoc/file/src/utils/ImageLoader.js.html +118 -0
- package/esdoc/file/src/utils/common.js.html +102 -0
- package/esdoc/file/src/utils/css3dHelper.js.html +131 -0
- package/esdoc/file/src/utils/disposeObject.js.html +114 -0
- package/esdoc/file/src/utils/helper.js.html +138 -0
- package/esdoc/file/src/utils/index.js.html +80 -0
- package/esdoc/function/index.html +2019 -0
- package/esdoc/identifiers.html +738 -0
- package/esdoc/image/badge.svg +17 -0
- package/esdoc/image/esdoc-logo-mini-black.png +0 -0
- package/esdoc/image/esdoc-logo-mini.png +0 -0
- package/esdoc/image/manual-badge.svg +17 -0
- package/esdoc/image/search.png +0 -0
- package/esdoc/index.html +153 -0
- package/esdoc/index.json +2051 -0
- package/esdoc/inject/css/0-cus-style.css +1 -0
- package/esdoc/lint.json +1 -0
- package/esdoc/script/inherited-summary.js +28 -0
- package/esdoc/script/inner-link.js +32 -0
- package/esdoc/script/manual.js +12 -0
- package/esdoc/script/patch-for-local.js +8 -0
- package/esdoc/script/prettify/Apache-License-2.0.txt +202 -0
- package/esdoc/script/prettify/prettify.js +46 -0
- package/esdoc/script/pretty-print.js +25 -0
- package/esdoc/script/search.js +117 -0
- package/esdoc/script/search_index.js +572 -0
- package/esdoc/script/test-summary.js +54 -0
- package/esdoc/source.html +213 -0
- package/esdoc/variable/index.html +225 -0
- package/package.json +13 -3
- package/readme.md +93 -0
- package/dist/common-nMt4tIRA.cjs +0 -15
- package/dist/disposeObject-BuI3II7v.cjs +0 -1
- package/dist/disposeObject-CmFSSgi7.js +0 -616
- package/dist/useGLTFLoader-BAoIZjEX.js +0 -2645
- package/dist/useGLTFLoader-CGOxhEOO.cjs +0 -6
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<base data-ice="baseUrl" href="../../../">
|
|
6
|
+
<title data-ice="title">src/hooks/useThreeJs.js | @ridp/threejs</title>
|
|
7
|
+
<link type="text/css" rel="stylesheet" href="css/style.css">
|
|
8
|
+
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
|
9
|
+
<script src="script/prettify/prettify.js"></script>
|
|
10
|
+
<script src="script/manual.js"></script>
|
|
11
|
+
<link rel="stylesheet" href="./inject/css/0-cus-style.css"></head>
|
|
12
|
+
<body class="layout-container" data-ice="rootContainer">
|
|
13
|
+
|
|
14
|
+
<header>
|
|
15
|
+
<a href="./">Home</a>
|
|
16
|
+
|
|
17
|
+
<a href="identifiers.html">Reference</a>
|
|
18
|
+
<a href="source.html">Source</a>
|
|
19
|
+
|
|
20
|
+
<div class="search-box">
|
|
21
|
+
<span>
|
|
22
|
+
<img src="./image/search.png">
|
|
23
|
+
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
|
24
|
+
</span>
|
|
25
|
+
<ul class="search-result"></ul>
|
|
26
|
+
</div>
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
<nav class="navigation" data-ice="nav"><div>
|
|
30
|
+
<ul>
|
|
31
|
+
|
|
32
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#hooks">hooks</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useGLTFLoader">useGLTFLoader</a></span></span></li>
|
|
33
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useObb">useObb</a></span></span></li>
|
|
34
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useRaycaster">useRaycaster</a></span></span></li>
|
|
35
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useThreeJs">useThreeJs</a></span></span></li>
|
|
36
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-intersectColor">intersectColor</a></span></span></li>
|
|
37
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-obbObjects">obbObjects</a></span></span></li>
|
|
38
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#instance">instance</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/instance/IDBCache.js~IDBCache.html">IDBCache</a></span></span></li>
|
|
39
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils">utils</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ImageLoader">ImageLoader</a></span></span></li>
|
|
40
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initEnvImage">initEnvImage</a></span></span></li>
|
|
41
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCommonParent">getCommonParent</a></span></span></li>
|
|
42
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createInfoPlane">createInfoPlane</a></span></span></li>
|
|
43
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createTagPlane">createTagPlane</a></span></span></li>
|
|
44
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-disposeThreeObject">disposeThreeObject</a></span></span></li>
|
|
45
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createArrowHelper">createArrowHelper</a></span></span></li>
|
|
46
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createAxesHelper">createAxesHelper</a></span></span></li>
|
|
47
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createBox3Helper">createBox3Helper</a></span></span></li>
|
|
48
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createCameraHelper">createCameraHelper</a></span></span></li>
|
|
49
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createGridHelper">createGridHelper</a></span></span></li>
|
|
50
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createMapControls">createMapControls</a></span></span></li>
|
|
51
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createOrbitControl">createOrbitControl</a></span></span></li>
|
|
52
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createRaycaster">createRaycaster</a></span></span></li>
|
|
53
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createStats">createStats</a></span></span></li>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
</nav>
|
|
57
|
+
|
|
58
|
+
<div class="content" data-ice="content"><h1 data-ice="title">src/hooks/useThreeJs.js</h1>
|
|
59
|
+
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {
|
|
60
|
+
Scene,
|
|
61
|
+
Group,
|
|
62
|
+
PerspectiveCamera,
|
|
63
|
+
WebGLRenderer,
|
|
64
|
+
Color,
|
|
65
|
+
Box3,
|
|
66
|
+
Vector3,
|
|
67
|
+
MathUtils,
|
|
68
|
+
} from "three";
|
|
69
|
+
import { nextTick, onMounted, onUnmounted, ref, shallowRef } from "vue";
|
|
70
|
+
import Stats from "three/addons/libs/stats.module.js";
|
|
71
|
+
import { CSS3DRenderer } from "three/examples/jsm/renderers/CSS3DRenderer.js";
|
|
72
|
+
|
|
73
|
+
import { createOrbitControl, disposeThreeObject } from "../utils";
|
|
74
|
+
import { OrbitControls } from "three/examples/jsm/Addons.js";
|
|
75
|
+
import { Object3D } from "three";
|
|
76
|
+
|
|
77
|
+
// 默认控制器配置
|
|
78
|
+
const defaultControlOpt = {
|
|
79
|
+
enableDamping: true,
|
|
80
|
+
dampingFactor: 0.25,
|
|
81
|
+
screenSpacePanning: false,
|
|
82
|
+
minDistance: 0.1,
|
|
83
|
+
maxDistance: 1000,
|
|
84
|
+
maxPolarAngle: MathUtils.degToRad(60),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @param {String} selector ID '#xxxx'
|
|
90
|
+
* @param {Object} option {
|
|
91
|
+
* css3d: false,
|
|
92
|
+
stats: false,
|
|
93
|
+
control: {
|
|
94
|
+
init: true,
|
|
95
|
+
options: {
|
|
96
|
+
...OrbitControls属性
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
* }
|
|
100
|
+
* @returns any
|
|
101
|
+
*/
|
|
102
|
+
export function useThreeJs(selector, option) {
|
|
103
|
+
const _option = Object.assign(
|
|
104
|
+
{
|
|
105
|
+
css3d: false,
|
|
106
|
+
stats: false,
|
|
107
|
+
control: {
|
|
108
|
+
init: true,
|
|
109
|
+
options: {},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
option || {}
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
let el,
|
|
116
|
+
stats,
|
|
117
|
+
css3dRenderer,
|
|
118
|
+
animateCbs = [];
|
|
119
|
+
|
|
120
|
+
const isReady = ref(false);
|
|
121
|
+
|
|
122
|
+
const control = shallowRef();
|
|
123
|
+
const domWidth = ref(0);
|
|
124
|
+
const domHeight = ref(0);
|
|
125
|
+
|
|
126
|
+
const renderer = new WebGLRenderer({
|
|
127
|
+
antialias: true,
|
|
128
|
+
alpha: true,
|
|
129
|
+
precision: "mediump",
|
|
130
|
+
logarithmicDepthBuffer: true,
|
|
131
|
+
});
|
|
132
|
+
const scene = new Scene({});
|
|
133
|
+
const camera = new PerspectiveCamera(50, 1, 0.1, 2000);
|
|
134
|
+
const tanFOV = Math.tan(((Math.PI / 180) * camera.fov) / 2);
|
|
135
|
+
|
|
136
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
137
|
+
|
|
138
|
+
function init() {
|
|
139
|
+
isReady.value = false;
|
|
140
|
+
const size = getTargetSize();
|
|
141
|
+
domWidth.value = size[0];
|
|
142
|
+
domHeight.value = size[1];
|
|
143
|
+
|
|
144
|
+
camera.aspect = domWidth.value / domHeight.value;
|
|
145
|
+
camera.position.set(47, 39, 100);
|
|
146
|
+
camera.fov =
|
|
147
|
+
(360 / Math.PI) * Math.atan(tanFOV * (domHeight.value / domWidth.value));
|
|
148
|
+
camera.lookAt(0, 0, 0);
|
|
149
|
+
camera.updateProjectionMatrix();
|
|
150
|
+
|
|
151
|
+
renderer.setSize(domWidth.value, domHeight.value);
|
|
152
|
+
el.appendChild(renderer.domElement);
|
|
153
|
+
|
|
154
|
+
_option.stats && initStats();
|
|
155
|
+
// css3d
|
|
156
|
+
_option.css3d && createCss3dRenderer();
|
|
157
|
+
|
|
158
|
+
// 控制器
|
|
159
|
+
let control;
|
|
160
|
+
if (_option.control && _option.control.init) {
|
|
161
|
+
control = createOrbitControl(camera, renderer.domElement);
|
|
162
|
+
const controlOpt = Object.assign(
|
|
163
|
+
defaultControlOpt,
|
|
164
|
+
_option.control.options || {}
|
|
165
|
+
);
|
|
166
|
+
Object.keys(controlOpt).forEach((key) => {
|
|
167
|
+
control[key] = controlOpt[key];
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
nextTick(() => (isReady.value = true));
|
|
172
|
+
return control;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function onContextLost(event) {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
cancelAnimationFrame(animate);
|
|
178
|
+
}
|
|
179
|
+
function onContextRestored(event) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
init();
|
|
182
|
+
animate();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 循环帧中添加执行函数
|
|
187
|
+
* @param {*} animate
|
|
188
|
+
*/
|
|
189
|
+
function addAnimate(animate) {
|
|
190
|
+
animateCbs.push(animate);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function animate(cbs) {
|
|
194
|
+
animateCbs &&
|
|
195
|
+
animateCbs.length &&
|
|
196
|
+
animateCbs.forEach((fun) => {
|
|
197
|
+
typeof fun === "function" && fun();
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
control.value && control.value.update();
|
|
201
|
+
renderer.render(scene, camera);
|
|
202
|
+
stats && stats.update();
|
|
203
|
+
css3dRenderer && css3dRenderer.render(scene, camera);
|
|
204
|
+
|
|
205
|
+
requestAnimationFrame(animate);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function onResize() {
|
|
209
|
+
nextTick(() => {
|
|
210
|
+
const size = getTargetSize();
|
|
211
|
+
domWidth.value = size[0];
|
|
212
|
+
domHeight.value = size[1];
|
|
213
|
+
camera.aspect = domWidth.value / domHeight.value;
|
|
214
|
+
// adjust the FOV
|
|
215
|
+
camera.fov =
|
|
216
|
+
(360 / Math.PI) *
|
|
217
|
+
Math.atan(tanFOV * (domHeight.value / domWidth.value));
|
|
218
|
+
camera.updateProjectionMatrix();
|
|
219
|
+
camera.lookAt(scene.position);
|
|
220
|
+
|
|
221
|
+
renderer.render(scene, camera);
|
|
222
|
+
renderer.setSize(domWidth.value, domHeight.value);
|
|
223
|
+
|
|
224
|
+
css3dRenderer && css3dRenderer.setSize(domWidth.value, domHeight.value);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function getTargetSize() {
|
|
229
|
+
el = document.querySelector(selector);
|
|
230
|
+
return [el.clientWidth, el.clientHeight];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function initStats() {
|
|
234
|
+
stats = new Stats();
|
|
235
|
+
stats.dom.style.cssText =
|
|
236
|
+
"position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000";
|
|
237
|
+
el.appendChild(stats.dom);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**物体视窗自动适应
|
|
241
|
+
*
|
|
242
|
+
* @param {Object3D} model
|
|
243
|
+
* @param {Number} scale
|
|
244
|
+
* @param {Camera} camera
|
|
245
|
+
* @param {OrbitControls} controls
|
|
246
|
+
* @param {Vector3} offset
|
|
247
|
+
*/
|
|
248
|
+
function frameArea(model, scale, camera, controls, offset) {
|
|
249
|
+
const box = new Box3().setFromObject(model);
|
|
250
|
+
const boxSize = box.getSize(new Vector3()).length();
|
|
251
|
+
const boxCenter = box.getCenter(new Vector3());
|
|
252
|
+
|
|
253
|
+
if (offset) boxCenter.add(offset);
|
|
254
|
+
|
|
255
|
+
const sizeToFitOnScreen = boxSize * scale;
|
|
256
|
+
const halfSizeToFitOnScreen = sizeToFitOnScreen * 0.5;
|
|
257
|
+
const halfFovY = MathUtils.degToRad(camera.fov * 0.5);
|
|
258
|
+
const distance = halfSizeToFitOnScreen / Math.tan(halfFovY);
|
|
259
|
+
const direction = new Vector3()
|
|
260
|
+
.subVectors(camera.position, boxCenter)
|
|
261
|
+
.multiply(new Vector3(1, 1, 1))
|
|
262
|
+
.normalize();
|
|
263
|
+
|
|
264
|
+
const neP = direction.multiplyScalar(distance).add(boxCenter);
|
|
265
|
+
const targetOption = {
|
|
266
|
+
x: neP.x,
|
|
267
|
+
y: neP.y,
|
|
268
|
+
z: neP.z,
|
|
269
|
+
lookAt_x: boxCenter.x,
|
|
270
|
+
lookAt_y: boxCenter.y,
|
|
271
|
+
lookAt_z: boxCenter.z,
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
camera.position.set(targetOption.x, targetOption.y, targetOption.z);
|
|
275
|
+
camera.lookAt(
|
|
276
|
+
targetOption.lookAt_x,
|
|
277
|
+
targetOption.lookAt_y,
|
|
278
|
+
targetOption.lookAt_z
|
|
279
|
+
);
|
|
280
|
+
camera.updateProjectionMatrix();
|
|
281
|
+
controls.target.copy(boxCenter);
|
|
282
|
+
controls.update();
|
|
283
|
+
return boxSize;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function createCss3dRenderer() {
|
|
287
|
+
css3dRenderer = new CSS3DRenderer();
|
|
288
|
+
css3dRenderer.setSize(domWidth.value, domHeight.value);
|
|
289
|
+
css3dRenderer.domElement.style.position = "absolute";
|
|
290
|
+
css3dRenderer.domElement.style.top = 0;
|
|
291
|
+
css3dRenderer.domElement.style.left = 0;
|
|
292
|
+
css3dRenderer.domElement.style.pointerEvents = "none";
|
|
293
|
+
el.appendChild(css3dRenderer.domElement);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function dispose() {
|
|
297
|
+
disposeThreeObject(scene);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
onMounted(() => {
|
|
301
|
+
control.value = init();
|
|
302
|
+
|
|
303
|
+
renderer.domElement.addEventListener("resize", onResize, false);
|
|
304
|
+
renderer.domElement.addEventListener(
|
|
305
|
+
"webglcontextlost",
|
|
306
|
+
onContextLost,
|
|
307
|
+
false
|
|
308
|
+
);
|
|
309
|
+
renderer.domElement.addEventListener(
|
|
310
|
+
"webglcontextrestored",
|
|
311
|
+
onContextRestored,
|
|
312
|
+
false
|
|
313
|
+
);
|
|
314
|
+
requestAnimationFrame(animate);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
onUnmounted(() => {
|
|
318
|
+
cancelAnimationFrame(animate);
|
|
319
|
+
renderer.domElement.removeEventListener("resize", onResize, false);
|
|
320
|
+
renderer.domElement.removeEventListener(
|
|
321
|
+
"webglcontextlost",
|
|
322
|
+
onContextLost,
|
|
323
|
+
false
|
|
324
|
+
);
|
|
325
|
+
renderer.domElement.removeEventListener(
|
|
326
|
+
"webglcontextrestored",
|
|
327
|
+
onContextRestored,
|
|
328
|
+
false
|
|
329
|
+
);
|
|
330
|
+
dispose();
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
return {
|
|
334
|
+
addAnimate,
|
|
335
|
+
frameArea,
|
|
336
|
+
|
|
337
|
+
scene,
|
|
338
|
+
camera,
|
|
339
|
+
control,
|
|
340
|
+
renderer,
|
|
341
|
+
domWidth,
|
|
342
|
+
domHeight,
|
|
343
|
+
isReady,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
</code></pre>
|
|
347
|
+
|
|
348
|
+
</div>
|
|
349
|
+
|
|
350
|
+
<footer class="footer">
|
|
351
|
+
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
|
352
|
+
</footer>
|
|
353
|
+
|
|
354
|
+
<script src="script/search_index.js"></script>
|
|
355
|
+
<script src="script/search.js"></script>
|
|
356
|
+
<script src="script/pretty-print.js"></script>
|
|
357
|
+
<script src="script/inherited-summary.js"></script>
|
|
358
|
+
<script src="script/test-summary.js"></script>
|
|
359
|
+
<script src="script/inner-link.js"></script>
|
|
360
|
+
<script src="script/patch-for-local.js"></script>
|
|
361
|
+
</body>
|
|
362
|
+
</html>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<base data-ice="baseUrl" href="../../">
|
|
6
|
+
<title data-ice="title">src/index.js | @ridp/threejs</title>
|
|
7
|
+
<link type="text/css" rel="stylesheet" href="css/style.css">
|
|
8
|
+
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
|
9
|
+
<script src="script/prettify/prettify.js"></script>
|
|
10
|
+
<script src="script/manual.js"></script>
|
|
11
|
+
<link rel="stylesheet" href="./inject/css/0-cus-style.css"></head>
|
|
12
|
+
<body class="layout-container" data-ice="rootContainer">
|
|
13
|
+
|
|
14
|
+
<header>
|
|
15
|
+
<a href="./">Home</a>
|
|
16
|
+
|
|
17
|
+
<a href="identifiers.html">Reference</a>
|
|
18
|
+
<a href="source.html">Source</a>
|
|
19
|
+
|
|
20
|
+
<div class="search-box">
|
|
21
|
+
<span>
|
|
22
|
+
<img src="./image/search.png">
|
|
23
|
+
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
|
24
|
+
</span>
|
|
25
|
+
<ul class="search-result"></ul>
|
|
26
|
+
</div>
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
<nav class="navigation" data-ice="nav"><div>
|
|
30
|
+
<ul>
|
|
31
|
+
|
|
32
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#hooks">hooks</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useGLTFLoader">useGLTFLoader</a></span></span></li>
|
|
33
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useObb">useObb</a></span></span></li>
|
|
34
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useRaycaster">useRaycaster</a></span></span></li>
|
|
35
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-useThreeJs">useThreeJs</a></span></span></li>
|
|
36
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-intersectColor">intersectColor</a></span></span></li>
|
|
37
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-obbObjects">obbObjects</a></span></span></li>
|
|
38
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#instance">instance</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/instance/IDBCache.js~IDBCache.html">IDBCache</a></span></span></li>
|
|
39
|
+
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#utils">utils</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ImageLoader">ImageLoader</a></span></span></li>
|
|
40
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initEnvImage">initEnvImage</a></span></span></li>
|
|
41
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCommonParent">getCommonParent</a></span></span></li>
|
|
42
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createInfoPlane">createInfoPlane</a></span></span></li>
|
|
43
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createTagPlane">createTagPlane</a></span></span></li>
|
|
44
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-disposeThreeObject">disposeThreeObject</a></span></span></li>
|
|
45
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createArrowHelper">createArrowHelper</a></span></span></li>
|
|
46
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createAxesHelper">createAxesHelper</a></span></span></li>
|
|
47
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createBox3Helper">createBox3Helper</a></span></span></li>
|
|
48
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createCameraHelper">createCameraHelper</a></span></span></li>
|
|
49
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createGridHelper">createGridHelper</a></span></span></li>
|
|
50
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createMapControls">createMapControls</a></span></span></li>
|
|
51
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createOrbitControl">createOrbitControl</a></span></span></li>
|
|
52
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createRaycaster">createRaycaster</a></span></span></li>
|
|
53
|
+
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createStats">createStats</a></span></span></li>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
</nav>
|
|
57
|
+
|
|
58
|
+
<div class="content" data-ice="content"><h1 data-ice="title">src/index.js</h1>
|
|
59
|
+
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">export * from "./hooks";
|
|
60
|
+
export * from "./utils";
|
|
61
|
+
export * from "./instance";
|
|
62
|
+
</code></pre>
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<footer class="footer">
|
|
67
|
+
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
|
68
|
+
</footer>
|
|
69
|
+
|
|
70
|
+
<script src="script/search_index.js"></script>
|
|
71
|
+
<script src="script/search.js"></script>
|
|
72
|
+
<script src="script/pretty-print.js"></script>
|
|
73
|
+
<script src="script/inherited-summary.js"></script>
|
|
74
|
+
<script src="script/test-summary.js"></script>
|
|
75
|
+
<script src="script/inner-link.js"></script>
|
|
76
|
+
<script src="script/patch-for-local.js"></script>
|
|
77
|
+
</body>
|
|
78
|
+
</html>
|