Hey everyone! As I talked about in the alpha meeting today, I’ve been working on a lot of controller stuff and I’ve got some stuff to share with you.
Check out examples/example/script/controllerScriptingExamples.js for some examples of how stuff works. Beware, it’ll switch your forward and backward controls, but you can reset them with Controller.resetAllDeviceBindings(). A known issue is that the acceleration curve is hardcoded, so the sensitivities of directional movements won’t actually work, but you could take advantage of the sensitivities in some script if you wanted!
Eventually, it would be really nice to have some menu you could bring up to see all the mappings for all the devices and modify them via some dropdown menus or something. Someone more design-minded than me should look into that and maybe put up a worklist job!
Second, zooming! You can zoom now. That’s pretty much it. Shift+w to zoom in, shift+s to zoom out. If you zoom in enough, it’ll snap to first person mode, and snap back to third person when you zoom out. Cool.
Next up, center player in view mode. View->Center Player In View will keep your avatar’s head in the center of the screen as you move the camera around.
Next, examples/mouseLook.js. This was a requested mode and we might be making it the default at some point. While the script is running, you can toggle it with CTRL+M (which is different from the command for muting). Mouse movement (with or without right clicking) will move the camera, ‘a’, ‘d’, left arrow, and right arrow become strafing, and shift+those keys will rotate the camera. There are lots of updates for this script planned, so definitely tell us what you’d like to see.
And lastly, examples/hmdControls.js, which is included in this PR: https://github.com/highfidelity/hifi/pull/5167. All the details and stuff are up over there. I think it’ll also work as a pretty good template for any custom movement scripts.
…I think that’s everything I’ve been working on. I’ll continue updating these scripts to fix some of the issues I mentioned, but I wanted to get them out to you guys so you could play around with them.
Let me know what you guys think! Thanks for reading this wall of text.