Feature #5336
closedwebgl add OnCameraChange JSignal
0%
Description
server would like to receive camera change Signal from client side.
Updated by Wim Dumon over 8 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.
Updated by jian sun over 8 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?
Updated by jian sun over 8 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.
Updated by Roel Standaert about 8 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