{"id":16579434,"url":"https://github.com/brianpeiris/three-firstperson-vr-controls","last_synced_at":"2025-03-21T12:32:31.553Z","repository":{"id":136732101,"uuid":"49349627","full_name":"brianpeiris/three-firstperson-vr-controls","owner":"brianpeiris","description":"First-person controls for VR based on three.js","archived":false,"fork":false,"pushed_at":"2018-03-22T15:30:30.000Z","size":26096,"stargazers_count":33,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-15T02:36:36.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianpeiris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-10T02:02:08.000Z","updated_at":"2023-10-27T10:18:33.000Z","dependencies_parsed_at":"2023-06-14T12:00:25.052Z","dependency_job_id":null,"html_url":"https://github.com/brianpeiris/three-firstperson-vr-controls","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"0af1bce78221799d7d58c149d7e93fa160d85e3f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpeiris%2Fthree-firstperson-vr-controls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpeiris%2Fthree-firstperson-vr-controls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpeiris%2Fthree-firstperson-vr-controls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpeiris%2Fthree-firstperson-vr-controls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianpeiris","download_url":"https://codeload.github.com/brianpeiris/three-firstperson-vr-controls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244799525,"owners_count":20512264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T22:17:59.651Z","updated_at":"2025-03-21T12:32:30.562Z","avatar_url":"https://github.com/brianpeiris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# THREE.FirstPersonVRControls\n\n[![npm](https://img.shields.io/npm/v/three-firstperson-vr-controls.svg)](https://www.npmjs.com/package/three-firstperson-vr-controls)\n\nFirst-person keyboard controls for VR based on three.js with look-based movement and \"comfort mode\" snap turning.\n\n## Controls\n\n- \u003ckbd\u003eW\u003c/kbd\u003e\u003ckbd\u003eA\u003c/kbd\u003e\u003ckbd\u003eS\u003c/kbd\u003e\u003ckbd\u003eD\u003c/kbd\u003e or \u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e \n  for forward/backward movement and strafing (if enabled).\n- \u003ckbd\u003eShift\u003c/kbd\u003e to boost movement speed temporarily.\n- \u003ckbd\u003eQ\u003c/kbd\u003e\u003ckbd\u003eE\u003c/kbd\u003e for snap turns.\n- \u003ckbd\u003eR\u003c/kbd\u003e\u003ckbd\u003eF\u003c/kbd\u003e for vertical movement (if enabled).\n- Forward/backward movement is always in the direction that you're looking.\n\n## Usage\n\n    $ npm install three-firstperson-vr-controls\n  \n```javascript\n...  \n\n// Create a rig and add the camera to it. \n// FirstPersonVRControls will move the rig, instead of moving the camera directly. \n// If you don't provide a rig, FirstPersonVRControls will create one for you.\nconst rig = new THREE.Object3D();\nrig.add(camera);\nscene.add(rig);\n\nconst fpVrControls = new THREE.FirstPersonVRControls(camera, scene, rig);\n// Optionally enable vertical movement.\nfpVrControls.verticalMovement = true;\n// You can also enable strafing, set movementSpeed, snapAngle and boostFactor.\nfpVrControls.strafing = true;\n...\nconst clock = new THREE.Clock();\nfunction animate () {\n  ...\n  // FirstPersonControls requires a time delta.\n  fpVrControls.update(clock.getDelta());\n  renderer.render(scene, camera);\n}\nrenderer.animate(animate);\n```\n  \n## Demo\n\nhttp://brian.peiris.io/three-firstperson-vr-controls/demo/browser-demo.html\n  \n![Animated demo of the controls in action](demo/demo.gif)\n\n## Credits\n\nBased on code from [THREE.FirstPersonControls](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/FirstPersonControls.js) and its contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpeiris%2Fthree-firstperson-vr-controls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianpeiris%2Fthree-firstperson-vr-controls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpeiris%2Fthree-firstperson-vr-controls/lists"}