{"id":15313994,"url":"https://github.com/vanruesc/spatial-controls","last_synced_at":"2025-08-26T10:32:01.567Z","repository":{"id":70175456,"uuid":"115656883","full_name":"vanruesc/spatial-controls","owner":"vanruesc","description":"3D movement controls.","archived":false,"fork":false,"pushed_at":"2025-08-07T14:53:28.000Z","size":12572,"stargazers_count":53,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-07T14:54:46.181Z","etag":null,"topics":["3d","camera","camera-controls","configurable","controls"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanruesc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2017-12-28T20:23:37.000Z","updated_at":"2025-08-07T14:51:11.000Z","dependencies_parsed_at":"2024-10-31T01:03:37.856Z","dependency_job_id":"6fb29251-24d7-4034-b1d2-a78eeeb3e1f8","html_url":"https://github.com/vanruesc/spatial-controls","commit_stats":{"total_commits":470,"total_committers":2,"mean_commits":235.0,"dds":"0.13617021276595742","last_synced_commit":"5784821d8593673ecdc1f6b28377f5adad683b2b"},"previous_names":["vanruesc/delta-controls"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/vanruesc/spatial-controls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Fspatial-controls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Fspatial-controls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Fspatial-controls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Fspatial-controls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanruesc","download_url":"https://codeload.github.com/vanruesc/spatial-controls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanruesc%2Fspatial-controls/sbom","scorecard":{"id":916117,"data":{"date":"2025-08-11","repo":{"name":"github.com/vanruesc/spatial-controls","commit":"db0012c6090c9e928791176d7d51337288b25951"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Maintained","score":8,"reason":"10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cd.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/cd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cd.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/cd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cd.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/cd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cd.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/cd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cd.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/cd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/vanruesc/spatial-controls/ci.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/cd.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: zlib License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T21:03:41.253Z","repository_id":70175456,"created_at":"2025-08-24T21:03:41.253Z","updated_at":"2025-08-24T21:03:41.253Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272209881,"owners_count":24892444,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["3d","camera","camera-controls","configurable","controls"],"created_at":"2024-10-01T08:44:00.769Z","updated_at":"2025-08-26T10:32:01.055Z","avatar_url":"https://github.com/vanruesc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spatial Controls\n\n[![CI](https://github.com/vanruesc/spatial-controls/actions/workflows/ci.yml/badge.svg)](https://github.com/vanruesc/spatial-controls/actions/workflows/ci.yml)\n[![Version](https://badgen.net/npm/v/spatial-controls?color=green)](https://www.npmjs.com/package/spatial-controls)\n\nA movement controller for 3D objects and cameras that supports multiple control modes, smooth interpolation and configurable input settings.\n\n*[Demo](https://vanruesc.github.io/spatial-controls/demo)\u0026ensp;\u0026middot;\u0026ensp;[Documentation](https://vanruesc.github.io/spatial-controls/docs)*\n\n\n## Installation\n\nThis library requires the peer dependency [three](https://github.com/mrdoob/three.js/).\n\n```sh\nnpm install three spatial-controls\n```\n\n\n## Usage\n\n```js\nimport { PerspectiveCamera } from \"three\";\nimport { SpatialControls } from \"spatial-controls\";\n\nconst camera = new PerspectiveCamera(...);\nconst { position, quaternion } = camera;\nconst domElement = document.getElementById(\"viewport\");\nconst controls = new SpatialControls(position, quaternion, domElement);\n\nrequestAnimationFrame(function render(timestamp) {\n\n\trequestAnimationFrame(render);\n\tcontrols.update(timestamp);\n\n});\n```\n\n#### Position, Target and Quaternion\n\nThe position, target and quaternion can be modified directly at any time. A subsequent `update()` call synchronizes the internal state of the controls. The `quaternion` has a higher priority than the `target`, meaning that changes to the `quaternion` will always set the `target`. The following methods are provided for convenience:\n\n```js\n// Sets or replaces the position vector.\ncontrols.position.set(x, y, z);\ncontrols.position = otherPosition;\n\n// Sets or replaces the target vector.\ncontrols.target.set(x, y, z);\ncontrols.target = otherTarget;\n\n// Sets the target without replacing it and updates the quaternion.\ncontrols.lookAt(x, y, z);\ncontrols.lookAt(target);\n```\n\n## Settings\n\n### Configuration\n\n```js\nimport { Action, ControlMode, KeyCode, PointerButton } from \"spatial-controls\";\n\nconst settings = controls.settings;\nsettings.general.mode = ControlMode.THIRD_PERSON;\nsettings.rotation.sensitivity = 2.2;\nsettings.rotation.damping = 0.05;\nsettings.translation.sensitivity = 0.25;\nsettings.translation.damping = 0.1;\nsettings.zoom.setRange(0.25, 3.0);\nsettings.zoom.damping = 0.1;\n\nconst keyBindings = settings.keyBindings;\nkeyBindings.delete(KeyCode.KEY_X);\nkeyBindings.set(KeyCode.KEY_V, Action.MOVE_DOWN);\n\nconst pointerBindings = settings.pointerBindings;\npointerBindings.delete(PointerButton.MAIN);\npointerBindings.set(PointerButton.SECONDARY, Action.ROTATE);\n\n// The context menu can be disabled like this:\ndocument.body.addEventListener(\"contextmenu\", e =\u003e e.preventDefault());\n```\n\nSee the [docs](https://vanruesc.github.io/spatial-controls/docs/classes/Settings.html) for more information.\n\n### Saving and Loading\n\n```js\n// JSON round-trip.\nconst json = JSON.stringify(settings);\nsettings.fromJSON(json);\n\n// Via local storage.\nlocalStorage.setItem(\"spatial-controls\", JSON.stringify(settings));\nsettings.fromJSON(localStorage.getItem(\"spatial-controls\"));\n\n// Save as JSON file.\nconst settingsURL = URL.createObjectURL(settings.toBlob());\nconst a = document.createElement(\"a\");\na.setAttribute(\"href\", settingsURL);\na.setAttribute(\"download\", \"spatial-controls.json\");\na.click();\nURL.revokeObjectURL(settingsURL);\n\n// Load from JSON file.\nfetch(\"./spatial-controls.json\")\n\t.then(response =\u003e response.text())\n\t.then(data =\u003e settings.fromJSON(data))\n\t.catch(e =\u003e console.error(e));\n```\n\n## Constraints\n\nCustom constraints are applied to the `position` in 1st person mode and to the `target` in 3rd person mode.\n\n```js\nconst box = new Box3();\nbox.min.set(-1, -1, -1);\nbox.max.set(1, 1, 1);\n\nconst boxConstraint = (p: Vector3) =\u003e box.clampPoint(p, p);\ncontrols.constraints.add(boxConstraint);\ncontrols.constraints.delete(boxConstraint);\n```\n\n\n## Contributing\n\nPlease refer to the [contribution guidelines](https://github.com/vanruesc/spatial-controls/blob/main/.github/CONTRIBUTING.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanruesc%2Fspatial-controls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanruesc%2Fspatial-controls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanruesc%2Fspatial-controls/lists"}