{"id":32637558,"url":"https://github.com/corollarium/babylon-boids","last_synced_at":"2025-10-31T01:59:26.571Z","repository":{"id":42927902,"uuid":"241630952","full_name":"Corollarium/babylon-boids","owner":"Corollarium","description":"A boids library for BabylonJS","archived":false,"fork":false,"pushed_at":"2023-03-04T06:06:42.000Z","size":966,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T01:59:09.982Z","etag":null,"topics":["babylonjs","boids","webgl"],"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/Corollarium.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}},"created_at":"2020-02-19T13:39:04.000Z","updated_at":"2025-10-25T17:25:11.000Z","dependencies_parsed_at":"2023-02-08T04:17:10.545Z","dependency_job_id":null,"html_url":"https://github.com/Corollarium/babylon-boids","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Corollarium/babylon-boids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corollarium%2Fbabylon-boids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corollarium%2Fbabylon-boids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corollarium%2Fbabylon-boids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corollarium%2Fbabylon-boids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Corollarium","download_url":"https://codeload.github.com/Corollarium/babylon-boids/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corollarium%2Fbabylon-boids/sbom","scorecard":{"id":33291,"data":{"date":"2025-08-11","repo":{"name":"github.com/Corollarium/babylon-boids","commit":"3bb504fbd66727425687c4d4bbfe9c28778916c5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Code-Review","score":0,"reason":"Found 0/13 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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","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":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"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-14T19:41:52.747Z","repository_id":42927902,"created_at":"2025-08-14T19:41:52.747Z","updated_at":"2025-08-14T19:41:52.747Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281914565,"owners_count":26583084,"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-10-30T02:00:06.501Z","response_time":61,"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":["babylonjs","boids","webgl"],"created_at":"2025-10-31T01:58:59.617Z","updated_at":"2025-10-31T01:59:26.566Z","avatar_url":"https://github.com/Corollarium.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babylon-boids\nA [boids](https://en.wikipedia.org/wiki/Boids) library for [BabylonJS](https://babylonjs.com/). Used in the [Laje de Santos Virtual Dive project](https://corollarium.github.io/lajevr/). Check:\n\n- [Demo with boxes](https://corollarium.github.io/babylon-boids/boxes.html)\n- [Demo with scary sharks](https://corollarium.github.io/babylon-boids/fish.html)\n\n![Shark boids](sharks.png)\n![Shark boids with the debugging helpers](sharks-bounds.png)\n\n## How to use it\n\nFirst create your `BoidsManager` object and associate it with your meshes.\n\n```js\nfunction loadCubes (total, scene) {\n    // instantiate our boids manager. Note it doesn't handle the meshes themselves, only the total meshes.\n    const boidsManager = new BoidsManager(total, new BABYLON.Vector3(0.0, 0.0, 0.0), 10.0, 10.0);\n\n    // so let's now create our meshes\n    const models = [];\n    const brickMaterial = new BABYLON.StandardMaterial('brickMaterial', scene);\n    brickMaterial.diffuseTexture = new BABYLON.Texture('does_not_exist');\n    for (let i = 0; i \u003c total; i++) {\n        // create a box\n        const box = BABYLON.MeshBuilder.CreateBox(\n            'box' + i,\n            {\n                width: 0.3, height: 0.5, depth: 1.0\n            }\n        );\n\n        // associate box to boid data. \n        box.boid = boidsManager.boids[i];\n        box.material = brickMaterial;\n        models.push(box);\n    }\n\n    // if you want to get a debug with bounding spheres and velocity vectors\n    boidsManager.showDebug();\n    boidsManager.gui(scene);\n\n    // so we return 3 things here: the models, the boidsManager, and an update callback\n    // for the render loop.\n    return {\n        models,\n        boidsManager,\n        update: ((_boids, _models) =\u003e {\n            return (deltaTime) =\u003e {\n                // update the boid simulation first\n                _boids.update(deltaTime);\n                // now apply the calculated positions/orientations to the meshes\n                _models.forEach((m) =\u003e {\n                    m.position.copyFrom(m.boid.position);\n                    m.setDirection(m.boid.orientation);\n                });\n            };\n        })(boidsManager, models)\n    };\n}\n```\n\nRemember to call the update function\n\n```js\n    // create a boid block with 20 boids\n    const myBoids = loadCubes(20, scene);\n\n    // Register a render loop to repeatedly render the scene\n    engine.runRenderLoop(() =\u003e {\n        const timeDiff = engine.getDeltaTime() / 1000.0;\n\n        // update boids\n        myBoids.update(timeDiff);\n\n        scene.render();\n    });\n```\n\n## API\n\n### `constructor(total, center, initialRadius = 1.0, boundRadiusScale = 100.0, initialVelocity = null)`\nConstructor. See [parameters](#Parameters) for class parameters that can be accessed and changed directly.\n\n`int total`: Total number of boids in simulation\n\n`BABYLON.vector3 center`: The center point of the boid volume.\n\n`float initialRadius`: The radius of the initial boid volume. Boids are distributed randomly within this volume from `center` when created.\n\n`float boundRadiusScale`: The bounding volume for the total simulation. Boids are restricted to this volume from `center`.\n\n`BABYLON.vector3 initialVelocity`: The inicial velocity for the boids. A small randomness factor is added to each boid.\n\n### `update(deltaTime)`\nUpdates the boids. Call on every render loop.\n\n`Number deltaTime` The time since last frame in seconds.\n\n### `addForce(c)`\nAdds a force callback function. This enables you to change the simulation with your own forces. Called fr\n\n`callback c` A valid JS function, called on `update()` for each boid. Receives as parameters: `(BoidsManager, Boid)`\n\n### `showDebug(scene)`\nTurns on debug visual helpers.\n\n`BABYLON.scene scene` The scene object.\n\n### `hideDebug(scene)`\nTurns off debug visual helpers.\n\n`BABYLON.scene scene` The scene object.\n\n### `gui(scene)`\nTurns on a panel to visually change the boid simulation parameters. \n\n`BABYLON.scene scene` The scene object.\n\n## Parameters\n\nAll accessed on the BoidsManager instance.\n\n`cohesion` Cohesion factor.\n\n`separation` Separation factor.\n\n`alignment` Alignment factor.\n\n`separationMinDistance` The\n\n`maxSpeed` The maximum allowed speed for a boid, in units per second.\n\n`boundsMin` The minimum bounds for the valid boid volume.\n\n`boundsMax` The maximum bounds for the valid boid volume.\n\n## LICENSE\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorollarium%2Fbabylon-boids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorollarium%2Fbabylon-boids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorollarium%2Fbabylon-boids/lists"}