Mouse polling
by Ian Omroth Hardingham · in Torque Game Engine · 05/27/2007 (8:01 am) · 1 replies
Hey guys.
I'm interested in what rate at which the mouse is polled. Whenever a move is detected by the InputManager the ActionMap calls the relevant script function (yaw or pitch by default) - I'm wandering whether that script function is posted as often as the mouse is polled, or just every 32ms. I presume one wouldn't be wanting to call a script function much more than once every 32ms... anyway, any info on this would be much appreciated.
Ian
I'm interested in what rate at which the mouse is polled. Whenever a move is detected by the InputManager the ActionMap calls the relevant script function (yaw or pitch by default) - I'm wandering whether that script function is posted as often as the mouse is polled, or just every 32ms. I presume one wouldn't be wanting to call a script function much more than once every 32ms... anyway, any info on this would be much appreciated.
Ian
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
Torque 3D Owner Scott Richards
-> DemoGame::main() -> Platform::process() -> CheckCursorPos() - > GameInterface::postEvent(InputEvent of MouseDeviceType) -> GameInterface::processEvent(same) -> DemoGame::processInputEvent() -> ActionMap::handleEvent() -> ActionMap::processAction() -> [script action bound to input]In script, mouse movements are accumulated in buffer variables like $mvYaw which are then recorded and reset on each Tick (representing but not guaranteed to be once every 32ms).
So to answer your question, it seems as though the mouse is polled once per main() loop (essentially once per frame). Even though the input is ultimately collected in 32ms input buffers (Moves).