I’m currently using onViewMatrixChangedObservable, but it triggers too quickly. I’d like it to execute only when it concludes, as there are certain tasks I want to perform based on the current focal point of the scene. I’ve used debounce to introduce a delay, but it seems to be too sluggish.
Instead of a timeout, you could use the callback function in the function call itself. That fires as soon as the event concludes, and thus works like a conclude event.
Here is a playground example I found of a callback function being attached to an event. You can simply swap the sphere for your camera object.
Is “CreateAndStartAnimation” used to create a camera animation? It should be the event that occurs after moving the scene, when the camera animation end event.
There’s no particular event for that, but you could simply override the Camera.update
method like this:
const cupdate = camera.update.bind(camera);
camera.update = () => {
cupdate();
console.log("after camera is updated");
};
I looked at the source code and found that the easing is achieved by decreasing the value of inertia, which will continuously trigger the onViewMatrixChangedObservable. Currently, the inertia decreases to 0 too slowly. I need to explore how to decrease it to 0 more quickly. And the ‘speed’ attribute seems to be adjustable.
I believe the inertia works with the speed. So decreasing the speed should also lower the impact of inertia.