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.
|
@@ -13,7 +13,7 @@ export declare class MouseHandler extends InputHandler {
|
|
|
13
13
|
onDoubleClick: (position: Vector2) => void;
|
|
14
14
|
onWheel: (value: number, ctrl: boolean) => void;
|
|
15
15
|
constructor(canvas: HTMLCanvasElement);
|
|
16
|
-
|
|
16
|
+
protected addListeners(): void;
|
|
17
17
|
dispose(): void;
|
|
18
18
|
private onPointerDown;
|
|
19
19
|
private onPointerUp;
|
|
@@ -7,6 +7,8 @@ import { ISignal } from 'ste-signals';
|
|
|
7
7
|
export interface CameraRef {
|
|
8
8
|
autoCamera: StateRef<boolean>;
|
|
9
9
|
reset: ActionRef;
|
|
10
|
+
getSelectionBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
11
|
+
getSceneBox: AsyncFuncRef<THREE.Box3 | undefined>;
|
|
10
12
|
frameSelection: AsyncFuncRef<void>;
|
|
11
13
|
frameScene: AsyncFuncRef<void>;
|
|
12
14
|
}
|
|
@@ -14,8 +16,7 @@ interface ICameraAdapter {
|
|
|
14
16
|
onSelectionChanged: ISignal;
|
|
15
17
|
frameCamera: (box: THREE.Box3, duration: number) => void;
|
|
16
18
|
resetCamera: (duration: number) => void;
|
|
17
|
-
|
|
18
|
-
getSelectionBox: () => Promise<THREE.Box3>;
|
|
19
|
+
getSelectionBox: () => Promise<THREE.Box3 | undefined>;
|
|
19
20
|
getSceneBox: () => Promise<THREE.Box3>;
|
|
20
21
|
getSectionBox: () => THREE.Box3;
|
|
21
22
|
isSectionBoxEnabled: () => boolean;
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -27968,8 +27968,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
27968
27968
|
const times = [];
|
|
27969
27969
|
const values = [];
|
|
27970
27970
|
for (let j = 0; j < track.times.length; ++j) {
|
|
27971
|
-
const
|
|
27972
|
-
if (
|
|
27971
|
+
const frame2 = track.times[j] * fps;
|
|
27972
|
+
if (frame2 < startFrame || frame2 >= endFrame) continue;
|
|
27973
27973
|
times.push(track.times[j]);
|
|
27974
27974
|
for (let k = 0; k < valueSize; ++k) {
|
|
27975
27975
|
values.push(track.values[j * valueSize + k]);
|
|
@@ -34527,8 +34527,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
34527
34527
|
let isAnimating = false;
|
|
34528
34528
|
let animationLoop = null;
|
|
34529
34529
|
let requestId = null;
|
|
34530
|
-
function onAnimationFrame(time,
|
|
34531
|
-
animationLoop(time,
|
|
34530
|
+
function onAnimationFrame(time, frame2) {
|
|
34531
|
+
animationLoop(time, frame2);
|
|
34532
34532
|
requestId = context.requestAnimationFrame(onAnimationFrame);
|
|
34533
34533
|
}
|
|
34534
34534
|
return {
|
|
@@ -37186,30 +37186,30 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
37186
37186
|
function WebGLObjects(gl, geometries, attributes, info) {
|
|
37187
37187
|
let updateMap = /* @__PURE__ */ new WeakMap();
|
|
37188
37188
|
function update(object) {
|
|
37189
|
-
const
|
|
37189
|
+
const frame2 = info.render.frame;
|
|
37190
37190
|
const geometry = object.geometry;
|
|
37191
37191
|
const buffergeometry = geometries.get(object, geometry);
|
|
37192
|
-
if (updateMap.get(buffergeometry) !==
|
|
37192
|
+
if (updateMap.get(buffergeometry) !== frame2) {
|
|
37193
37193
|
geometries.update(buffergeometry);
|
|
37194
|
-
updateMap.set(buffergeometry,
|
|
37194
|
+
updateMap.set(buffergeometry, frame2);
|
|
37195
37195
|
}
|
|
37196
37196
|
if (object.isInstancedMesh) {
|
|
37197
37197
|
if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) {
|
|
37198
37198
|
object.addEventListener("dispose", onInstancedMeshDispose);
|
|
37199
37199
|
}
|
|
37200
|
-
if (updateMap.get(object) !==
|
|
37200
|
+
if (updateMap.get(object) !== frame2) {
|
|
37201
37201
|
attributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);
|
|
37202
37202
|
if (object.instanceColor !== null) {
|
|
37203
37203
|
attributes.update(object.instanceColor, gl.ARRAY_BUFFER);
|
|
37204
37204
|
}
|
|
37205
|
-
updateMap.set(object,
|
|
37205
|
+
updateMap.set(object, frame2);
|
|
37206
37206
|
}
|
|
37207
37207
|
}
|
|
37208
37208
|
if (object.isSkinnedMesh) {
|
|
37209
37209
|
const skeleton = object.skeleton;
|
|
37210
|
-
if (updateMap.get(skeleton) !==
|
|
37210
|
+
if (updateMap.get(skeleton) !== frame2) {
|
|
37211
37211
|
skeleton.update();
|
|
37212
|
-
updateMap.set(skeleton,
|
|
37212
|
+
updateMap.set(skeleton, frame2);
|
|
37213
37213
|
}
|
|
37214
37214
|
}
|
|
37215
37215
|
return buffergeometry;
|
|
@@ -41713,9 +41713,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
41713
41713
|
return renderTarget.samples > 0 && extensions.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false;
|
|
41714
41714
|
}
|
|
41715
41715
|
function updateVideoTexture(texture) {
|
|
41716
|
-
const
|
|
41717
|
-
if (_videoTextures.get(texture) !==
|
|
41718
|
-
_videoTextures.set(texture,
|
|
41716
|
+
const frame2 = info.render.frame;
|
|
41717
|
+
if (_videoTextures.get(texture) !== frame2) {
|
|
41718
|
+
_videoTextures.set(texture, frame2);
|
|
41719
41719
|
texture.update();
|
|
41720
41720
|
}
|
|
41721
41721
|
}
|
|
@@ -41957,18 +41957,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
41957
41957
|
}
|
|
41958
41958
|
return this;
|
|
41959
41959
|
}
|
|
41960
|
-
update(inputSource,
|
|
41960
|
+
update(inputSource, frame2, referenceSpace) {
|
|
41961
41961
|
let inputPose = null;
|
|
41962
41962
|
let gripPose = null;
|
|
41963
41963
|
let handPose = null;
|
|
41964
41964
|
const targetRay = this._targetRay;
|
|
41965
41965
|
const grip = this._grip;
|
|
41966
41966
|
const hand = this._hand;
|
|
41967
|
-
if (inputSource &&
|
|
41967
|
+
if (inputSource && frame2.session.visibilityState !== "visible-blurred") {
|
|
41968
41968
|
if (hand && inputSource.hand) {
|
|
41969
41969
|
handPose = true;
|
|
41970
41970
|
for (const inputjoint of inputSource.hand.values()) {
|
|
41971
|
-
const jointPose =
|
|
41971
|
+
const jointPose = frame2.getJointPose(inputjoint, referenceSpace);
|
|
41972
41972
|
const joint = this._getHandJoint(hand, inputjoint);
|
|
41973
41973
|
if (jointPose !== null) {
|
|
41974
41974
|
joint.matrix.fromArray(jointPose.transform.matrix);
|
|
@@ -42000,7 +42000,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
42000
42000
|
}
|
|
42001
42001
|
} else {
|
|
42002
42002
|
if (grip !== null && inputSource.gripSpace) {
|
|
42003
|
-
gripPose =
|
|
42003
|
+
gripPose = frame2.getPose(inputSource.gripSpace, referenceSpace);
|
|
42004
42004
|
if (gripPose !== null) {
|
|
42005
42005
|
grip.matrix.fromArray(gripPose.transform.matrix);
|
|
42006
42006
|
grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
|
|
@@ -42021,7 +42021,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
42021
42021
|
}
|
|
42022
42022
|
}
|
|
42023
42023
|
if (targetRay !== null) {
|
|
42024
|
-
inputPose =
|
|
42024
|
+
inputPose = frame2.getPose(inputSource.targetRaySpace, referenceSpace);
|
|
42025
42025
|
if (inputPose === null && gripPose !== null) {
|
|
42026
42026
|
inputPose = gripPose;
|
|
42027
42027
|
}
|
|
@@ -42511,9 +42511,9 @@ void main() {
|
|
|
42511
42511
|
return depthSensing.getMesh(cameraXR);
|
|
42512
42512
|
};
|
|
42513
42513
|
let onAnimationFrameCallback = null;
|
|
42514
|
-
function onAnimationFrame(time,
|
|
42515
|
-
pose =
|
|
42516
|
-
xrFrame =
|
|
42514
|
+
function onAnimationFrame(time, frame2) {
|
|
42515
|
+
pose = frame2.getViewerPose(customReferenceSpace || referenceSpace);
|
|
42516
|
+
xrFrame = frame2;
|
|
42517
42517
|
if (pose !== null) {
|
|
42518
42518
|
const views = pose.views;
|
|
42519
42519
|
if (glBaseLayer !== null) {
|
|
@@ -42574,12 +42574,12 @@ void main() {
|
|
|
42574
42574
|
const inputSource = controllerInputSources[i2];
|
|
42575
42575
|
const controller = controllers[i2];
|
|
42576
42576
|
if (inputSource !== null && controller !== void 0) {
|
|
42577
|
-
controller.update(inputSource,
|
|
42577
|
+
controller.update(inputSource, frame2, customReferenceSpace || referenceSpace);
|
|
42578
42578
|
}
|
|
42579
42579
|
}
|
|
42580
|
-
if (onAnimationFrameCallback) onAnimationFrameCallback(time,
|
|
42581
|
-
if (
|
|
42582
|
-
scope.dispatchEvent({ type: "planesdetected", data:
|
|
42580
|
+
if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame2);
|
|
42581
|
+
if (frame2.detectedPlanes) {
|
|
42582
|
+
scope.dispatchEvent({ type: "planesdetected", data: frame2 });
|
|
42583
42583
|
}
|
|
42584
42584
|
xrFrame = null;
|
|
42585
42585
|
}
|
|
@@ -42922,10 +42922,10 @@ void main() {
|
|
|
42922
42922
|
}
|
|
42923
42923
|
const webglProgram = program.program;
|
|
42924
42924
|
state.updateUBOMapping(uniformsGroup, webglProgram);
|
|
42925
|
-
const
|
|
42926
|
-
if (updateList[uniformsGroup.id] !==
|
|
42925
|
+
const frame2 = info.render.frame;
|
|
42926
|
+
if (updateList[uniformsGroup.id] !== frame2) {
|
|
42927
42927
|
updateBufferData(uniformsGroup);
|
|
42928
|
-
updateList[uniformsGroup.id] =
|
|
42928
|
+
updateList[uniformsGroup.id] = frame2;
|
|
42929
42929
|
}
|
|
42930
42930
|
}
|
|
42931
42931
|
function createBuffer(uniformsGroup) {
|
|
@@ -56574,7 +56574,7 @@ void main() {
|
|
|
56574
56574
|
this._capture = new CaptureStateMachine(canvas);
|
|
56575
56575
|
this._dragHandler = new DragHandler(canvas, (delta, button) => this.onDrag(delta, button));
|
|
56576
56576
|
}
|
|
56577
|
-
|
|
56577
|
+
addListeners() {
|
|
56578
56578
|
this.reg(this._canvas, "pointerdown", (e) => {
|
|
56579
56579
|
this.onPointerDown(e);
|
|
56580
56580
|
});
|
|
@@ -58306,10 +58306,10 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
58306
58306
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
58307
58307
|
this.clear();
|
|
58308
58308
|
}
|
|
58309
|
-
draw(
|
|
58309
|
+
draw(frame2) {
|
|
58310
58310
|
if (this.canvas !== null) {
|
|
58311
|
-
this.canvas.width =
|
|
58312
|
-
this.canvas.height =
|
|
58311
|
+
this.canvas.width = frame2.displayWidth;
|
|
58312
|
+
this.canvas.height = frame2.displayHeight;
|
|
58313
58313
|
}
|
|
58314
58314
|
const gl = this.ctx;
|
|
58315
58315
|
if (gl !== null) {
|
|
@@ -58319,7 +58319,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
58319
58319
|
gl.RGBA,
|
|
58320
58320
|
gl.RGBA,
|
|
58321
58321
|
gl.UNSIGNED_BYTE,
|
|
58322
|
-
|
|
58322
|
+
frame2
|
|
58323
58323
|
);
|
|
58324
58324
|
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
|
58325
58325
|
this.clear();
|
|
@@ -58441,11 +58441,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
58441
58441
|
* to maintain decoder stability.
|
|
58442
58442
|
* @param frame - The video frame message to be queued for decoding
|
|
58443
58443
|
*/
|
|
58444
|
-
enqueue(
|
|
58445
|
-
if (
|
|
58444
|
+
enqueue(frame2) {
|
|
58445
|
+
if (frame2.header.frameType === 0 && this._queue.length > 0) {
|
|
58446
58446
|
this._queue.length = this._firstDecoded ? 0 : 1;
|
|
58447
58447
|
}
|
|
58448
|
-
this._queue.push(
|
|
58448
|
+
this._queue.push(frame2);
|
|
58449
58449
|
}
|
|
58450
58450
|
/**
|
|
58451
58451
|
* Processes and decodes all queued video frame messages.
|
|
@@ -58536,11 +58536,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
58536
58536
|
* @param frame - The decoded video frame ready for rendering
|
|
58537
58537
|
* @private
|
|
58538
58538
|
*/
|
|
58539
|
-
renderFrame(
|
|
58539
|
+
renderFrame(frame2) {
|
|
58540
58540
|
if (this._pendingFrame !== void 0) {
|
|
58541
58541
|
this._pendingFrame.close();
|
|
58542
58542
|
}
|
|
58543
|
-
this._pendingFrame =
|
|
58543
|
+
this._pendingFrame = frame2;
|
|
58544
58544
|
}
|
|
58545
58545
|
}
|
|
58546
58546
|
class MaterialHandles {
|
|
@@ -61031,7 +61031,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61031
61031
|
const defaultRenderSettings = {
|
|
61032
61032
|
...defaultSceneSettings,
|
|
61033
61033
|
lockIblRotation: true,
|
|
61034
|
-
ghostColor: new RGBA(
|
|
61034
|
+
ghostColor: new RGBA(1, 1, 1, 1 / 255)
|
|
61035
61035
|
};
|
|
61036
61036
|
class Renderer {
|
|
61037
61037
|
/**
|
|
@@ -62026,9 +62026,9 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
62026
62026
|
return "";
|
|
62027
62027
|
}
|
|
62028
62028
|
{
|
|
62029
|
-
var
|
|
62030
|
-
if (
|
|
62031
|
-
return
|
|
62029
|
+
var frame2 = componentFrameCache.get(fn);
|
|
62030
|
+
if (frame2 !== void 0) {
|
|
62031
|
+
return frame2;
|
|
62032
62032
|
}
|
|
62033
62033
|
}
|
|
62034
62034
|
var control;
|
|
@@ -75508,26 +75508,26 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75508
75508
|
});
|
|
75509
75509
|
}, []);
|
|
75510
75510
|
const reset = useActionRef(() => adapter.resetCamera(1));
|
|
75511
|
+
const getSelectionBox = useAsyncFuncRef(adapter.getSelectionBox);
|
|
75512
|
+
const getSceneBox = useAsyncFuncRef(adapter.getSceneBox);
|
|
75511
75513
|
const frameSelection2 = useAsyncFuncRef(async () => {
|
|
75512
|
-
|
|
75513
|
-
|
|
75514
|
-
return;
|
|
75515
|
-
}
|
|
75516
|
-
frameBox(adapter, () => adapter.getSelectionBox());
|
|
75514
|
+
const box = await getSelectionBox.call() ?? await getSceneBox.call();
|
|
75515
|
+
frame(adapter, box);
|
|
75517
75516
|
});
|
|
75518
75517
|
const frameScene = useAsyncFuncRef(async () => {
|
|
75519
|
-
|
|
75518
|
+
const box = await getSceneBox.call();
|
|
75519
|
+
frame(adapter, box);
|
|
75520
75520
|
});
|
|
75521
75521
|
return {
|
|
75522
|
+
getSelectionBox,
|
|
75523
|
+
getSceneBox,
|
|
75522
75524
|
autoCamera: autoCamera2,
|
|
75523
75525
|
reset,
|
|
75524
75526
|
frameSelection: frameSelection2,
|
|
75525
75527
|
frameScene
|
|
75526
75528
|
};
|
|
75527
75529
|
}
|
|
75528
|
-
|
|
75529
|
-
const box = await getBox();
|
|
75530
|
-
if (!box) return;
|
|
75530
|
+
function frame(adapter, box) {
|
|
75531
75531
|
if (adapter.isSectionBoxEnabled()) {
|
|
75532
75532
|
const section = adapter.getSectionBox();
|
|
75533
75533
|
if (section) {
|
|
@@ -75544,7 +75544,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75544
75544
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
75545
75545
|
frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
|
|
75546
75546
|
resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
|
|
75547
|
-
hasSelection: () => viewer.selection.count > 0,
|
|
75548
75547
|
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
75549
75548
|
getSectionBox: () => viewer.renderer.section.box,
|
|
75550
75549
|
getSceneBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
@@ -76052,8 +76051,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76052
76051
|
function useUltraControlBar(viewer, section, camera2, customization) {
|
|
76053
76052
|
const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
|
|
76054
76053
|
const sectionCamera = controlBarCamera(camera2);
|
|
76055
|
-
const
|
|
76056
|
-
let bar = [sectionCamera,
|
|
76054
|
+
const frame2 = frameSection(camera2);
|
|
76055
|
+
let bar = [sectionCamera, frame2, sectionSectionBox];
|
|
76057
76056
|
bar = (customization == null ? void 0 : customization(bar)) ?? bar;
|
|
76058
76057
|
return bar;
|
|
76059
76058
|
}
|
|
@@ -76080,7 +76079,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76080
76079
|
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76081
76080
|
frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
|
|
76082
76081
|
resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
|
|
76083
|
-
hasSelection: () => viewer.selection.count > 0,
|
|
76084
76082
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76085
76083
|
getSceneBox: () => viewer.renderer.getBoundingBox(),
|
|
76086
76084
|
getSectionBox: () => viewer.sectionBox.getBox(),
|