Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 11, 2024
1 parent da1d7b2 commit 42902d5
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 49 deletions.
60 changes: 45 additions & 15 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -61851,7 +61851,7 @@ class VBOInstancingTrianglesLayer {
state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.indices), geometry.indices.length, 1, gl.STATIC_DRAW);
state.numIndices = geometry.indices.length;
}
if (geometry.primitive === "triangles" || geometry.primitive === "solid" || geometry.primitive === "surface") {
if (geometry.edgeIndices && geometry.edgeIndices.length > 0) {
state.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.edgeIndices), geometry.edgeIndices.length, 1, gl.STATIC_DRAW);
}

Expand Down Expand Up @@ -97467,7 +97467,6 @@ class MousePanRotateDollyHandler {
});

function setMousedownState(pick = true) {
canvas.style.cursor = "move";
setMousedownPositions();
if (pick) {
setMousedownPick();
Expand Down Expand Up @@ -98258,7 +98257,7 @@ class KeyboardPanRotateDollyHandler {

const keyDownMap = [];

const canvas = scene.canvas.canvas;
scene.canvas.canvas;

let mouseMovedSinceLastKeyboardDolly = true;

Expand All @@ -98274,10 +98273,6 @@ class KeyboardPanRotateDollyHandler {
return;
}
keyDownMap[keyCode] = true;

if (keyCode === input.KEY_SHIFT) {
canvas.style.cursor = "move";
}
});

this._onSceneKeyUp = input.on("keyup", (keyCode) => {
Expand All @@ -98286,10 +98281,6 @@ class KeyboardPanRotateDollyHandler {
}
keyDownMap[keyCode] = false;

if (keyCode === input.KEY_SHIFT) {
canvas.style.cursor = null;
}

if (controllers.pivotController.getPivoting()) {
controllers.pivotController.endPivot();
}
Expand Down Expand Up @@ -98446,6 +98437,7 @@ class CameraUpdater {
const pickController = controllers.pickController;
const pivotController = controllers.pivotController;
const panController = controllers.panController;
const cameraControl = controllers.cameraControl;

let countDown = SCALE_DOLLY_EACH_FRAME; // Decrements on each tick
let dollyDistFactor = 1.0; // Calculated when countDown is zero
Expand Down Expand Up @@ -98570,7 +98562,7 @@ class CameraUpdater {
updates.rotateDeltaX *= configs.rotationInertia;
updates.rotateDeltaY *= configs.rotationInertia;

cursorType = "grabbing";
cursorType = cameraControl._cursors.rotate;
}

//----------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -98636,7 +98628,7 @@ class CameraUpdater {
camera.pan(vec);
}

cursorType = "grabbing";
cursorType = cameraControl._cursors.pan;
}

updates.panDeltaX *= configs.panInertia;
Expand All @@ -98650,9 +98642,9 @@ class CameraUpdater {
if (dollyDeltaForDist !== 0) {

if (dollyDeltaForDist < 0) {
cursorType = "zoom-in";
cursorType = cameraControl._cursors.dollyForward;
} else {
cursorType = "zoom-out";
cursorType = cameraControl._cursors.dollyBackward;
}

if (configs.firstPerson) {
Expand Down Expand Up @@ -100113,6 +100105,13 @@ class CameraControl extends Component {
new KeyboardPanRotateDollyHandler(this.scene, this._controllers, this._configs, this._states, this._updates)
];

this._cursors = {
dollyForward: "zoom-in",
dollyBackward: "zoom-out",
rotate: 'grabbing',
pan: 'move',
};

// Applies scheduled updates to the Camera on each Scene "tick" event

this._cameraUpdater = new CameraUpdater(this.scene, this._controllers, this._configs, this._states, this._updates);
Expand Down Expand Up @@ -100474,6 +100473,37 @@ class CameraControl extends Component {
this._configs.pointerEnabled = !!value;
}

/**
* Sets the cursor to be used when a particular action is being performed.
*
* Accepted actions are:
*
* * "dollyForward" - when the camera is dollying in the forward direction
* * "dollyBackward" - when the camera is dollying in the backward direction
* * "pan" - when the camera is being panned
* * "rotate" - when the camera is being rotated
*
* @param {String} action
* @param {String} style
*/
setCursorStyle(action, style) {
if (Object.prototype.hasOwnProperty.call(this._cursors, action)) {
this._cursors = { ...this._cursors, [action]: style };
}
else
console.warn(`Action '${action}' is not valid for cursor styles.`);
}

/**
* Gets the current style for a particular action.
*
* @param {String} action To get the style for
* @returns {String} style set on the cursor for action
*/
getCursorStyle(action) {
return this._cursors[action] || null;
}

_reset() {
for (let i = 0, len = this._handlers.length; i < len; i++) {
const handler = this._handlers[i];
Expand Down
60 changes: 45 additions & 15 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -61847,7 +61847,7 @@ class VBOInstancingTrianglesLayer {
state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.indices), geometry.indices.length, 1, gl.STATIC_DRAW);
state.numIndices = geometry.indices.length;
}
if (geometry.primitive === "triangles" || geometry.primitive === "solid" || geometry.primitive === "surface") {
if (geometry.edgeIndices && geometry.edgeIndices.length > 0) {
state.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.edgeIndices), geometry.edgeIndices.length, 1, gl.STATIC_DRAW);
}

Expand Down Expand Up @@ -97463,7 +97463,6 @@ class MousePanRotateDollyHandler {
});

function setMousedownState(pick = true) {
canvas.style.cursor = "move";
setMousedownPositions();
if (pick) {
setMousedownPick();
Expand Down Expand Up @@ -98254,7 +98253,7 @@ class KeyboardPanRotateDollyHandler {

const keyDownMap = [];

const canvas = scene.canvas.canvas;
scene.canvas.canvas;

let mouseMovedSinceLastKeyboardDolly = true;

Expand All @@ -98270,10 +98269,6 @@ class KeyboardPanRotateDollyHandler {
return;
}
keyDownMap[keyCode] = true;

if (keyCode === input.KEY_SHIFT) {
canvas.style.cursor = "move";
}
});

this._onSceneKeyUp = input.on("keyup", (keyCode) => {
Expand All @@ -98282,10 +98277,6 @@ class KeyboardPanRotateDollyHandler {
}
keyDownMap[keyCode] = false;

if (keyCode === input.KEY_SHIFT) {
canvas.style.cursor = null;
}

if (controllers.pivotController.getPivoting()) {
controllers.pivotController.endPivot();
}
Expand Down Expand Up @@ -98442,6 +98433,7 @@ class CameraUpdater {
const pickController = controllers.pickController;
const pivotController = controllers.pivotController;
const panController = controllers.panController;
const cameraControl = controllers.cameraControl;

let countDown = SCALE_DOLLY_EACH_FRAME; // Decrements on each tick
let dollyDistFactor = 1.0; // Calculated when countDown is zero
Expand Down Expand Up @@ -98566,7 +98558,7 @@ class CameraUpdater {
updates.rotateDeltaX *= configs.rotationInertia;
updates.rotateDeltaY *= configs.rotationInertia;

cursorType = "grabbing";
cursorType = cameraControl._cursors.rotate;
}

//----------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -98632,7 +98624,7 @@ class CameraUpdater {
camera.pan(vec);
}

cursorType = "grabbing";
cursorType = cameraControl._cursors.pan;
}

updates.panDeltaX *= configs.panInertia;
Expand All @@ -98646,9 +98638,9 @@ class CameraUpdater {
if (dollyDeltaForDist !== 0) {

if (dollyDeltaForDist < 0) {
cursorType = "zoom-in";
cursorType = cameraControl._cursors.dollyForward;
} else {
cursorType = "zoom-out";
cursorType = cameraControl._cursors.dollyBackward;
}

if (configs.firstPerson) {
Expand Down Expand Up @@ -100109,6 +100101,13 @@ class CameraControl extends Component {
new KeyboardPanRotateDollyHandler(this.scene, this._controllers, this._configs, this._states, this._updates)
];

this._cursors = {
dollyForward: "zoom-in",
dollyBackward: "zoom-out",
rotate: 'grabbing',
pan: 'move',
};

// Applies scheduled updates to the Camera on each Scene "tick" event

this._cameraUpdater = new CameraUpdater(this.scene, this._controllers, this._configs, this._states, this._updates);
Expand Down Expand Up @@ -100470,6 +100469,37 @@ class CameraControl extends Component {
this._configs.pointerEnabled = !!value;
}

/**
* Sets the cursor to be used when a particular action is being performed.
*
* Accepted actions are:
*
* * "dollyForward" - when the camera is dollying in the forward direction
* * "dollyBackward" - when the camera is dollying in the backward direction
* * "pan" - when the camera is being panned
* * "rotate" - when the camera is being rotated
*
* @param {String} action
* @param {String} style
*/
setCursorStyle(action, style) {
if (Object.prototype.hasOwnProperty.call(this._cursors, action)) {
this._cursors = { ...this._cursors, [action]: style };
}
else
console.warn(`Action '${action}' is not valid for cursor styles.`);
}

/**
* Gets the current style for a particular action.
*
* @param {String} action To get the style for
* @returns {String} style set on the cursor for action
*/
getCursorStyle(action) {
return this._cursors[action] || null;
}

_reset() {
for (let i = 0, len = this._handlers.length; i < len; i++) {
const handler = this._handlers[i];
Expand Down
37 changes: 27 additions & 10 deletions dist/xeokit-sdk.es5.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/xeokit-sdk.min.cjs.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/xeokit-sdk.min.es.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/xeokit-sdk.min.es5.js

Large diffs are not rendered by default.

0 comments on commit 42902d5

Please sign in to comment.