{"id":15019026,"url":"https://github.com/megavr/ecsy-babylon","last_synced_at":"2026-02-07T01:07:26.335Z","repository":{"id":44049680,"uuid":"218417768","full_name":"megavr/ecsy-babylon","owner":"megavr","description":"babylon.js ecsy binding and helpers","archived":false,"fork":false,"pushed_at":"2022-07-20T16:55:50.000Z","size":1219,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-07-05T17:35:29.523Z","etag":null,"topics":["babylonjs","ecsy","typescript","webgl","webvr","webxr"],"latest_commit_sha":null,"homepage":null,"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/megavr.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":"2019-10-30T01:30:52.000Z","updated_at":"2022-09-21T00:22:33.000Z","dependencies_parsed_at":"2022-08-31T16:11:22.326Z","dependency_job_id":null,"html_url":"https://github.com/megavr/ecsy-babylon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/megavr/ecsy-babylon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megavr%2Fecsy-babylon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megavr%2Fecsy-babylon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megavr%2Fecsy-babylon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megavr%2Fecsy-babylon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megavr","download_url":"https://codeload.github.com/megavr/ecsy-babylon/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megavr%2Fecsy-babylon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443549,"owners_count":23766410,"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":["babylonjs","ecsy","typescript","webgl","webvr","webxr"],"created_at":"2024-09-24T19:52:47.467Z","updated_at":"2026-02-07T01:07:21.308Z","avatar_url":"https://github.com/megavr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecsy-babylon\nbabylon.js ecsy binding and helpers\n\n### Getting Started\n\n1. Add script tags of Babylon.js, ecsy and ecsy-babylon.\n2. Add a canvas tag as container.\n3. Build a basic scene.\n```javascript\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"https://unpkg.com/ecsy@0.2.1/build/ecsy.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/babylonjs@4.1.0-beta.18/babylon.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/@megavr/ecsy-babylon@0.0.10/dist/ecsy-babylon.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ccanvas id=\"renderCanvas\" style=\"width: 100%; height: 100%\"\u003e\u003c/canvas\u003e\n    \u003cscript\u003e\n      /** Step 1 - Preparation */\n      // create a ECSY world object\n      const world = new ECSY.World();\n      // register necessary systems from ecsy-babylon(global name: EB)\n      world\n        .registerSystem(EB.GameSystem)\n        .registerSystem(EB.TransformSystem)\n        .registerSystem(EB.CameraSystem)\n        .registerSystem(EB.MeshSystem)\n        .registerSystem(EB.InputSystem);\n      \n      /** Step 2 - Start the game engine */\n      // get canvas element\n      const canvas = document.getElementById(\"renderCanvas\");\n      // get GameSystem object\n      const game = world.getSystem(EB.GameSystem);\n      // start GameSystem by providing canvas object\n      game.start(canvas);\n      \n      /** Step 3 - Start to build your scene */\n      // add a scene\n      const scene = world.createEntity().addComponent(EB.Scene);\n      // add a camera\n      const camera = world.createEntity()\n        .addComponent(EB.Transform)\n        .addComponent(EB.Camera);\n      // up camera to height of eyes at standing human\n      camera.getMutableComponent(EB.Transform).position.y = 1.7;\n      // add a box\n      const box = world.createEntity()\n        .addComponent(EB.Transform)\n        .addComponent(EB.Mesh);\n      // put box in front of camera\n      box.getMutableComponent(EB.Transform).position.z = 3;\n      \n      /** Step 4 - Add some interaction to your scene */\n      // add keyboard input\n      world.createEntity().addComponent(EB.Input, { onKey: onKey });\n      // rotate box when press R/r key\n      function onKey(key, down) {\n        if (down) {\n          if (key === \"R\" || key === \"r\") {\n            box.getMutableComponent(EB.Transform).rotation.y += 30;\n          }\n        }\n      }\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Examples\nhttps://megavr.github.io/ecsy-babylon-examples/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegavr%2Fecsy-babylon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegavr%2Fecsy-babylon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegavr%2Fecsy-babylon/lists"}