Skip to content

Commit 77ae1b1

Browse files
committed
Initial commit
0 parents  commit 77ae1b1

35 files changed

Lines changed: 4193 additions & 0 deletions

.clang-format

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
StatementMacros: ['UPROPERTY', 'UFUNCTION', 'UCLASS', 'USTRUCT', 'UENUM', 'UINTERFACE', 'GENERATED_BODY']
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
5+
AccessModifierOffset: -4
6+
AlignAfterOpenBracket: DontAlign
7+
AlignConsecutiveDeclarations: true
8+
AlignEscapedNewlines: Left
9+
AlignOperands: DontAlign
10+
AlignTrailingComments: true
11+
AllowShortBlocksOnASingleLine: Empty
12+
AllowShortEnumsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: Inline
14+
AllowShortLambdasOnASingleLine: All
15+
BraceWrapping:
16+
AfterCaseLabel: true
17+
AfterClass: true
18+
AfterControlStatement: true
19+
AfterEnum: true
20+
AfterFunction: true
21+
AfterNamespace: true
22+
AfterObjCDeclaration: true
23+
AfterStruct: true
24+
AfterUnion: true
25+
AfterExternBlock: true
26+
BeforeCatch: true
27+
BeforeElse: true
28+
BeforeLambdaBody: false
29+
BeforeWhile: true
30+
IndentBraces: false
31+
BreakBeforeBinaryOperators: NonAssignment
32+
BreakBeforeBraces: Custom
33+
BreakInheritanceList: AfterColon
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializers: BeforeComma
36+
BreakStringLiterals: false
37+
ColumnLimit: 0
38+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
39+
Cpp11BracedListStyle: false
40+
EmptyLineBeforeAccessModifier: LogicalBlock
41+
IndentCaseBlocks: false
42+
IndentCaseLabels: true
43+
IndentPPDirectives: BeforeHash
44+
IndentWidth: 4
45+
NamespaceIndentation: All
46+
PointerAlignment: Left
47+
SortIncludes: false
48+
SpaceBeforeCaseColon: false
49+
TabWidth: 4
50+
UseTab: Always

