three-render-objects 1.26.2 → 1.26.6
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/three-render-objects.common.js +16 -11
- package/dist/three-render-objects.d.ts +1 -2
- package/dist/three-render-objects.js +317 -206
- package/dist/three-render-objects.js.map +1 -1
- package/dist/three-render-objects.min.js +2 -2
- package/dist/three-render-objects.module.js +12 -7
- package/package.json +17 -17
|
@@ -85,7 +85,7 @@ function _iterableToArray(iter) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function _iterableToArrayLimit(arr, i) {
|
|
88
|
-
var _i = arr
|
|
88
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
89
89
|
|
|
90
90
|
if (_i == null) return;
|
|
91
91
|
var _arr = [];
|
|
@@ -160,7 +160,7 @@ var three = window.THREE ? window.THREE // Prefer consumption from global THREE,
|
|
|
160
160
|
Spherical: three$1.Spherical,
|
|
161
161
|
Clock: three$1.Clock
|
|
162
162
|
};
|
|
163
|
-
var threeRenderObjects = Kapsule__default[
|
|
163
|
+
var threeRenderObjects = Kapsule__default["default"]({
|
|
164
164
|
props: {
|
|
165
165
|
width: {
|
|
166
166
|
"default": window.innerWidth,
|
|
@@ -266,12 +266,12 @@ var threeRenderObjects = Kapsule__default['default']({
|
|
|
266
266
|
|
|
267
267
|
if (topObject !== state.hoverObj) {
|
|
268
268
|
state.onHover(topObject, state.hoverObj);
|
|
269
|
-
state.toolTipElem.innerHTML = topObject ? accessorFn__default[
|
|
269
|
+
state.toolTipElem.innerHTML = topObject ? accessorFn__default["default"](state.tooltipContent)(topObject) || '' : '';
|
|
270
270
|
state.hoverObj = topObject;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
TWEEN__default[
|
|
274
|
+
TWEEN__default["default"].update(); // update camera animation tweens
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
return this;
|
|
@@ -303,9 +303,9 @@ var threeRenderObjects = Kapsule__default['default']({
|
|
|
303
303
|
} else {
|
|
304
304
|
var camPos = Object.assign({}, camera.position);
|
|
305
305
|
var camLookAt = getLookAt();
|
|
306
|
-
new TWEEN__default[
|
|
306
|
+
new TWEEN__default["default"].Tween(camPos).to(finalPos, transitionDuration).easing(TWEEN__default["default"].Easing.Quadratic.Out).onUpdate(setCameraPos).start(); // Face direction in 1/3rd of time
|
|
307
307
|
|
|
308
|
-
new TWEEN__default[
|
|
308
|
+
new TWEEN__default["default"].Tween(camLookAt).to(finalLookAt, transitionDuration / 3).easing(TWEEN__default["default"].Easing.Quadratic.Out).onUpdate(setLookAt).start();
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
return this;
|
|
@@ -326,7 +326,14 @@ var threeRenderObjects = Kapsule__default['default']({
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
function setLookAt(lookAt) {
|
|
329
|
-
|
|
329
|
+
var lookAtVect = new three.Vector3(lookAt.x, lookAt.y, lookAt.z);
|
|
330
|
+
|
|
331
|
+
if (state.controls.target) {
|
|
332
|
+
state.controls.target = lookAtVect;
|
|
333
|
+
} else {
|
|
334
|
+
// Fly controls doesn't have target attribute
|
|
335
|
+
camera.lookAt(lookAtVect); // note: lookAt may be overridden by other controls in some cases
|
|
336
|
+
}
|
|
330
337
|
}
|
|
331
338
|
|
|
332
339
|
function getLookAt() {
|
|
@@ -579,8 +586,6 @@ var threeRenderObjects = Kapsule__default['default']({
|
|
|
579
586
|
state.controls.minDistance = 0.1;
|
|
580
587
|
state.controls.maxDistance = state.skyRadius;
|
|
581
588
|
state.controls.addEventListener('start', function () {
|
|
582
|
-
state.isPointerPressed = true; // trackball controls blocks pointerdown events, so we have to track it (also) here
|
|
583
|
-
|
|
584
589
|
state.controlsEngaged = true;
|
|
585
590
|
});
|
|
586
591
|
state.controls.addEventListener('change', function () {
|
|
@@ -609,8 +614,8 @@ var threeRenderObjects = Kapsule__default['default']({
|
|
|
609
614
|
update: function update(state, changedProps) {
|
|
610
615
|
// resize canvas
|
|
611
616
|
if (state.width && state.height && (changedProps.hasOwnProperty('width') || changedProps.hasOwnProperty('height'))) {
|
|
612
|
-
state.container.style.width = state.width;
|
|
613
|
-
state.container.style.height = state.height;
|
|
617
|
+
state.container.style.width = "".concat(state.width, "px");
|
|
618
|
+
state.container.style.height = "".concat(state.height, "px");
|
|
614
619
|
[state.renderer, state.postProcessingComposer].concat(_toConsumableArray(state.extraRenderers)).forEach(function (r) {
|
|
615
620
|
return r.setSize(state.width, state.height);
|
|
616
621
|
});
|
|
@@ -81,5 +81,4 @@ type ThreeRenderObjectsInstance = ThreeRenderObjectsGenericInstance<ThreeRenderO
|
|
|
81
81
|
|
|
82
82
|
declare function ThreeRenderObjects(configOptions?: ConfigOptions): ThreeRenderObjectsInstance;
|
|
83
83
|
|
|
84
|
-
export default
|
|
85
|
-
export { ConfigOptions, ThreeRenderObjectsGenericInstance, ThreeRenderObjectsInstance };
|
|
84
|
+
export { ConfigOptions, ThreeRenderObjectsGenericInstance, ThreeRenderObjectsInstance, ThreeRenderObjects as default };
|