Skip to content
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

Jolt Physics integration #263

Merged
merged 92 commits into from
Nov 13, 2024
Merged

Jolt Physics integration #263

merged 92 commits into from
Nov 13, 2024

Conversation

afritz1
Copy link
Owner

@afritz1 afritz1 commented Nov 13, 2024

Jolt colliders are now being used for all objects in the world. Movement is currently clumsy and unstable, but it's a big improvement from pre-Jolt times because it's like an actual game now. Debug rendering is implemented in F4.

Next objectives:

  1. Sensors for level transitions and sound/text triggers
  2. Improved movement on ground. Currently very jumpy and slippery
  3. Movement sounds on land and in water
  4. Chasm climbing

Tested on Windows, macOS, Debian, and Raspberry Pi and they all work. There do appear to be slight differences depending on math optimizations, but after adding a couple tiny epsilons like for jumping, that helped.

afritz1 added 30 commits August 9, 2024 19:07
Updated build from source section for Jolt Physics.
This isn't going to work for all platforms, need to find a more generic way. Also need a way to turn off interprocedural optimizations for Debug and ReleaseGenericNoLTO builds.
The Jolt HelloWorld project says to use FetchContent.
It's downloaded through CMake FetchContent now.
This lets them compile with Jolt instead of having MD_DynamicRelease errors.
Added Git to third-party tools since CMakeLists.txt is using FetchContent now which does a git clone behind the scenes.
Updated the git submodule part to just be about vector instructions.
Moved around music installation so people try it before running the engine.
Figuring out as I go. Unfortunately it seems like I'll need to allow like 100k bodies to be instantiated which is a lot. Will need to prioritize mesh combining sooner than later.
Won't need this forever, just until mesh combining is figured out.
Crossing a chunk boundary is very expensive since I'm doing Add/RemoveBody() the naive way.
Currently at the origin, need to drive it around with game logic.
Fixes DebugRenderer init.
Tied to the gameplay side of voxels and entities. Jolt uses them to instantiate its own bodies.
Eventually want to remove CollisionMeshDefinition since physics engines prefer working with simple shapes.
Trying to put Jolt as the main one. Not sure the setPhysicsPosition() is correct everywhere now, might be half a height too high.
Now have a decent moving and jumping player that seems to not launch 500 feet in the air when jumping into a wall.
Allows for modding things like sunset time, etc..
So Visual Studio actually shows them in the tooltip.
Getting rid of this unused 7+ year old code and redoing with definitions and instances.
Will use actual player inventory eventually.
To be used for any inventories in the game (player, corpses, containers, ...).
Makes them more like a monkey now which isn't ideal but maybe helps with testing. Somehow need walls to not be considered steep ground. Maybe have to weld 2nd/3rd/4th floors together because Jolt thinks there's a "ground" face between them?
@afritz1 afritz1 added this to the 0.16.0 milestone Nov 13, 2024
@afritz1 afritz1 merged commit 67c3259 into main Nov 13, 2024
1 check passed
@afritz1 afritz1 deleted the jolt-integration branch November 13, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant