From 80e1c994227beefa72badc089027f7bb7c5f6a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bagel=E2=84=A2?= Date: Mon, 5 Sep 2022 05:08:27 -0400 Subject: [PATCH 1/5] Volt build documentation --- README.md | 6 ++- build.md | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 build.md diff --git a/README.md b/README.md index 7976931..22f6cac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![VPhysics Jolt Logo](assets/cube_base_nobg.png "VPhysics Jolt") -## What is Volt? ⚑ +# What is Volt? ⚑ Volt (VPhysics Jolt) is a replacement for Source's VPhysics which uses IVP/Havok
Created by [Joshua Ashton (🐸✨)](https://github.com/Joshua-Ashton) [@phys_ballsocket](https://twitter.com/phys_ballsocket) and [Josh Dowell (Slartibarty)](https://github.com/Slartibarty) [@Slartbarty](https://twitter.com/Slartbarty). @@ -59,6 +59,8 @@ Volt should build fine against Source SDK 2013 and Alien Swarm SDK on a MSVC or Unfortunately we cannot redistribute the additional code/headers needed to build Volt for games such as Garry's Mod which uses a different VPhysics interface (CS:GO's) to what is found in the Valve-provided public SDKs. +For full build instructions pertaining to SDK 2013, refernce [build.md](/build.md). + ## Download Development builds for each commit for SDK2013 SP/MP + ASW are available as artifacts on each commit on GitHub through GitHub Actions.
@@ -77,7 +79,7 @@ For each release, binary builds are provided for Garry's Mod and Source SDK 2013 ### Lots of Balls Test [![Lots of Balls Test](https://img.youtube.com/vi/tYfiTyRtmz8/0.jpg)](https://www.youtube.com/watch?v=tYfiTyRtmz8 "Lots of Balls Test") -### Wheels + Weld Car Dupe Test +### Wheels + Weld Car Dupe Test [![Weld Car Dupe Test](https://img.youtube.com/vi/5_QbbXbIrg8/0.jpg)](https://www.youtube.com/watch?v=5_QbbXbIrg8 "Weld Car Dupe Test") ### Door + NPC (Physics Shadowed Objects) Test diff --git a/build.md b/build.md new file mode 100644 index 0000000..fe5513d --- /dev/null +++ b/build.md @@ -0,0 +1,145 @@ +# Building Volt + +###### Note: This repository can be built with the default SDK but will not be outlined in this guide. +###### Note: x64 platform builds will also not be outlined in this guide. + +All build instructions start the same. Clone a local copy of [mini-source-sdk](https://github.com/Joshua-Ashton/mini-source-sdk). (A minified version of [Source SDK](https://github.com/ValveSoftware/source-sdk-2013) with support for VS 2022) +```bash +git clone https://github.com/Joshua-Ashton/mini-source-sdk.git +``` + +Following your clone of the mini-source-sdk, navigate to the "version" you would like to build (`sdk2013-mp`, `sdk2013-sp`, `asw`). As an example, the multiplayer version will be used from now on. +```bash +cd mini-source-sdk/sdk2013-mp/src/ +``` + +At this time you should now recursively git clone the VPhysics-Jolt repository into your "src" directory. +```bash +git clone https://github.com/Joshua-Ashton/VPhysics-Jolt.git vphysics_jolt --recursive +``` + +From this point onward, please follow the rest of the guide specific to your chosen build platform. The current working directory is also assumed to be `mini-source-sdk/sdk2013-mp/src/` and should be adjusted to suit your own build if need be. + +## Windows + +### CLI + +Continuing on windows, the next step is to the registry fix script (as administrator). This can be done by right-clicking the `fix_registry.bat` file located in `mini-source-sdk/sdk2013-mp/src/`. If your command prompt or powershell instance are already running under administrator just run the following: +```bash +.\fix_registry.bat +``` + +This final command to run before the CLI portion of this guide ends. It will generate your [Visual Studio](https://visualstudio.microsoft.com/vs/) project/solution file(s). (You may also just double-click the file `createjoltprojects.bat`) +```bash +.\createjoltprojects.bat +``` + +### Visual Studio + +After running `createjoltprojects.bat` you should now have a file named `jolt.sln`. Open it. After opening building may be as simple as pressing the shortcut `Ctrl+Shift+B` or right-clicking `Solution 'jolt'` bar in the Solution explorer window and pressing `Build Solution` + +Congratulations! + +The built `vphysics_jolt.dll` file should now be located in `mini-source-sdk/sdk2013-mp/game/bin/`. + +### Build errors + +Common build errors you may run into building on windows and their solutions. + +> #### memoverride.cpp + +If there is an error about involving a symbol named ` size_t _msize` or `size_t __cdecl _msize_base` try removing or commenting out definitions of both. You should leave only the code below: +```cpp +size_t msize( void *pMem ) +{ + return g_pMemAlloc->GetSize(pMem); +} +``` + +Where the code to be removed/commented would be: +```cpp +size_t __cdecl _msize_base( void *pMem ) noexcept +{ + return g_pMemAlloc->GetSize(pMem); +} + +size_t _msize( void *pMem ) +{ + return _msize_base(pMem); +} +``` + +###### It may be wise to try different variations if the given solution does not work. + +## Linux + +Continuing on linux, there are a few prerequisites to building regardless of distrobution. +- glibc v2.29+ +- gcc v8+ +- g++ v8+ +- gcc-multilib +- g++-multilib +- make + +###### Note: Attempts to compile with older versions of glibc are undocumented and probably will not work (you are still welcome to confirm this) + +### Debian/Ubuntu +###### Note: Some older versions of debian or debian-based distrobutions (i.e. ubuntu) may use `apt-get` +###### Note: Older versions may also require version explicit packages if available. + +Before we continue building project files, lets get our dependencies out of the way. +Install the `build-essential` group to get common developer packages such as gcc, g++, and make, which are included. +```bash +sudo apt install build-essential +``` + +After installing the build-essential group packages, we now need to install the x86 dependencies. +```bash +sudo apt install gcc-multilib g++-multilib +``` + +The next step is to build our makefiles by running the premade script `createjoltprojects.sh` +```bash +./createjoltprojects.sh +``` + +Once the script has finished running you should now have a file name `jolt.mak` in the current directory. Verify you do and now run it with the command below. This command automatically will (and is recommended to) use all available CPU threads. If you want to specify it yourself, replace `` `nproc` `` with a number less than or equal to your max number of threads. To be clear, this only affects speed. +```bash +make -j `nproc` -f jolt.mak +``` + +Alternative example... +```bash +make -j 8 -f jolt.mak +``` + +Congratulations! + +If the console output `LINKING` AND `COPYING TO` messages, that means your build was successful and you may retrieve your `vphysics_jolt.so` and `vphysics_jolt_srv.so` files which will be located in `mini-source-sdk/sdk2013-mp/game/bin/`. + +### Build errors (distrobution independent) + +Common build errors you may run into building on linux and their solutions. + +> #### error: unrecognized command line option β€˜-std=gnu++20’; did you mean β€˜-std=gnu++2a’? (make: *** [jolt.mak:28: all] Error 2) + +This error may come up between different versions of g++, the easist way to fix this is to edit `devtools/makefile_base_posix.mak` at approximately `line 47` and change `-std=gnu++20` to `-std=gnu++2a`. + +The full change should like similar to this. Starting as: +```makefile +CXXFLAGS = $(CFLAGS) $(WARN_CXX_FLAGS) -std=gnu++20 -Wno-narrowing -Wno-register -Wno-deprecated-enum-enum-c onversion -Wno-deprecated-declarations -fpermissive -Wno-volatile -Wno-ignored-attributes -I/usr/include/freetype2 +``` +Changing to: +```makefile +CXXFLAGS = $(CFLAGS) $(WARN_CXX_FLAGS) -std=gnu++2a -Wno-narrowing -Wno-register -Wno-deprecated-enum-enum-c onversion -Wno-deprecated-declarations -fpermissive -Wno-volatile -Wno-ignored-attributes -I/usr/include/freetype2 +``` +
+ +> #### Other obscure compile error + +Try upgrading your gcc/g++ toolset to a higher version if possible. + +## OSX +Unsupported. + +Β―\\\_(ツ)\_/Β― From 9b2b4660ef6fc166aeca0b6871cde991cd1367e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bagel=E2=84=A2?= Date: Mon, 5 Sep 2022 05:26:32 -0400 Subject: [PATCH 2/5] Update build.md --- build.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.md b/build.md index fe5513d..7ea31ab 100644 --- a/build.md +++ b/build.md @@ -103,7 +103,7 @@ The next step is to build our makefiles by running the premade script `createjol ./createjoltprojects.sh ``` -Once the script has finished running you should now have a file name `jolt.mak` in the current directory. Verify you do and now run it with the command below. This command automatically will (and is recommended to) use all available CPU threads. If you want to specify it yourself, replace `` `nproc` `` with a number less than or equal to your max number of threads. To be clear, this only affects speed. +Once the script has finished running you should now have a file name `jolt.mak` in the current directory. Verify you do and now run it with the command below. This command automatically will (and is recommended to) use all available CPU threads. If you want to specify it yourself, replace `` `nproc` `` with a number less than or equal to your max number of threads. To be clear, this only affects compile speed. ```bash make -j `nproc` -f jolt.mak ``` @@ -115,7 +115,7 @@ make -j 8 -f jolt.mak Congratulations! -If the console output `LINKING` AND `COPYING TO` messages, that means your build was successful and you may retrieve your `vphysics_jolt.so` and `vphysics_jolt_srv.so` files which will be located in `mini-source-sdk/sdk2013-mp/game/bin/`. +If the console outputs `LINKING` *and* `COPYING TO` messages, that means your build was successful and you may retrieve your `vphysics_jolt.so` and `vphysics_jolt_srv.so` files which will be located in `mini-source-sdk/sdk2013-mp/game/bin/`. ### Build errors (distrobution independent) @@ -125,7 +125,7 @@ Common build errors you may run into building on linux and their solutions. This error may come up between different versions of g++, the easist way to fix this is to edit `devtools/makefile_base_posix.mak` at approximately `line 47` and change `-std=gnu++20` to `-std=gnu++2a`. -The full change should like similar to this. Starting as: +The full change should look similar to this. Starting as: ```makefile CXXFLAGS = $(CFLAGS) $(WARN_CXX_FLAGS) -std=gnu++20 -Wno-narrowing -Wno-register -Wno-deprecated-enum-enum-c onversion -Wno-deprecated-declarations -fpermissive -Wno-volatile -Wno-ignored-attributes -I/usr/include/freetype2 ``` From 6103fc5cbceff60680eea6ca45b93ee86667bce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bagel=E2=84=A2?= Date: Thu, 8 Sep 2022 06:28:44 -0400 Subject: [PATCH 3/5] Implement the interface PerformanceSettings --- vphysics_jolt/vjolt_environment.cpp | 66 +++++++++++++++++++++++++++++ vphysics_jolt/vjolt_environment.h | 13 ++++++ 2 files changed, 79 insertions(+) diff --git a/vphysics_jolt/vjolt_environment.cpp b/vphysics_jolt/vjolt_environment.cpp index a1f7da3..f472d8e 100644 --- a/vphysics_jolt/vjolt_environment.cpp +++ b/vphysics_jolt/vjolt_environment.cpp @@ -314,6 +314,8 @@ IPhysicsObject *JoltPhysicsEnvironment::CreatePolyObject( const CPhysCollide *pC settings.mMassPropertiesOverride.mMass = params.mass; //settings.mMassPropertiesOverride.mInertia = JPH::Mat44::sIdentity() * params.inertia; settings.mOverrideMassProperties = JPH::EOverrideMassProperties::CalculateInertia; // JPH::EOverrideMassProperties::MassAndInertiaProvided; + settings.mMaxLinearVelocity = MaxVelocity(); + settings.mMaxAngularVelocity = MaxAngularVelocity(); if ( m_bUseLinearCast ) settings.mMotionQuality = JPH::EMotionQuality::LinearCast; @@ -362,6 +364,8 @@ IPhysicsObject *JoltPhysicsEnvironment::CreateSphereObject( float radius, int ma settings.mMassPropertiesOverride.mMass = params.mass; //settings.mMassPropertiesOverride.mInertia = JPH::Mat44::sIdentity() * params.inertia; settings.mOverrideMassProperties = JPH::EOverrideMassProperties::CalculateInertia;//JPH::EOverrideMassProperties::MassAndInertiaProvided; + settings.mMaxLinearVelocity = MaxVelocity(); + settings.mMaxAngularVelocity = MaxAngularVelocity(); } JPH::BodyInterface &bodyInterface = m_PhysicsSystem.GetBodyInterfaceNoLock(); @@ -1177,11 +1181,73 @@ void JoltPhysicsEnvironment::SweepCollideable( const CPhysCollide *pCollide, con void JoltPhysicsEnvironment::GetPerformanceSettings( physics_performanceparams_t *pOutput ) const { Log_Stub( LOG_VJolt ); + + *pOutput = m_PhysicsPerformanceParams; } void JoltPhysicsEnvironment::SetPerformanceSettings( const physics_performanceparams_t *pSettings ) { Log_Stub( LOG_VJolt ); + + m_PhysicsPerformanceParams = *pSettings; + + m_PhysicsSystem.GetBodies(m_CachedBodies); + + for ( auto& id : m_CachedBodies ) + { + JPH::Body* pBody = m_PhysicsSystem.GetBodyLockInterfaceNoLock().TryGetBody( id ); + + if ( pBody ) + { + JPH::MotionProperties* pMotionProperties = pBody->GetMotionProperties(); + + if ( pMotionProperties ) + { + pMotionProperties->SetMaxLinearVelocity( pSettings->maxVelocity ); + pMotionProperties->SetMaxAngularVelocity( pSettings->maxAngularVelocity * M_PI_F / 180 ); + } + } + } +} + +inline int JoltPhysicsEnvironment::MaxCollisionsPerObjectPerTimestep() const +{ + return m_PhysicsPerformanceParams.maxCollisionsPerObjectPerTimestep; +} + +inline int JoltPhysicsEnvironment::MaxCollisionChecksPerTimestep() const +{ + return m_PhysicsPerformanceParams.maxCollisionChecksPerTimestep; +} + +inline float JoltPhysicsEnvironment::MaxVelocity() const +{ + return m_PhysicsPerformanceParams.maxVelocity; +} + +inline float JoltPhysicsEnvironment::MaxAngularVelocity() const +{ + return m_PhysicsPerformanceParams.maxAngularVelocity; +} + +inline float JoltPhysicsEnvironment::LookAheadTimeObjectsVsWorld() const +{ + return m_PhysicsPerformanceParams.lookAheadTimeObjectsVsWorld; +} + +inline float JoltPhysicsEnvironment::LookAheadTimeObjectsVsObject() const +{ + return m_PhysicsPerformanceParams.lookAheadTimeObjectsVsObject; +} + +inline float JoltPhysicsEnvironment::MinFrictionMass() const +{ + return m_PhysicsPerformanceParams.minFrictionMass; +} + +inline float JoltPhysicsEnvironment::MaxFrictionMass() const +{ + return m_PhysicsPerformanceParams.maxFrictionMass; } //------------------------------------------------------------------------------------------------- diff --git a/vphysics_jolt/vjolt_environment.h b/vphysics_jolt/vjolt_environment.h index c6c586e..10cda67 100644 --- a/vphysics_jolt/vjolt_environment.h +++ b/vphysics_jolt/vjolt_environment.h @@ -128,6 +128,17 @@ public: void GetPerformanceSettings( physics_performanceparams_t* pOutput ) const override; void SetPerformanceSettings( const physics_performanceparams_t* pSettings ) override; + // physics params related + inline float MaxVelocity() const; + inline float MaxAngularVelocity() const; + // most likely will go unused + inline int MaxCollisionsPerObjectPerTimestep() const; + inline int MaxCollisionChecksPerTimestep() const; + inline float LookAheadTimeObjectsVsWorld() const; + inline float LookAheadTimeObjectsVsObject() const; + inline float MinFrictionMass() const; + inline float MaxFrictionMass() const; + void ReadStats( physics_stats_t* pOutput ) override; void ClearStats() override; @@ -225,4 +236,6 @@ private: bool m_EnableConstraintNotify = false; mutable bool m_bActiveObjectCountFirst = true; + + physics_performanceparams_t m_PhysicsPerformanceParams; }; From 92dd2b7e4e03f00365bd3e0b1f07f2e2e0129117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bagel=E2=84=A2?= Date: Thu, 8 Sep 2022 21:15:44 -0400 Subject: [PATCH 4/5] Fixes (formatting, spelling, requests, etc.) --- README.md | 2 +- build.md | 73 ++++++++++++++----------------------------------------- 2 files changed, 19 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 22f6cac..ae165c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![VPhysics Jolt Logo](assets/cube_base_nobg.png "VPhysics Jolt") -# What is Volt? ⚑ +## What is Volt? ⚑ Volt (VPhysics Jolt) is a replacement for Source's VPhysics which uses IVP/Havok
Created by [Joshua Ashton (🐸✨)](https://github.com/Joshua-Ashton) [@phys_ballsocket](https://twitter.com/phys_ballsocket) and [Josh Dowell (Slartibarty)](https://github.com/Slartibarty) [@Slartbarty](https://twitter.com/Slartbarty). diff --git a/build.md b/build.md index 7ea31ab..bf2f593 100644 --- a/build.md +++ b/build.md @@ -3,7 +3,7 @@ ###### Note: This repository can be built with the default SDK but will not be outlined in this guide. ###### Note: x64 platform builds will also not be outlined in this guide. -All build instructions start the same. Clone a local copy of [mini-source-sdk](https://github.com/Joshua-Ashton/mini-source-sdk). (A minified version of [Source SDK](https://github.com/ValveSoftware/source-sdk-2013) with support for VS 2022) +All build instructions start the same. Clone a local copy of [mini-source-sdk](https://github.com/Joshua-Ashton/mini-source-sdk). (A minified version of [Source SDK](https://github.com/ValveSoftware/source-sdk-2013) with support for Linux and added support for [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) and the [Windows 11 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)) ```bash git clone https://github.com/Joshua-Ashton/mini-source-sdk.git ``` @@ -15,28 +15,30 @@ cd mini-source-sdk/sdk2013-mp/src/ At this time you should now recursively git clone the VPhysics-Jolt repository into your "src" directory. ```bash -git clone https://github.com/Joshua-Ashton/VPhysics-Jolt.git vphysics_jolt --recursive +git clone --recursive https://github.com/Joshua-Ashton/VPhysics-Jolt.git vphysics_jolt ``` From this point onward, please follow the rest of the guide specific to your chosen build platform. The current working directory is also assumed to be `mini-source-sdk/sdk2013-mp/src/` and should be adjusted to suit your own build if need be. ## Windows +Continuing on Windows, be sure you have both [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) and the [Windows 11 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) installed on your system. (even if you run Windows 10 the SDK still applies) + ### CLI -Continuing on windows, the next step is to the registry fix script (as administrator). This can be done by right-clicking the `fix_registry.bat` file located in `mini-source-sdk/sdk2013-mp/src/`. If your command prompt or powershell instance are already running under administrator just run the following: +The next step is to run the fix registry script (as administrator). You can just Right-Click -> 'Run As Administrator' the `fix_registry.bat` file located in `mini-source-sdk/sdk2013-mp/src/`. If your command prompt or powershell instance are already running under administrator you can run the script from there: ```bash .\fix_registry.bat ``` -This final command to run before the CLI portion of this guide ends. It will generate your [Visual Studio](https://visualstudio.microsoft.com/vs/) project/solution file(s). (You may also just double-click the file `createjoltprojects.bat`) +This is the final command to run before the CLI portion of this guide ends. It will generate your [Visual Studio](https://visualstudio.microsoft.com/vs/) project/solution file(s). (You may also just Double-Click the file `createjoltprojects.bat`) ```bash .\createjoltprojects.bat ``` ### Visual Studio -After running `createjoltprojects.bat` you should now have a file named `jolt.sln`. Open it. After opening building may be as simple as pressing the shortcut `Ctrl+Shift+B` or right-clicking `Solution 'jolt'` bar in the Solution explorer window and pressing `Build Solution` +After running `createjoltprojects.bat` you should now have a file named `jolt.sln`. Open it. After opening, building should be simple. Press the shortcut `Ctrl+Shift+B` *OR* find the `Solution 'jolt'` bar in the Solution explorer window and Right-Click -> `Build Solution`. Congratulations! @@ -44,48 +46,23 @@ The built `vphysics_jolt.dll` file should now be located in `mini-source-sdk/sdk ### Build errors -Common build errors you may run into building on windows and their solutions. +Common build errors you may run into building on Windows and their solutions. > #### memoverride.cpp -If there is an error about involving a symbol named ` size_t _msize` or `size_t __cdecl _msize_base` try removing or commenting out definitions of both. You should leave only the code below: -```cpp -size_t msize( void *pMem ) -{ - return g_pMemAlloc->GetSize(pMem); -} -``` - -Where the code to be removed/commented would be: -```cpp -size_t __cdecl _msize_base( void *pMem ) noexcept -{ - return g_pMemAlloc->GetSize(pMem); -} - -size_t _msize( void *pMem ) -{ - return _msize_base(pMem); -} -``` - -###### It may be wise to try different variations if the given solution does not work. +If there is an error involving a symbol named ` size_t _msize` or `size_t __cdecl _msize_base`, it is most likely because you haven't updated your Windows SDK to the [Windows 11 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). Please do so. If you still get this error make sure that your Visual Studio projects also default to the latest installed version if they don't already. ## Linux -Continuing on linux, there are a few prerequisites to building regardless of distrobution. -- glibc v2.29+ -- gcc v8+ -- g++ v8+ +Continuing on Linux, there are a few prerequisites to building regardless of distribution. +- gcc 10+ +- g++ 10+ - gcc-multilib - g++-multilib - make -###### Note: Attempts to compile with older versions of glibc are undocumented and probably will not work (you are still welcome to confirm this) - ### Debian/Ubuntu -###### Note: Some older versions of debian or debian-based distrobutions (i.e. ubuntu) may use `apt-get` -###### Note: Older versions may also require version explicit packages if available. +###### Note: Certain versions may also require version explicit packages (gcc/g++ 10 may not be the default installed version). Before we continue building project files, lets get our dependencies out of the way. Install the `build-essential` group to get common developer packages such as gcc, g++, and make, which are included. @@ -103,9 +80,9 @@ The next step is to build our makefiles by running the premade script `createjol ./createjoltprojects.sh ``` -Once the script has finished running you should now have a file name `jolt.mak` in the current directory. Verify you do and now run it with the command below. This command automatically will (and is recommended to) use all available CPU threads. If you want to specify it yourself, replace `` `nproc` `` with a number less than or equal to your max number of threads. To be clear, this only affects compile speed. +Once the script has finished running you should now have a file name `jolt.mak` in the current directory. Verify you do and now run it with the command below. This command automatically will (and is recommended to) use all available CPU threads. If you want to specify it yourself, replace `$(nproc)` with a number less than or equal to your max number of threads. To be clear, this only affects compile speed. ```bash -make -j `nproc` -f jolt.mak +make -j $(nproc) -f jolt.mak ``` Alternative example... @@ -117,27 +94,13 @@ Congratulations! If the console outputs `LINKING` *and* `COPYING TO` messages, that means your build was successful and you may retrieve your `vphysics_jolt.so` and `vphysics_jolt_srv.so` files which will be located in `mini-source-sdk/sdk2013-mp/game/bin/`. -### Build errors (distrobution independent) +### Build errors (distribution independent) -Common build errors you may run into building on linux and their solutions. +Common build errors you may run into building on Linux and their solutions. > #### error: unrecognized command line option β€˜-std=gnu++20’; did you mean β€˜-std=gnu++2a’? (make: *** [jolt.mak:28: all] Error 2) -This error may come up between different versions of g++, the easist way to fix this is to edit `devtools/makefile_base_posix.mak` at approximately `line 47` and change `-std=gnu++20` to `-std=gnu++2a`. - -The full change should look similar to this. Starting as: -```makefile -CXXFLAGS = $(CFLAGS) $(WARN_CXX_FLAGS) -std=gnu++20 -Wno-narrowing -Wno-register -Wno-deprecated-enum-enum-c onversion -Wno-deprecated-declarations -fpermissive -Wno-volatile -Wno-ignored-attributes -I/usr/include/freetype2 -``` -Changing to: -```makefile -CXXFLAGS = $(CFLAGS) $(WARN_CXX_FLAGS) -std=gnu++2a -Wno-narrowing -Wno-register -Wno-deprecated-enum-enum-c onversion -Wno-deprecated-declarations -fpermissive -Wno-volatile -Wno-ignored-attributes -I/usr/include/freetype2 -``` -
- -> #### Other obscure compile error - -Try upgrading your gcc/g++ toolset to a higher version if possible. +This error is caused because the compile was not started with gcc/g++ v10 or higher. Please update. ## OSX Unsupported. From f394a15406f778449e2922557d828c048090d232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bagel=E2=84=A2?= Date: Fri, 23 Sep 2022 04:29:22 -0400 Subject: [PATCH 5/5] Just return if nullptr --- vphysics_jolt/vjolt_environment.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vphysics_jolt/vjolt_environment.cpp b/vphysics_jolt/vjolt_environment.cpp index 22ed635..9a57441 100644 --- a/vphysics_jolt/vjolt_environment.cpp +++ b/vphysics_jolt/vjolt_environment.cpp @@ -1188,14 +1188,14 @@ void JoltPhysicsEnvironment::GetPerformanceSettings( physics_performanceparams_t void JoltPhysicsEnvironment::SetPerformanceSettings( const physics_performanceparams_t *pSettings ) { - if ( pSettings ) - { - m_PerformanceParams = *pSettings; + if ( !pSettings ) + return; - // Normalize these values to match VPhysics behaviour. - m_PerformanceParams.minFrictionMass = Clamp( m_PerformanceParams.minFrictionMass, 1.0f, VPHYSICS_MAX_MASS ); - m_PerformanceParams.maxFrictionMass = Clamp( m_PerformanceParams.maxFrictionMass, 1.0f, VPHYSICS_MAX_MASS ); - } + m_PerformanceParams = *pSettings; + + // Normalize these values to match VPhysics behaviour. + m_PerformanceParams.minFrictionMass = Clamp( m_PerformanceParams.minFrictionMass, 1.0f, VPHYSICS_MAX_MASS ); + m_PerformanceParams.maxFrictionMass = Clamp( m_PerformanceParams.maxFrictionMass, 1.0f, VPHYSICS_MAX_MASS ); m_PhysicsSystem.GetBodies(m_CachedBodies);