@xeokit/xeokit-sdk 2.6.0-beta-13 → 2.6.0-beta-15
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/web-ifc.wasm +0 -0
- package/dist/xeokit-sdk.cjs.js +152 -84
- package/dist/xeokit-sdk.es.js +152 -84
- package/dist/xeokit-sdk.es5.js +38 -38
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +3 -3
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.js +6 -3
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.js +10 -3
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +5 -3
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.js +22 -8
- package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +1 -1
- package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +22 -16
- package/src/plugins/SectionPlanesPlugin/Control.js +70 -35
- package/src/viewer/scene/CameraControl/lib/controllers/PickController.js +1 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +12 -12
- package/src/viewer/scene/model/SceneModel.js +1 -1
|
@@ -156,7 +156,7 @@ class MousePanRotateDollyHandler {
|
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
document.addEventListener("mousemove", this._documentMouseMoveHandler = () => {
|
|
159
|
+
document.addEventListener("mousemove", this._documentMouseMoveHandler = (e) => {
|
|
160
160
|
|
|
161
161
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
162
162
|
return;
|
|
@@ -177,10 +177,10 @@ class MousePanRotateDollyHandler {
|
|
|
177
177
|
|
|
178
178
|
const panning = keyDown[scene.input.KEY_SHIFT] || configs.planView || (!configs.panRightClick && mouseDownMiddle) || (configs.panRightClick && mouseDownRight);
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
const xDelta = document.pointerLockElement ? e.movementX : (x - lastX);
|
|
181
|
+
const yDelta = document.pointerLockElement ? e.movementY : (y - lastY);
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
const yPanDelta = (y - lastY);
|
|
183
|
+
if (panning) {
|
|
184
184
|
|
|
185
185
|
const camera = scene.camera;
|
|
186
186
|
|
|
@@ -191,13 +191,13 @@ class MousePanRotateDollyHandler {
|
|
|
191
191
|
const depth = Math.abs(mouseDownPicked ? math.lenVec3(math.subVec3(pickedWorldPos, scene.camera.eye, [])) : scene.camera.eyeLookDist);
|
|
192
192
|
const targetDistance = depth * Math.tan((camera.perspective.fov / 2) * Math.PI / 180.0);
|
|
193
193
|
|
|
194
|
-
updates.panDeltaX += (1.5 *
|
|
195
|
-
updates.panDeltaY += (1.5 *
|
|
194
|
+
updates.panDeltaX += (1.5 * xDelta * targetDistance / canvasHeight);
|
|
195
|
+
updates.panDeltaY += (1.5 * yDelta * targetDistance / canvasHeight);
|
|
196
196
|
|
|
197
197
|
} else {
|
|
198
198
|
|
|
199
|
-
updates.panDeltaX += 0.5 * camera.ortho.scale * (
|
|
200
|
-
updates.panDeltaY += 0.5 * camera.ortho.scale * (
|
|
199
|
+
updates.panDeltaX += 0.5 * camera.ortho.scale * (xDelta / canvasHeight);
|
|
200
|
+
updates.panDeltaY += 0.5 * camera.ortho.scale * (yDelta / canvasHeight);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
} else if (mouseDownLeft && !mouseDownMiddle && !mouseDownRight) {
|
|
@@ -205,12 +205,12 @@ class MousePanRotateDollyHandler {
|
|
|
205
205
|
if (!configs.planView) { // No rotating in plan-view mode
|
|
206
206
|
|
|
207
207
|
if (configs.firstPerson) {
|
|
208
|
-
updates.rotateDeltaY -= (
|
|
209
|
-
updates.rotateDeltaX += (
|
|
208
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * configs.dragRotationRate / 2;
|
|
209
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate / 4);
|
|
210
210
|
|
|
211
211
|
} else {
|
|
212
|
-
updates.rotateDeltaY -= (
|
|
213
|
-
updates.rotateDeltaX += (
|
|
212
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * (configs.dragRotationRate * 1.5);
|
|
213
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate * 1.5);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -2669,7 +2669,7 @@ export class SceneModel extends Component {
|
|
|
2669
2669
|
return;
|
|
2670
2670
|
}
|
|
2671
2671
|
let parentTransform;
|
|
2672
|
-
if (
|
|
2672
|
+
if (cfg.parentTransformId) {
|
|
2673
2673
|
parentTransform = this._transforms[cfg.parentTransformId];
|
|
2674
2674
|
if (!parentTransform) {
|
|
2675
2675
|
this.error("[createTransform] SceneModel.createTransform() config missing: id");
|