Disable camera move on single clicks in the scene

Hi,

I have exported the scene to view as a webpage. Is there any way i can disable the camera movements on single clicks in JS?

I would like the camera to move only on double clicks.

You can capture the single click event in any node, something like:

WALK.getViewer().onNodeTypeClicked(function() {
   return true; // returning true prevents further processing of the click event.
});

Is it possible to control the camera movement and rotation whenever the onNodeTypeClicked, like how close the camera should move to the position of where i clicked,

After you disable the built-in camera movement in the way desrcibed above, you can move the camera to another location by switching to an ad-hoc view, see: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

The onNodeTypeClicked callback is called with the 3D position of the clicked scene point, which can be used to compute where to move the camera.

We have Urgent requirement to disable all the clicks other than the click on this circle icons, I disabled the single click, but client wants disable click at other regions fully, expect this circle region,

So please help me @jan @wojtek

Btw this circle is object trigger to switch camera,

You need to introduce some additional logic to achieve your desired behavior.

WALK.getViewer().onNodeTypeClicked(function(node) {
  // check if the node that is being clicked is the one that you're interested in
  // if so, change the camera to the view you want and return true.
});

WALK.getViewer().onNodeTypeClicked(function() {
return true; // stop the click from processing
});

This way, the first callback where you check for the node being the one you’re interested in and then changing the view will be called first and then the second callback will be used and it will prevent (by returning true) further processing of the click.

Clicking the object and changing the view, I already integrated in extensions, its not problem,

Problem is double click, so i tried to remove that even

var canvas = document.getElementById(‘walk-canvas’);
var lastPointerDownTime = 0;
var doubleClickThreshold = 200;

canvas.addEventListener(‘pointerdown’, function(event) {
var currentTime = new Date().getTime();

if (currentTime - lastPointerDownTime < doubleClickThreshold) {
  event.preventDefault();
  event.stopPropagation()
}

lastPointerDownTime = currentTime;

});

Its working fine in laptop, doubleclick is disabled, but in mobile touch works different way i guess, any idea how to fix that?? i even used “touchstart”,“touchend”,“click”, but didn’t help much!!!