Project

General

Profile

Actions

Feature #5336

closed

webgl add OnCameraChange JSignal

Added by jian sun over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/12/2016
Due date:
% Done:

0%

Estimated time:

Description

server would like to receive camera change Signal from client side.

Actions #1

Updated by Wim Dumon over 7 years ago

  • Status changed from New to Resolved

Hello,

This is generally unwanted; the client can update the camera interactively several tens of times per second, which would cause undesired load if the server is not interested in this information.

Wt already supports synchronizing matrices client and server side, see JavaScriptMatrix4x4. When a server-side event handler is triggered from the client, the data of those matrices will be updated server-side to reflect their client-side state. So at the moment that the client decides that the server has to be informed of the contents of a matrix, you can simply trigger a JSlot, and the matrix data will be updated by the time your slot is invoked. You may want to implement your own camera handler if the server has to be updated of every client-side camera modification; at this time, the camera handlers don't fire events (or, at your option, only when the mouse button is released, maybe?).

We used this in projects to implement selection (intersection) tests on mouse clicks.

Wim.

Actions #2

Updated by jian sun over 7 years ago

Server need to know camera change, don't need to be real time and every client-side change. delayed update is ok.

How to add my slot for the content change from client-side?

Actions #3

Updated by jian sun over 7 years ago

camera change event does not need to be accumulate, it is a status / flag. It is important for interactively web, it enable server to do background work on camera change.

Actions #4

Updated by Roel Standaert about 7 years ago

  • Status changed from Resolved to Closed

You could use the mouseWentUp() or touchEnded() signals to see whether a drag ended. That way you know that the camera matrix may have changed.

Regards,

Roel

Actions

Also available in: Atom PDF