.gitignore

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
Git files
2+
.git/
3+
4+
# Visual Studio 2015 user specific files
5+
.vs/
6+
7+
# Visual Studio 2015 database file
8+
*.VC.db
9+
10+
# Compiled Object files
11+
*.slo
12+
*.lo
13+
*.o
14+
*.obj
15+
16+
# Precompiled Headers
17+
*.gch
18+
*.pch
19+
20+
# Compiled Dynamic libraries
21+
*.so
22+
*.dylib
23+
*.dll
24+
25+
# Fortran module files
26+
*.mod
27+
28+
# Compiled Static libraries
29+
*.lai
30+
*.la
31+
*.a
32+
*.lib
33+
34+
# Executables
35+
*.exe
36+
*.out
37+
*.app
38+
*.ipa
39+
40+
# These project files can be generated by the engine
41+
*.xcodeproj
42+
*.xcworkspace
43+
*.sln
44+
*.suo
45+
*.opensdf
46+
*.sdf
47+
*.VC.db
48+
*.VC.opendb
49+
50+
# Precompiled Assets
51+
SourceArt/**/*.png
52+
SourceArt/**/*.tga
53+
54+
# Binary Files
55+
Binaries/**
56+
Plugins/*/Binaries/*
57+
58+
# Builds
59+
Build/*
60+
61+
# Whitelist PakBlacklist-<BuildConfiguration>.txt files
62+
!Build/*/
63+
Build/*/**
64+
!Build/*/PakBlacklist*.txt
65+
66+
# Don't ignore icon files in Build
67+
!Build/**/*.ico
68+
69+
# Built data for maps
70+
*_BuiltData.uasset
71+
72+
# Configuration files generated by the Editor
73+
Saved/*
74+
75+
# Compiled source files for the engine to use
76+
Intermediate/**
77+
Plugins/*/Intermediate/*
78+
79+
# Cache files for the editor to use
80+
DerivedDataCache/*
81+
82+
# Mac crap
83+
.DS_Store
84+
85+
# Un-Ignore All ThirdParty
86+
!Source/ThirdParty/**
87+
88+
# Ignore Export directory
89+
Export/**
90+
91+
# Ignore VS Code files
92+
.vscode/**
93+
94+
# Unignore .github folder
95+
!.github/**
96+
97+
# Unignore .gitignore
98+
!.gitignore
99+
100+
#ignore linux libs
101+
Source/ThirdParty/UnrealJoltLibrary/lib-*/**
102+

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Source/ThirdParty/UnrealJoltLibrary/JoltPhysics"]
2+
path = Source/ThirdParty/UnrealJoltLibrary/JoltPhysics
3+
url = git@github.com:jrouwe/JoltPhysics.git

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Yadhu-S
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# UnrealJolt
2+
3+
![Physics](Resources/Screenshots/play.gif)
4+
5+
Plugin that brings [Jolt Physics](https://github.com/jrouwe/JoltPhysics) into unreal engine 5
6+
7+
---
8+
9+
## Getting Started
10+
11+
### Some things to consider before using this
12+
13+
- This is a bolt on integration and not a replacement for the existing chaos physics solver.
14+
- You should only need this if you specifically want some kind of behaviour that's not available in chaos.
15+
- Deterministic physics, multicore processing of many bodies could make the case.
16+
- Multicore processing it not yet implemented properly using Unreal's own thread pool system.
17+
- The implementation of this plugin while is generic (somewhat), is still tied to something I am developing on the side. Just keep in mind that all features of UE might not be integrated, you might have to do it yourself. (Drop a PR if you do :) )
18+
- There are possibilities of breaking changes, until 1.0.0 at least. (will try to avoid)
19+
20+
### Requirements
21+
22+
- Unreal engine 5 (mostly tested on 5.6.0, should work on older versions)
23+
24+
### Installation
25+
26+
- Clone (`git clone --recursive git@github.com:Yadhu-S/UnrealJolt.git`) or download into the `Plugins` folder (`<project>/Plugins or Engine/Plugins`)
27+
- Take a look inside `UnrealJoltLibrary.Build.cs` to see the user defines, modify what you need, or leave defaults. Check the available defines [ here ]( https://jrouwe.github.io/JoltPhysicsDocs/5.3.0/md__build__r_e_a_d_m_e.html )
28+
- Compile project
29+
- Make sure UnrealJolt is enabled in "Plugins"
30+
- Use actor-tag and tag dynamic objects with `jolt-dynamic` (make sure that the object is movable) and static objects with `jolt-static`
31+
32+
### Configuration
33+
34+
![Config](Resources/Screenshots/SS_Config.png)
35+
36+
- Plugins->Jolt in your project settings.
37+
- Check the defaults, and change if required.
38+
- Debug rendering is slow, especially when visualizing large heightmaps. Drawing all those triangles. (Need to look into drawing triangles only once for
39+
static objects )
40+
41+
---
42+
43+
## Features
44+
45+
### UJoltSkeletalMeshComponent
46+
- UJoltSkeletalMeshComponent extends USkeletalMeshComponent to add jolt specific functionality (Browse JoltSkeletalMeshComponent.h to see the available functions)
47+
48+
### Heightmaps
49+
50+
![Landscape](Resources/Screenshots/SS_Landscape.png)
51+
52+
- **Landscapes** and **LandscapeSplines** are cooked automatically when you **Play in Editor**.
53+
- This may be a chore if you work with many levels, playing a level at least one time in editor (will work on it).
54+
- **Heightmaps must be cooked** in advance. They are not added dynamically like other physics bodies.
55+
- A `JoltData` directory is always generated during cooking and **must be included when packaging your project**.
56+
- #### ⚠️ Function for reading landscape spline data is not exposed by default in UE
57+
58+
#### ✅ Enabling Landscape Spline Cooking
59+
1. `Engine/Source/Runtime/Landscape/Classes/LandscapeSplineSegment.h`
60+
and add `LANDSCAPE_API` to the `GetLocalMeshComponents()` declaration to fix link errors
61+
2. In `UnrealJolt/Source/UnrealJolt/UnrealJolt.Build.cs`, uncomment:
62+
`PublicDefinitions.Add("JOLT_PLUGIN_LANDSCAPE_API_MODIFIED");`
63+
---
64+
## Deterministic simulation
65+
66+
To ensure deterministic simulation with Jolt Physics across platforms, follow the [official guidelines](https://jrouwe.github.io/JoltPhysicsDocs/5.3.0/index.html#deterministic-simulation). Use Jolt’s math and utility functions (`Sin`, `Cos`, `QuickSort`, `BinaryHeapPush/Pop`, `Hash`) instead of STL or platform-dependent ones, and always keep API calls (body/constraint creation, updates) in the same order.
67+
68+
For builds:
69+
70+
- On **Windows (MSVC)**, add `FPSemantics = FPSemanticsMode.Precise;` to `<ProjectName>Target.cs` and `<ProjectName>Editor.Target.cs`.
71+
- On **Linux (Clang/GCC)**, add `AdditionalCompilerArguments += " -ffp-model=precise -ffp-contract=off";` to the same files.
72+
73+
Because these options differ from Unreal defaults (`LinuxToolChain.cs`, `VCToolChain.cs`), create a custom build config or apply the changes consistently across both game and editor builds by modifying:
74+
`UnrealClient.Target.cs`, `UnrealEditor.Target.cs`, `UnrealGame.Target.cs`, and `UnrealServer.Target.cs`.
75+
76+
---
77+
78+
## Contributing
79+
80+
Found this project useful? Awesome!
81+
82+
If you’ve added a feature, fixed a bug, or improved something that isn’t here yet—feel free to open a PR!
83+
84+
---
85+
## Credits
86+
- [Jorrit Rouwe](https://github.com/jrouwe) for making jolt
87+
- Andrea Catania for the video series on YouTube

Resources/Icon128.png

13.7 KB
Loading
96.6 KB
Loading
898 KB
Loading

Resources/Screenshots/play.gif

831 KB
Loading
Submodule JoltPhysics added at 0373ec0

0 commit comments

Comments
 (0)