{"id":14981334,"url":"https://github.com/depasqualeorg/three-immersive-controls","last_synced_at":"2025-05-07T16:10:12.484Z","repository":{"id":52279495,"uuid":"466549666","full_name":"DePasqualeOrg/three-immersive-controls","owner":"DePasqualeOrg","description":"VR controls for Three.js","archived":false,"fork":false,"pushed_at":"2024-09-29T11:26:23.000Z","size":724,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T16:10:02.930Z","etag":null,"topics":["three-js","threejs","virtual-reality","webxr"],"latest_commit_sha":null,"homepage":"https://unpkg.com/@depasquale/three-immersive-controls/examples/index.html","language":"TypeScript","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/DePasqualeOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-03-05T19:31:31.000Z","updated_at":"2025-05-05T04:30:22.000Z","dependencies_parsed_at":"2024-10-11T22:21:30.596Z","dependency_job_id":"3f4d0dc1-8952-4882-b42a-2b3da9b69d48","html_url":"https://github.com/DePasqualeOrg/three-immersive-controls","commit_stats":{"total_commits":47,"total_committers":1,"mean_commits":47.0,"dds":0.0,"last_synced_commit":"7529f7af8beeab6d7d2cbdf74870018a49edebfd"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DePasqualeOrg%2Fthree-immersive-controls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DePasqualeOrg%2Fthree-immersive-controls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DePasqualeOrg%2Fthree-immersive-controls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DePasqualeOrg%2Fthree-immersive-controls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DePasqualeOrg","download_url":"https://codeload.github.com/DePasqualeOrg/three-immersive-controls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252912996,"owners_count":21824066,"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":["three-js","threejs","virtual-reality","webxr"],"created_at":"2024-09-24T14:03:20.454Z","updated_at":"2025-05-07T16:10:12.444Z","avatar_url":"https://github.com/DePasqualeOrg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Three.js Immersive Controls\n\n- Immersive (VR) functionality\n  - Movement and rotation with VR controllers (move with left thumbstick, rotate with right thumbstick)\n  - Object selection with VR controllers (`A` button or trigger)\n- Browser window functionality\n  - Movement and rotation with keyboard (WASD and arrow keys)\n  - Object selection with mouse\n\n### Installation\n\n```\nnpm install @depasquale/three-immersive-controls\n```\n\n### Usage\n\n```javascript\nimport ImmersiveControls from '@depasquale/three-immersive-controls';\n\n// Create the `camera`, `renderer`, and `scene` instances with Three.js\n// ...\n\nconst controls = new ImmersiveControls(camera, renderer, scene, { /* options */ });\n```\n\nInclude this in the render loop:\n\n```javascript\ncontrols.update();\n```\n\n### Options\n\n- `initialPosition: THREE.Vector3`\n  - The player's initial position in the scene. Default is `new THREE.Vector3(0, 1.6, 4)`.\n- `lookAt: THREE.Vector3`\n  - Point toward which the player is initially oriented. (Not yet implemented.)\n- `floor: number | false`\n  - `number` (default is `0`): Sets the y position of a floor below which the player cannot pass (simple solution for collision detection instead of navmeshes).\n  - `false`: No limit to the player's movement along the y-axis is set.\n- `gravity: true | false`\n  - `true` (default): The player's movement is restricted to the x- and z-axes, and the y position remains at the `floor` setting.\n  - `false`: The player can also move vertically along the y-axis (flight mode).\n- `moveSpeed: { keyboard: number, vr: number }`\n  - Speed at which the player moves through the scene when input is received from the keyboard or VR controllers. Default is `{ vr: 2.5, keyboard: 5 }`.\n- `rotateSpeed: number`\n  - Speed at which the player is rotated when input is received from the keyboard or VR controllers. Default is `1`.\n- `tumble: true | false`\n  - Allow the player to rotate on the x-axis in addition to the y-axis. Default is `false`.\n- `showControllerModel: true | false`\n  - Show the VR controllers in immersive mode. Default is `true`.\n- `showEnterVRButton: true | false`\n  - Add a button to the DOM to allow the user to enter immersive mode when this functionality is supported. Default is `true`.\n- `showExitVRButton: true | false`\n  - Display a button in front of the player in the scene which allows the user to exit immersive mode. Default is `true`.\n- `vrControls: true | false`\n  - Activate immersive (VR) controls. Default is `true`.\n- `keyboardControls: true | false`\n  - Activate keyboard controls. Default is `true`.\n- `mouseControls: true | false`\n  - Activate mouse controls. Default is `true`. (Movement with mouse input has not yet been implemented, but object selection with the mouse works.)\n- `showFps: true | false`\n  - Display the `Stats` indicator in the DOM and in front of the player in the scene to monitor performance. Default is `false`.\n\n### Examples\n\nExamples are provided in the `examples` directory. To try them locally in your browser, run:\n\n```\nnpm run examples\n```\n\nOr try them [here](https://unpkg.com/@depasquale/three-immersive-controls/examples/index.html).\n\n### To do\n\n- Add collision detection with navmeshes\n- Test with a variety of VR devices (so far only tested with Oculus Quest 2)\n- Handle situations when only one VR controller is available\n- Add controls for touchscreen devices\n- Better repositioning of \"Exit VR\" button in scene\n- Possible additional features\n  - Teleportation\n  - Blinders during rotation and movement\n  - Movement with mouse input\n  - Hand tracking\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepasqualeorg%2Fthree-immersive-controls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepasqualeorg%2Fthree-immersive-controls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepasqualeorg%2Fthree-immersive-controls/lists"}