three-render-objects 1.41.1 → 1.42.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.
|
@@ -308,12 +308,17 @@ var threeRenderObjects = Kapsule({
|
|
|
308
308
|
|
|
309
309
|
// Setter
|
|
310
310
|
if (position && state.initialised) {
|
|
311
|
+
var _state$povPosTween, _state$povTgtTween;
|
|
311
312
|
var finalPos = position;
|
|
312
313
|
var finalLookAt = lookAt || {
|
|
313
314
|
x: 0,
|
|
314
315
|
y: 0,
|
|
315
316
|
z: 0
|
|
316
317
|
};
|
|
318
|
+
|
|
319
|
+
// cancel any ongoing pov animation
|
|
320
|
+
(_state$povPosTween = state.povPosTween) === null || _state$povPosTween === void 0 || _state$povPosTween.end();
|
|
321
|
+
(_state$povTgtTween = state.povTgtTween) === null || _state$povTgtTween === void 0 || _state$povTgtTween.end();
|
|
317
322
|
if (!transitionDuration) {
|
|
318
323
|
// no animation
|
|
319
324
|
setCameraPos(finalPos);
|
|
@@ -321,12 +326,14 @@ var threeRenderObjects = Kapsule({
|
|
|
321
326
|
} else {
|
|
322
327
|
var camPos = Object.assign({}, camera.position);
|
|
323
328
|
var camLookAt = getLookAt();
|
|
324
|
-
state.tweenGroup.add(new Tween(camPos).to(finalPos, transitionDuration).easing(Easing.Quadratic.Out).onUpdate(setCameraPos).onComplete(function () {
|
|
329
|
+
state.tweenGroup.add(state.povPosTween = new Tween(camPos).to(finalPos, transitionDuration).easing(Easing.Quadratic.Out).onUpdate(setCameraPos).onComplete(function () {
|
|
330
|
+
state.povPosTween = undefined;
|
|
325
331
|
state.tweenGroup.remove(this);
|
|
326
332
|
}).start());
|
|
327
333
|
|
|
328
334
|
// Face direction in 1/3rd of time
|
|
329
|
-
state.tweenGroup.add(new Tween(camLookAt).to(finalLookAt, transitionDuration / 3).easing(Easing.Quadratic.Out).onUpdate(setLookAt).onComplete(function () {
|
|
335
|
+
state.tweenGroup.add(state.povTgtTween = new Tween(camLookAt).to(finalLookAt, transitionDuration / 3).easing(Easing.Quadratic.Out).onUpdate(setLookAt).onComplete(function () {
|
|
336
|
+
state.povTgtTween = undefined;
|
|
330
337
|
state.tweenGroup.remove(this);
|
|
331
338
|
}).start());
|
|
332
339
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "three-render-objects",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Easy way to render ThreeJS objects with built-in interaction defaults",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/core": "^7.29.0",
|
|
60
|
-
"@babel/preset-env": "^7.29.
|
|
60
|
+
"@babel/preset-env": "^7.29.5",
|
|
61
61
|
"@rollup/plugin-babel": "^7.0.0",
|
|
62
62
|
"@rollup/plugin-commonjs": "^29.0.2",
|
|
63
63
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
64
64
|
"@rollup/plugin-terser": "^1.0.0",
|
|
65
65
|
"@types/react": "^19.2.14",
|
|
66
|
-
"postcss": "^8.5.
|
|
66
|
+
"postcss": "^8.5.14",
|
|
67
67
|
"rimraf": "^6.1.3",
|
|
68
|
-
"rollup": "^4.60.
|
|
68
|
+
"rollup": "^4.60.4",
|
|
69
69
|
"rollup-plugin-dts": "^6.4.1",
|
|
70
70
|
"rollup-plugin-postcss": "^4.0.2",
|
|
71
|
-
"three": "^0.
|
|
72
|
-
"typescript": "^6.0.
|
|
71
|
+
"three": "^0.184.0",
|
|
72
|
+
"typescript": "^6.0.3"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=12"
|