{"id":13528869,"url":"https://github.com/armory3d/haxebullet","last_synced_at":"2025-07-16T01:35:14.682Z","repository":{"id":27137273,"uuid":"30605921","full_name":"armory3d/haxebullet","owner":"armory3d","description":"Bullet 3D Physics for Haxe","archived":false,"fork":false,"pushed_at":"2023-07-26T18:03:27.000Z","size":8712,"stargazers_count":93,"open_issues_count":1,"forks_count":21,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-09T04:40:54.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bulletphysics.org","language":"C++","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/armory3d.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}},"created_at":"2015-02-10T18:00:15.000Z","updated_at":"2025-04-29T04:57:56.000Z","dependencies_parsed_at":"2024-01-03T03:53:57.340Z","dependency_job_id":"3e5ab39c-2ca9-43ea-a946-896547e3c73d","html_url":"https://github.com/armory3d/haxebullet","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/armory3d/haxebullet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armory3d%2Fhaxebullet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armory3d%2Fhaxebullet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armory3d%2Fhaxebullet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armory3d%2Fhaxebullet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armory3d","download_url":"https://codeload.github.com/armory3d/haxebullet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armory3d%2Fhaxebullet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265474102,"owners_count":23772258,"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-08-01T07:00:26.752Z","updated_at":"2025-07-16T01:35:14.635Z","avatar_url":"https://github.com/armory3d.png","language":"C++","funding_links":[],"categories":["Physics","Libraries"],"sub_categories":["Haxe"],"readme":"# haxebullet\n\n[Bullet 3D Physics](http://bulletphysics.org/) bindings for Haxe.\n\nBased on the webidl approach, works for HL/C \u0026 JS:\n- https://github.com/ncannasse/webidl\n- https://github.com/HeapsIO/bullet\n- https://github.com/bulletphysics/bullet3\n- https://github.com/kripken/ammo.js\n\n## Usage\n\n[Reference](http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World)\n\nIn order to get HL/C build to work you need to add `haxebullet/bullet` and `haxebullet/hl` directories into your build process so the compiler is able to find bullet sources.\n\nIn order to get JS build to work you need to add `haxebullet/ammo/ammo.js` script either by embedding or including it with a script tag.\n\n``` hx\nvar collisionConfiguration = new bullet.Bt.DefaultCollisionConfiguration();\nvar dispatcher = new bullet.Bt.CollisionDispatcher(collisionConfiguration);\nvar broadphase = new bullet.Bt.DbvtBroadphase();\nvar solver = new bullet.Bt.SequentialImpulseConstraintSolver();\nvar dynamicsWorld = new bullet.Bt.DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);\n\nvar groundShape = new bullet.Bt.StaticPlaneShape(new bullet.Bt.Vector3(0, 1, 0), 1);\nvar groundTransform = new bullet.Bt.Transform();\ngroundTransform.setIdentity();\ngroundTransform.setOrigin(new bullet.Bt.Vector3(0, -1, 0));\nvar centerOfMassOffsetTransform = new bullet.Bt.Transform();\ncenterOfMassOffsetTransform.setIdentity();\nvar groundMotionState = new bullet.Bt.DefaultMotionState(groundTransform, centerOfMassOffsetTransform);\n\nvar groundRigidBodyCI = new bullet.Bt.RigidBodyConstructionInfo(0.01, groundMotionState, cast groundShape, new bullet.Bt.Vector3(0, 0, 0));\nvar groundRigidBody = new bullet.Bt.RigidBody(groundRigidBodyCI);\ndynamicsWorld.addRigidBody(groundRigidBody);\n\nvar fallShape = new bullet.Bt.SphereShape(1);\nvar fallTransform = new bullet.Bt.Transform();\nfallTransform.setIdentity();\nfallTransform.setOrigin(new bullet.Bt.Vector3(0, 50, 0));\nvar centerOfMassOffsetFallTransform = new bullet.Bt.Transform();\ncenterOfMassOffsetFallTransform.setIdentity();\nvar fallMotionState = new bullet.Bt.DefaultMotionState(fallTransform, centerOfMassOffsetFallTransform);\n\nvar fallInertia = new bullet.Bt.Vector3(0, 0, 0);\n// fallShape.calculateLocalInertia(1, fallInertia);\nvar fallRigidBodyCI = new bullet.Bt.RigidBodyConstructionInfo(1, fallMotionState, fallShape, fallInertia);\nvar fallRigidBody = new bullet.Bt.RigidBody(fallRigidBodyCI);\ndynamicsWorld.addRigidBody(fallRigidBody);\n\nfor (i in 0...3000) {\n\tdynamicsWorld.stepSimulation(1 / 60);\n\t\n\tvar trans = new bullet.Bt.Transform();\n\tvar m = fallRigidBody.getMotionState();\n\tm.getWorldTransform(trans);\n\ttrace(trans.getOrigin().y());\n\ttrans.delete();\n}\n\n// ...delete();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmory3d%2Fhaxebullet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmory3d%2Fhaxebullet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmory3d%2Fhaxebullet/lists"}