Tetnacious Posted October 20, 2016 Share Posted October 20, 2016 Hi, I have an animated ArcRotateCamera who's animation should pause quietly on user input (through PointersInput). At the moment the input components do not announce state changes. I think at the very least, input types should have a `get state` & an `on state change`. IMO the input system could use a rewrite. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 20, 2016 Share Posted October 20, 2016 Hello, this is unclear to me what you are looking for. can you elaborate a bit more? Quote Link to comment Share on other sites More sharing options...
Kemal UÇAR Posted October 20, 2016 Share Posted October 20, 2016 Hello Tetnacious ; I think this PG ll help you http://playground.babylonjs.com/#1QH2P6#5 Animated camera and pausing Hv nice works Quote Link to comment Share on other sites More sharing options...
Tetnacious Posted October 22, 2016 Author Share Posted October 22, 2016 Custom controls with objects are fine. The problem is that the built-in camera input objects don't use the actionManager pattern and don't raise events, They just hook themselves to the DOM. I want to be able to do something like: var cameraAnimation = scene.beginAnimation(camera, .....); camera.inputs.attached.pointers.addEventListener('onusercontrol', function() { cameraAnimation.pause(); }); Without having to rewire the entire input component. Quote Link to comment Share on other sites More sharing options...
Tetnacious Posted October 22, 2016 Author Share Posted October 22, 2016 This is what I ended up doing, I copied the ArcRotateCameraPointersInput and added 2 events and used them like this: var cameraAnimation = ..... camera.inputs.attached.pointers.onUserInteraction = function() { cameraAnimation && cameraAnimation.animationStarted && cameraAnimation.pause(); }; var idleTimeout = null; camera.inputs.attached.pointers.onIdle = function() { if (idleTimeout) clearTimeout(idleTimeout), idleTimeout = null; if (cameraAnimation && !cameraAnimation.animationStarted) idleTimeout = setTimeout(function() { cameraAnimation.restart(); }, 500); }; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.