-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.3] Add Jolt Physics as an alternative 3D physics engine #896
Draft
Spartan322
wants to merge
7
commits into
Redot-Engine:4.3
Choose a base branch
from
Spartan322:4.3-add/jolt-physics
base: 4.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+116,226
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spartan322
force-pushed
the
4.3-add/jolt-physics
branch
3 times, most recently
from
December 12, 2024 02:29
4beedc0
to
c437dd0
Compare
Ah, sorry Jorrit I didn't mean to ping you here, I forgot to strip the ping from the description and just make it a link, kinda too late now. |
Spartan322
force-pushed
the
4.3-add/jolt-physics
branch
from
December 15, 2024 16:03
4c84eba
to
da4621f
Compare
(cherry picked from commit 364f916)
(cherry picked from commit d470c2a) Co-authored-by: Jorrit Rouwe <[email protected]>
(cherry picked from commit 0ba875e)
(cherry picked from commit f6126ba)
Spartan322
force-pushed
the
4.3-add/jolt-physics
branch
from
December 29, 2024 20:57
e57fb17
to
dabf17a
Compare
Spartan322
added
the
tracked:godot
Issue already tracker on the godot issue tracker
label
Dec 31, 2024
Spartan322
force-pushed
the
4.3-add/jolt-physics
branch
from
January 4, 2025 06:01
dabf17a
to
882973e
Compare
(cherry picked from commit d6b822c)
Spartan322
force-pushed
the
4.3-add/jolt-physics
branch
from
January 8, 2025 14:17
fbfeb04
to
e167c47
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
topic:physics
topic:thirdparty
topic:3d
tracked:godot
Issue already tracker on the godot issue tracker
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original PR: godotengine/godot#99895
Also adds Memory aligned_static functions from godotengine/godot#90993
Cherry-picked PRs: godotengine/godot#100331, godotengine/godot#100342, godotengine/godot#100561, godotengine/godot#100983, godotengine/godot#101237
This pull request adds a new engine module (found under
modules/jolt_physics
) which integrates Jolt Physics, a 3D physics engine developed by Jorrit Rouwe (@jrouwe) with a focus on games and VR applications, used in titles such as Horizon Forbidden West.Users of this new module should (generally, but not always) be able to expect better physics performance, both in terms of CPU performance and simulation stability, when compared to Godot Physics.
This new module is a port of the Godot Jolt extension, developed by myself over the past two years, in large part as a personal project, but with the last year (including this port) being sponsored by W4 Games. I've also received a significant amount of assistance and contributions from @jrouwe during this development, which I'm very grateful for. In fact, several major features have been added to Jolt largely to cater to the needs of Godot.
Warning
Note that while this code has gone through a fair amount of battle-testing as part of the Godot Jolt extension there have been non-trivial refactorings done as part of this port that have not been tested much at all. As such, this module should be considered experimental for now. This module is also not at feature parity with Godot Physics just yet, nor at feature parity with the Godot Jolt extension either.
This does not replace Godot Physics as the default 3D physics engine. You will need to opt in by setting the
physics/3d/physics_engine
project setting toJolt Physics
.Notable differences to Godot Physics
See godotengine/godot#99895
Notable differences to Godot Jolt
See godotengine/godot#99895
Things left to do
Just to give people an idea about the state of this module, and perhaps encourage future contributions if/when this pull request is merged, here is a rough copy of my to-do list:
Must-have
Area3D
andSoftBody3D
.PhysicalBone3D
.Nice-to-have
dev_build
.jolt_body_accessor_3d.h
, in favor of just storing theJPH::Body*
inJoltObject3D
.JPH::PhysicsSystem::GetBodies
, to avoid the overhead of iterating over static/sleeping bodies.Jolt.natvis
file in MSVC builds for easier debugging.What about the extension?
If/when this pull request is merged, the Godot Jolt extension will officially be considered to be in maintenance mode going forward, with only bug fixes backported to it, but so long as this engine module doesn't have full feature parity with the extension there will be new releases of the extension to ensure that projects relying on its additional features can continue to function.
If/when this engine module reaches full feature parity with the extension then the extension will be discontinued and its GitHub repository archived.
Attribution
In the interest of not cluttering every file in this new module with the copyright notice of Godot Jolt, as required by its MIT license, consider this my permission to omit it entirely. I have obtained permission from the applicable copyright holders (@jrouwe) to do so as well.
(This port is based on godot-jolt/godot-jolt@8f1212e, meaning the latest commit of Godot Jolt as of writing this.)