vim-web 0.3.44-dev.40 → 0.3.44-dev.42
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/vim-web.js
CHANGED
|
@@ -27952,8 +27952,8 @@ function subclip(sourceClip, name, startFrame, endFrame, fps = 30) {
|
|
|
27952
27952
|
const times = [];
|
|
27953
27953
|
const values = [];
|
|
27954
27954
|
for (let j = 0; j < track.times.length; ++j) {
|
|
27955
|
-
const
|
|
27956
|
-
if (
|
|
27955
|
+
const frame2 = track.times[j] * fps;
|
|
27956
|
+
if (frame2 < startFrame || frame2 >= endFrame) continue;
|
|
27957
27957
|
times.push(track.times[j]);
|
|
27958
27958
|
for (let k = 0; k < valueSize; ++k) {
|
|
27959
27959
|
values.push(track.values[j * valueSize + k]);
|
|
@@ -34511,8 +34511,8 @@ function WebGLAnimation() {
|
|
|
34511
34511
|
let isAnimating = false;
|
|
34512
34512
|
let animationLoop = null;
|
|
34513
34513
|
let requestId = null;
|
|
34514
|
-
function onAnimationFrame(time,
|
|
34515
|
-
animationLoop(time,
|
|
34514
|
+
function onAnimationFrame(time, frame2) {
|
|
34515
|
+
animationLoop(time, frame2);
|
|
34516
34516
|
requestId = context.requestAnimationFrame(onAnimationFrame);
|
|
34517
34517
|
}
|
|
34518
34518
|
return {
|
|
@@ -37170,30 +37170,30 @@ function WebGLMorphtargets(gl, capabilities, textures) {
|
|
|
37170
37170
|
function WebGLObjects(gl, geometries, attributes, info) {
|
|
37171
37171
|
let updateMap = /* @__PURE__ */ new WeakMap();
|
|
37172
37172
|
function update(object) {
|
|
37173
|
-
const
|
|
37173
|
+
const frame2 = info.render.frame;
|
|
37174
37174
|
const geometry = object.geometry;
|
|
37175
37175
|
const buffergeometry = geometries.get(object, geometry);
|
|
37176
|
-
if (updateMap.get(buffergeometry) !==
|
|
37176
|
+
if (updateMap.get(buffergeometry) !== frame2) {
|
|
37177
37177
|
geometries.update(buffergeometry);
|
|
37178
|
-
updateMap.set(buffergeometry,
|
|
37178
|
+
updateMap.set(buffergeometry, frame2);
|
|
37179
37179
|
}
|
|
37180
37180
|
if (object.isInstancedMesh) {
|
|
37181
37181
|
if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) {
|
|
37182
37182
|
object.addEventListener("dispose", onInstancedMeshDispose);
|
|
37183
37183
|
}
|
|
37184
|
-
if (updateMap.get(object) !==
|
|
37184
|
+
if (updateMap.get(object) !== frame2) {
|
|
37185
37185
|
attributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);
|
|
37186
37186
|
if (object.instanceColor !== null) {
|
|
37187
37187
|
attributes.update(object.instanceColor, gl.ARRAY_BUFFER);
|
|
37188
37188
|
}
|
|
37189
|
-
updateMap.set(object,
|
|
37189
|
+
updateMap.set(object, frame2);
|
|
37190
37190
|
}
|
|
37191
37191
|
}
|
|
37192
37192
|
if (object.isSkinnedMesh) {
|
|
37193
37193
|
const skeleton = object.skeleton;
|
|
37194
|
-
if (updateMap.get(skeleton) !==
|
|
37194
|
+
if (updateMap.get(skeleton) !== frame2) {
|
|
37195
37195
|
skeleton.update();
|
|
37196
|
-
updateMap.set(skeleton,
|
|
37196
|
+
updateMap.set(skeleton, frame2);
|
|
37197
37197
|
}
|
|
37198
37198
|
}
|
|
37199
37199
|
return buffergeometry;
|
|
@@ -41697,9 +41697,9 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
|
|
|
41697
41697
|
return renderTarget.samples > 0 && extensions.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false;
|
|
41698
41698
|
}
|
|
41699
41699
|
function updateVideoTexture(texture) {
|
|
41700
|
-
const
|
|
41701
|
-
if (_videoTextures.get(texture) !==
|
|
41702
|
-
_videoTextures.set(texture,
|
|
41700
|
+
const frame2 = info.render.frame;
|
|
41701
|
+
if (_videoTextures.get(texture) !== frame2) {
|
|
41702
|
+
_videoTextures.set(texture, frame2);
|
|
41703
41703
|
texture.update();
|
|
41704
41704
|
}
|
|
41705
41705
|
}
|
|
@@ -41941,18 +41941,18 @@ class WebXRController {
|
|
|
41941
41941
|
}
|
|
41942
41942
|
return this;
|
|
41943
41943
|
}
|
|
41944
|
-
update(inputSource,
|
|
41944
|
+
update(inputSource, frame2, referenceSpace) {
|
|
41945
41945
|
let inputPose = null;
|
|
41946
41946
|
let gripPose = null;
|
|
41947
41947
|
let handPose = null;
|
|
41948
41948
|
const targetRay = this._targetRay;
|
|
41949
41949
|
const grip = this._grip;
|
|
41950
41950
|
const hand = this._hand;
|
|
41951
|
-
if (inputSource &&
|
|
41951
|
+
if (inputSource && frame2.session.visibilityState !== "visible-blurred") {
|
|
41952
41952
|
if (hand && inputSource.hand) {
|
|
41953
41953
|
handPose = true;
|
|
41954
41954
|
for (const inputjoint of inputSource.hand.values()) {
|
|
41955
|
-
const jointPose =
|
|
41955
|
+
const jointPose = frame2.getJointPose(inputjoint, referenceSpace);
|
|
41956
41956
|
const joint = this._getHandJoint(hand, inputjoint);
|
|
41957
41957
|
if (jointPose !== null) {
|
|
41958
41958
|
joint.matrix.fromArray(jointPose.transform.matrix);
|
|
@@ -41984,7 +41984,7 @@ class WebXRController {
|
|
|
41984
41984
|
}
|
|
41985
41985
|
} else {
|
|
41986
41986
|
if (grip !== null && inputSource.gripSpace) {
|
|
41987
|
-
gripPose =
|
|
41987
|
+
gripPose = frame2.getPose(inputSource.gripSpace, referenceSpace);
|
|
41988
41988
|
if (gripPose !== null) {
|
|
41989
41989
|
grip.matrix.fromArray(gripPose.transform.matrix);
|
|
41990
41990
|
grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
|
|
@@ -42005,7 +42005,7 @@ class WebXRController {
|
|
|
42005
42005
|
}
|
|
42006
42006
|
}
|
|
42007
42007
|
if (targetRay !== null) {
|
|
42008
|
-
inputPose =
|
|
42008
|
+
inputPose = frame2.getPose(inputSource.targetRaySpace, referenceSpace);
|
|
42009
42009
|
if (inputPose === null && gripPose !== null) {
|
|
42010
42010
|
inputPose = gripPose;
|
|
42011
42011
|
}
|
|
@@ -42495,9 +42495,9 @@ class WebXRManager extends EventDispatcher {
|
|
|
42495
42495
|
return depthSensing.getMesh(cameraXR);
|
|
42496
42496
|
};
|
|
42497
42497
|
let onAnimationFrameCallback = null;
|
|
42498
|
-
function onAnimationFrame(time,
|
|
42499
|
-
pose =
|
|
42500
|
-
xrFrame =
|
|
42498
|
+
function onAnimationFrame(time, frame2) {
|
|
42499
|
+
pose = frame2.getViewerPose(customReferenceSpace || referenceSpace);
|
|
42500
|
+
xrFrame = frame2;
|
|
42501
42501
|
if (pose !== null) {
|
|
42502
42502
|
const views = pose.views;
|
|
42503
42503
|
if (glBaseLayer !== null) {
|
|
@@ -42558,12 +42558,12 @@ class WebXRManager extends EventDispatcher {
|
|
|
42558
42558
|
const inputSource = controllerInputSources[i];
|
|
42559
42559
|
const controller = controllers[i];
|
|
42560
42560
|
if (inputSource !== null && controller !== void 0) {
|
|
42561
|
-
controller.update(inputSource,
|
|
42561
|
+
controller.update(inputSource, frame2, customReferenceSpace || referenceSpace);
|
|
42562
42562
|
}
|
|
42563
42563
|
}
|
|
42564
|
-
if (onAnimationFrameCallback) onAnimationFrameCallback(time,
|
|
42565
|
-
if (
|
|
42566
|
-
scope.dispatchEvent({ type: "planesdetected", data:
|
|
42564
|
+
if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame2);
|
|
42565
|
+
if (frame2.detectedPlanes) {
|
|
42566
|
+
scope.dispatchEvent({ type: "planesdetected", data: frame2 });
|
|
42567
42567
|
}
|
|
42568
42568
|
xrFrame = null;
|
|
42569
42569
|
}
|
|
@@ -42906,10 +42906,10 @@ function WebGLUniformsGroups(gl, info, capabilities, state) {
|
|
|
42906
42906
|
}
|
|
42907
42907
|
const webglProgram = program.program;
|
|
42908
42908
|
state.updateUBOMapping(uniformsGroup, webglProgram);
|
|
42909
|
-
const
|
|
42910
|
-
if (updateList[uniformsGroup.id] !==
|
|
42909
|
+
const frame2 = info.render.frame;
|
|
42910
|
+
if (updateList[uniformsGroup.id] !== frame2) {
|
|
42911
42911
|
updateBufferData(uniformsGroup);
|
|
42912
|
-
updateList[uniformsGroup.id] =
|
|
42912
|
+
updateList[uniformsGroup.id] = frame2;
|
|
42913
42913
|
}
|
|
42914
42914
|
}
|
|
42915
42915
|
function createBuffer(uniformsGroup) {
|
|
@@ -56558,7 +56558,7 @@ class MouseHandler extends InputHandler {
|
|
|
56558
56558
|
this._capture = new CaptureStateMachine(canvas);
|
|
56559
56559
|
this._dragHandler = new DragHandler(canvas, (delta, button) => this.onDrag(delta, button));
|
|
56560
56560
|
}
|
|
56561
|
-
|
|
56561
|
+
addListeners() {
|
|
56562
56562
|
this.reg(this._canvas, "pointerdown", (e) => {
|
|
56563
56563
|
this.onPointerDown(e);
|
|
56564
56564
|
});
|
|
@@ -58290,10 +58290,10 @@ class WebGLRenderer2 {
|
|
|
58290
58290
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
58291
58291
|
this.clear();
|
|
58292
58292
|
}
|
|
58293
|
-
draw(
|
|
58293
|
+
draw(frame2) {
|
|
58294
58294
|
if (this.canvas !== null) {
|
|
58295
|
-
this.canvas.width =
|
|
58296
|
-
this.canvas.height =
|
|
58295
|
+
this.canvas.width = frame2.displayWidth;
|
|
58296
|
+
this.canvas.height = frame2.displayHeight;
|
|
58297
58297
|
}
|
|
58298
58298
|
const gl = this.ctx;
|
|
58299
58299
|
if (gl !== null) {
|
|
@@ -58303,7 +58303,7 @@ class WebGLRenderer2 {
|
|
|
58303
58303
|
gl.RGBA,
|
|
58304
58304
|
gl.RGBA,
|
|
58305
58305
|
gl.UNSIGNED_BYTE,
|
|
58306
|
-
|
|
58306
|
+
frame2
|
|
58307
58307
|
);
|
|
58308
58308
|
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
|
58309
58309
|
this.clear();
|
|
@@ -58425,11 +58425,11 @@ class Decoder {
|
|
|
58425
58425
|
* to maintain decoder stability.
|
|
58426
58426
|
* @param frame - The video frame message to be queued for decoding
|
|
58427
58427
|
*/
|
|
58428
|
-
enqueue(
|
|
58429
|
-
if (
|
|
58428
|
+
enqueue(frame2) {
|
|
58429
|
+
if (frame2.header.frameType === 0 && this._queue.length > 0) {
|
|
58430
58430
|
this._queue.length = this._firstDecoded ? 0 : 1;
|
|
58431
58431
|
}
|
|
58432
|
-
this._queue.push(
|
|
58432
|
+
this._queue.push(frame2);
|
|
58433
58433
|
}
|
|
58434
58434
|
/**
|
|
58435
58435
|
* Processes and decodes all queued video frame messages.
|
|
@@ -58520,11 +58520,11 @@ class Decoder {
|
|
|
58520
58520
|
* @param frame - The decoded video frame ready for rendering
|
|
58521
58521
|
* @private
|
|
58522
58522
|
*/
|
|
58523
|
-
renderFrame(
|
|
58523
|
+
renderFrame(frame2) {
|
|
58524
58524
|
if (this._pendingFrame !== void 0) {
|
|
58525
58525
|
this._pendingFrame.close();
|
|
58526
58526
|
}
|
|
58527
|
-
this._pendingFrame =
|
|
58527
|
+
this._pendingFrame = frame2;
|
|
58528
58528
|
}
|
|
58529
58529
|
}
|
|
58530
58530
|
class MaterialHandles {
|
|
@@ -61015,7 +61015,7 @@ class VimCollection {
|
|
|
61015
61015
|
const defaultRenderSettings = {
|
|
61016
61016
|
...defaultSceneSettings,
|
|
61017
61017
|
lockIblRotation: true,
|
|
61018
|
-
ghostColor: new RGBA(
|
|
61018
|
+
ghostColor: new RGBA(1, 1, 1, 1 / 255)
|
|
61019
61019
|
};
|
|
61020
61020
|
class Renderer2 {
|
|
61021
61021
|
/**
|
|
@@ -62010,9 +62010,9 @@ function requireReactJsxRuntime_development() {
|
|
|
62010
62010
|
return "";
|
|
62011
62011
|
}
|
|
62012
62012
|
{
|
|
62013
|
-
var
|
|
62014
|
-
if (
|
|
62015
|
-
return
|
|
62013
|
+
var frame2 = componentFrameCache.get(fn);
|
|
62014
|
+
if (frame2 !== void 0) {
|
|
62015
|
+
return frame2;
|
|
62016
62016
|
}
|
|
62017
62017
|
}
|
|
62018
62018
|
var control;
|
|
@@ -75492,26 +75492,26 @@ function useCamera(adapter) {
|
|
|
75492
75492
|
});
|
|
75493
75493
|
}, []);
|
|
75494
75494
|
const reset = useActionRef(() => adapter.resetCamera(1));
|
|
75495
|
+
const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
|
|
75496
|
+
const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
|
|
75495
75497
|
const frameSelection2 = useAsyncFuncRef(async () => {
|
|
75496
|
-
|
|
75497
|
-
|
|
75498
|
-
return;
|
|
75499
|
-
}
|
|
75500
|
-
frameBox(adapter, () => adapter.getSelectionBox());
|
|
75498
|
+
const box = await getSelectionBox.call() ?? await getSceneBox.call();
|
|
75499
|
+
frame(adapter, box);
|
|
75501
75500
|
});
|
|
75502
75501
|
const frameScene = useAsyncFuncRef(async () => {
|
|
75503
|
-
|
|
75502
|
+
const box = await getSceneBox.call();
|
|
75503
|
+
frame(adapter, box);
|
|
75504
75504
|
});
|
|
75505
75505
|
return {
|
|
75506
|
+
getSelectionBox,
|
|
75507
|
+
getSceneBox,
|
|
75506
75508
|
autoCamera: autoCamera2,
|
|
75507
75509
|
reset,
|
|
75508
75510
|
frameSelection: frameSelection2,
|
|
75509
75511
|
frameScene
|
|
75510
75512
|
};
|
|
75511
75513
|
}
|
|
75512
|
-
|
|
75513
|
-
const box = await getBox();
|
|
75514
|
-
if (!box) return;
|
|
75514
|
+
function frame(adapter, box) {
|
|
75515
75515
|
if (adapter.isSectionBoxEnabled()) {
|
|
75516
75516
|
const section = adapter.getSectionBox();
|
|
75517
75517
|
if (section) {
|
|
@@ -75528,7 +75528,6 @@ function useWebglCamera(viewer, section) {
|
|
|
75528
75528
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
75529
75529
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
75530
75530
|
resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
|
|
75531
|
-
hasSelection: () => viewer.selection.count > 0,
|
|
75532
75531
|
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
75533
75532
|
getSectionBox: () => viewer.renderer.section.box,
|
|
75534
75533
|
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
@@ -76036,8 +76035,8 @@ function useUltraSectionBox(viewer) {
|
|
|
76036
76035
|
function useUltraControlBar(viewer, section, camera2, customization) {
|
|
76037
76036
|
const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
|
|
76038
76037
|
const sectionCamera = controlBarCamera(camera2);
|
|
76039
|
-
const
|
|
76040
|
-
let bar = [sectionCamera,
|
|
76038
|
+
const frame2 = frameSection(camera2);
|
|
76039
|
+
let bar = [sectionCamera, frame2, sectionSectionBox];
|
|
76041
76040
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76042
76041
|
return bar;
|
|
76043
76042
|
}
|
|
@@ -76064,7 +76063,6 @@ function useUltraCamera(viewer, section) {
|
|
|
76064
76063
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76065
76064
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
76066
76065
|
resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
|
|
76067
|
-
hasSelection: () => viewer.selection.count > 0,
|
|
76068
76066
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76069
76067
|
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76070
76068
|
getSectionBox: () => viewer.sectionBox.getBox(),
|