{"id":23076728,"url":"https://github.com/antzgames/gdx-ode4j","last_synced_at":"2025-08-15T18:32:53.755Z","repository":{"id":181386335,"uuid":"666683321","full_name":"antzGames/gdx-ode4j","owner":"antzGames","description":"libGDX ODE4J library - GWT compatible","archived":false,"fork":false,"pushed_at":"2024-08-18T04:55:03.000Z","size":1536,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-18T05:39:25.171Z","etag":null,"topics":["3d","libgdx","library","physics-engine"],"latest_commit_sha":null,"homepage":"https://antzgames.itch.io/physics-in-a-browser","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antzGames.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T08:16:11.000Z","updated_at":"2024-08-18T04:55:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8145a2f-73d0-4ca1-87b3-30d42b07a7a9","html_url":"https://github.com/antzGames/gdx-ode4j","commit_stats":null,"previous_names":["antzgames/gdx-ode4j"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antzGames%2Fgdx-ode4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antzGames%2Fgdx-ode4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antzGames%2Fgdx-ode4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antzGames%2Fgdx-ode4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antzGames","download_url":"https://codeload.github.com/antzGames/gdx-ode4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229941525,"owners_count":18148294,"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":["3d","libgdx","library","physics-engine"],"created_at":"2024-12-16T09:56:48.884Z","updated_at":"2024-12-16T09:56:49.687Z","avatar_url":"https://github.com/antzGames.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/antzGames/gdx-ode4j.svg)](https://jitpack.io/#antzGames/gdx-ode4j)\n\n# libGDX Open Dynamics Engine (ODE4J) - physics engine LIBRARY\n\n![image](https://github.com/antzGames/gdx-ode4j/assets/10563814/c59c282d-9198-4066-81b7-0de4e5808f64)\n\nThis is a ODE4J library compatible with all libGDX backends, including GWT.  It is based on\nversion 0.4.1 of [Open Dynamics Engine for Java](https://github.com/tzaeschke/ode4j).\n\nVersion ODE4J 0.5.3 (also GWT compatible) can be found here: [https://github.com/antzGames/ode4j](https://github.com/antzGames/ode4j)\n\nIf you want to use ODE4J only on libGDX Desktop/Android/iOS backends then I recommend you use [odej4](https://github.com/tzaeschke/ode4j) directly.  \nHowever if you want cross platform support (i.e include GWT support) then you need to use this library.\n\nCurrently this is the only 3D physics engine option for GWT on libGDX.\n\n## How to use in your project\n\nAdd the dependency in your core project:\n\n```gradle\nproject(\":core\") {\n    ...\n\n    dependencies {\n        ...\n          api \"com.github.antzGames:gdx-ode4j:master-SNAPSHOT\"\n    }\n}\n```\n\nIf you are targeting HTML (GWT) you will also need the following:\n\n```gradle\nproject(\":html\") {\n    ...\n    dependencies {\n        ...\n        implementation \"com.github.antzGames:gdx-ode4j:master-SNAPSHOT:sources\"\n        implementation \"com.github.tommyettinger:formic:0.1.4:sources\"\n    }\n}\n```\n\nand lastly add this to your `GdxDefinition.gwt.xml` file:\n\n```xml\n\u003cmodule\u003e\n    ...\n    \u003cinherits name=\"gdx_ode4j\" /\u003e\n    \u003cinherits name=\"formic\" /\u003e\n    ...\n\u003c/module\u003e\n```\n\n## Runtime examples\n\nSome examples can be found in my [gdx-ode4j-examples](https://github.com/antzGames/gdx-ode4j-examples) repository.\n\nOr play with them on [itch.io](https://antzgames.itch.io/physics-in-a-browser).\n\nhttps://github.com/antzGames/gdx-ode4j/assets/10563814/bc46a9a9-f2e8-414b-bfde-8be6ea54e46b\n\n## Math classes\n\nOde4j has its own math classes similar to libGDX's Vector3, Matrix3, Matrix4, and Quaternion.\n\nI added a math utility class called [Ode2GDXMathUtils](https://github.com/antzGames/gdx-ode4j/blob/master/src/main/java/com/github/antzGames/gdx/ode4j/Ode2GdxMathUtils.java).  Use the following methods to create the libGDX Quaternion from ode4j's QuanternionC or DMatrix3C:\n\n```java\n    Quaternion q1 = Ode2GdxMathUtils.getGdxQuaternion(odeQuaternion);  \n    Quaternion q2 = Ode2GdxMathUtils.getGdxQuaternion(odeMat3);\n```\n\nIn addition ode4j uses double and not float like most of libGDX's math classes.\n\n## Limitations\n\n### Fixed timesteps\n\nODE was made to work with fixed timesteps.  Do not pass `Gdx.graphics.getDeltaTime()` to `world.quickStep()`.\n\nThe following online [ODE HOWTO entry](https://ode.org/wiki/index.php/HOWTO_fixed_vs_variable_timestep) discusses how to incorporate this limitation into a game.\n\nUsing `vsync=true` in your game launch configuration helps, but some people might run at 60hz, while others might run at 50Hz, 75Hz, 144Hz.\nThis means that objects will fall/interact at different speeds on these different refresh rates.\n\nBelow is example code that you can use to force physics to only update at a fixed interval (timestep).\n\n```java\npublic static final float MIN_FRAME_LENGTH = 1f/60f;\n        ...\n\n@Override\npublic void render(float deltaTime){\n        timeSinceLastRender += deltaTime;\n\n        // Only compute 60Hz for physics\n        if (timeSinceLastRender \u003e= MIN_FRAME_LENGTH) {\n            odePhysicsSystem.update(MIN_FRAME_LENGTH);   // My custom class, which eventaully calls world.quickStep(MIN_FRAME_LENGTH)\n            timeSinceLastRender -= MIN_FRAME_LENGTH;\n\n            if(timeSinceLastRender \u003e MIN_FRAME_LENGTH)\n                timeSinceLastRender = 0;\n        }\n\n        ...\n}\n```\n\n### Performance\n\nI have tried jBullet, PhysX and ODE physics engines with libGDX.  ODE is the slowest, and the reason being is that in ODE everything is using double precision.\n\n### Known Issues\n\nODE4J 0.4.2 has some Triangle Mesh (TriMesh) collision detection issues.\n\nThe owner of ODE4J has fixed them in ODE4J 0.5.0.\n\nList of fixes/changes between 0.4.2 and 0.5.3 can be found [here](https://github.com/tzaeschke/ode4j/blob/master/CHANGELOG.md).\n\nVersion ODE4J 0.5.3 can be found here: [https://github.com/antzGames/ode4j](https://github.com/antzGames/ode4j)\n\n## Where to get ODE/ode4j documentation and help\n\nODE official manual: http://ode.org/wiki/index.php/Manual\n\nBy far the most useful part is the [HOWTO](http://ode.org/wiki/index.php/HOWTO) section\n\node4j discord channel : https://discord.gg/UFXJcXv2P8 ode4j/Java\n\node4j contains also some features that are not present in ODE, such as a ragdoll and heightfields with holes. See ode4j's [Wiki](https://github.com/tzaeschke/ode4j/wiki/Functionality-beyond-ODE).\n\nThe [ODE forum](https://groups.google.com/forum/#!forum/ode-users) is useful for questions around physics and general API usage.\n\nThe [ode4j forum](https://groups.google.com/forum/?hl=en#!forum/ode4j) is for problems and functionality specific to ode4j/Java.\n\nThere is also the [old website](https://tzaeschke.github.io/ode4j-old/), including some [screenshots](https://tzaeschke.github.io/ode4j-old/ode4j-features.html).\n\nHere is a [Youtube video](https://www.youtube.com/watch?v=ENlpu_Jjp3Q) of a list of games that used ODE from 2002-2015.  You will be suprised how many of your favorite games used this physcis libary.\n\n## Versions\n\nODE4J `v0.4.1` and `v0.5.3` have been ported.  Both are GWT compatible.  \n\nVersion v0.4.1 GitHub repo: [https://github.com/antzGames/gdx-ode4j](https://github.com/antzGames/gdx-ode4j)\n\nVersion v0.5.3 GitHub repo: [https://github.com/antzGames/ode4j](https://github.com/antzGames/ode4j)\n\n## Where has ODE4J libGDX version been used?\n\nHere are some games and projects and tutorials that have used v0.4.1 of ODE4J for libGDX:\n\n[https://github.com/MonstrousSoftware/VehicleTest](https://github.com/MonstrousSoftware/VehicleTest)\n\n[https://monstrous-software.itch.io/base-invaders](https://monstrous-software.itch.io/base-invaders)\n\n[https://monstrous-software.itch.io/fps-demo](https://monstrous-software.itch.io/fps-demo)\n\n[https://antzgames.itch.io/physics-in-a-browser](https://antzgames.itch.io/physics-in-a-browser)\n\n[https://antzgames.itch.io/shotgun-wedding](https://antzgames.itch.io/shotgun-wedding)\n\n[https://antzgames.itch.io/tank-vs-dinos](https://antzgames.itch.io/tank-vs-dinos)\n\n## 3D FPS Tutorial using ODE4J\n\nA full blown tutorial on making a libGDX FPS game using ODE4J can be found here:\n\n[Tutorial on creating a 3D game with LibGDX](https://monstroussoftware.github.io/2023/11/01/Tutorial-3D-step1.html)\n\n## ODE, ode4j and other Licenses\n\n### Licensing \u0026 Copyright for ODE and ode4j\n\nThis library is under copyright by Tilmann Zäschke (Java port), Russell L. Smith (copyright holder of the original ODE code), Francisco Leon (copyright holder of the original GIMPACT code) and Daniel Fiser (copyright holder of the original libccd).\n\nThis library is free software; you can redistribute it and/or modify it under the terms of EITHER:\n(1) The GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The text of the GNU Lesser General Public License is included with this library in the file LICENSE.TXT.\n(2) The BSD-style license that is included with this library in the files ODE-LICENSE-BSD.TXT and ODE4j-LICENSE-BSD.TXT.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files LICENSE.TXT, ODE-LICENSE-BSD.TXT, GIMPACT-LICENSE-BSD.TXT, GIMPACT-LICENSE-LGPL.TXT, ODE4J-LICENSE-BSD.TXT and LIBCCD_BSD-LICENSE for more details.\n\nThe LICENSE.TXT, ODE-LICENSE-BSD.TXT, GIMPACT-LICENSE-BSD.TXT, GIMPACT-LICENSE-LGPL.TXT, LIBCCD_BSD-LICENSE and ODE4J-LICENSE-BSD.TXT files are available in the source code.\n\n## Legal\n\node4j:\nCopyright (c) 2009-2017 Tilmann Zäschke ode4j@gmx.de.\nAll rights reserved.\n\nLike the original ODE, ode4j is licensed under LGPL v2.1 and BSD 3-clause. Choose whichever license suits your needs.\n\n### ode4j contains Java ports of the following software\n\n[ODE/OpenDE](http://www.ode.org/):\nCopyright  (c) 2001,2002 Russell L. Smith\nAll rights reserved.\n\nGIMPACT (part of ODE/OpenDE):\nCopyright of GIMPACT (c) 2006 Francisco Leon. C.C. 80087371.\nemail: projectileman(AT)yahoo.com\n\n[LIBCCD](https://github.com/danfis/libccd):\nCopyright (c) 2010 Daniel Fiser \u003cdanfis(AT)danfis.cz\u003e;\n3-clause BSD License\n\n[Turbulenz Engine](https://github.com/turbulenz/turbulenz_engine):\nCopyright (c) 2009-2014 Turbulenz Limited; MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantzgames%2Fgdx-ode4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantzgames%2Fgdx-ode4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantzgames%2Fgdx-ode4j/lists"}