New functionality
- Added interface to run compute shaders on the GPU with implementations for DX12, Vulkan and Metal. These interfaces can be disabled by setting
JPH_USE_DX12,JPH_USE_VK,JPH_USE_MTLandJPH_USE_CPU_COMPUTEtoOFF. To build on macOS, you'll need to have dxc and spirv-cross installed. The easiest way to install them is by installing the Vulkan SDK. - Added a strand based hair simulation running on GPU
- System is based on Cosserad rods.
- Can use long range attachment constraints to limit the stretch of hairs.
- Supports simulation (guide) and render (follow) hairs.
- Hair vs hair collision is handled by accumulating the average velocity in a grid and using those velocities to drive hairs.
- Supports collision with the environment, although it only supports ConvexHull and CompoundShapes at the moment.
- The roots of the hairs can be skinned to the scalp mesh.
- Note that this is still work in progress, some things that still need to be done are listed in Hair.h.
- Implemented a new friction model. This friction model is cheaper to execute (15 % faster, 40% less memory for Pyramid test) and doesn't favor the first contact manifold point. Instead of applying friction at every contact point, we now calculate the average contact point and apply friction there. Friction consists of 2 linear constraints and 1 angular constraint. The linear constraints use the
friction_coefficient * sum(contact_impulse)to determine the max linear friction impulse, the angular constraint usesfriction_coefficient * sum(distance_friction_point_to_contact_point * contact_impulse)to determine the max angular friction impulse. - Increased maximum value of
HeightFieldShape::mBitsPerSampleto 16 to be able to create height fields that more closely match the uncompressed height values. - Made tolerance that's used in the internal edge removal algorithm configurable in
CollideShapeSettings::mInternalEdgeRemovalVertexToleranceSqandPhysicsSettings::mInternalEdgeRemovalVertexToleranceSq. - Added support for RISC-V RVV, the SIMD extension for RISC-V.
- Added
JPH_BUILD_SHARED_LIBScmake variable to determine whether to build static or shared libraries (it defaults toBUILD_SHARED_LIBS). This allows embedding Jolt as a static library within a shared library. - Simulation stats: Added tracking of collision steps. This way we can know by how many steps we need to divide the numbers to get averages per step.
- Added support for glTF
KHR_physics_rigid_bodiesconstraint motors. This addsESpringMode::MassNormalizedStiffnessAndDampingto be able to specify the spring parameters mass-normalized / in acceleration-mode. It also addsEMotorState::PositionAndVelocitywhich creates a force proportional tostiffness * (position_target - position_current) + damping * (velocity_target - velocity_current). - Added
Ragdoll::DriveToPoseUsingMotorsvariant that drives to a pose using both position and velocity. - Added
Body::ApplyBodyCreationSettingsandBody::ApplySoftBodyCreationSettingsto be able to update a body with creation settings after creation. - Added
ShapeCastSettings::mExtraConvexRadiuswhich inflates the query shape by an extra convex radius. - Up to 40% performance improvement (scene dependent) and up to 70% memory reduction (scene dependent).
Bug Fixes
- Made it possible to make a class outside the
JPHnamespace serializable. VehicleConstraints are automatically disabled when the vehicle body is not in thePhysicsSystem.- Fixed an issue where a character could get stuck. If the character was teleported inside an area surrounded by slopes that are steeper than
mMaxSlopeAngle, the code to stop the constraint solver from ping ponging between two planes didn't work properly. - Fixed an issue where collide/cast shape against a triangle that was scaled inside out would return a hit result with
mShape2Facein incorrect winding order. This caused an incorrect normal in the enhanced internal edge removal algorithm. This in turn resulted in objects not settling properly on dense triangle grids. - When using
Body::AddForceto apply gravity, bodies could gain extra energy during elastic collisions. We now cancel added forces in the direction of the contact normal if the body starts in collision to negate this energy gain. - Made
MoveKinematicmore accurate when rotating a body by a very small angle. - Kinematic bodies were assigned to the same island as bodies that were constrained to / in contact with them. This led to larger simulation islands and impacted performance.
- Fixed contact callbacks for body with motion quality
LinearCastvs a soft body. Previously, the contacts would be reported accidentally through the regularContactListener. Now they're properly reported through theSoftBodyContactListener. - Fixed
CharacterVirtual::GetFirstContactForSweepcrashing if the body that it hit was removed from another thread betweenCastShapeandGetTransformedShape. - Fixed
CharacterVirtualspeeding up beyond requested speed when sliding along a wall that was low enough to trigger stair walking yet high enough to not step up completely. - Fixed
CharacterVirtualsometimes not fully taking character padding into account when moving through the environment. - Fixed an issue that broke cross platform determinism between ARM64 and x64 builds when compiling with double precision.
- Fixed some warnings when compiling with clang using C++26.
- Fixed unit test failures + floating point exceptions in Samples when using MSVC 18.6.0.
Deprecated
- Support for Universal Windows Platform (not properly supported on VS2026 anymore).
- Support for Windows ARM32 (not properly supported on VS2026 anymore).
- Support for compilers older than Visual Studio 2022, Clang 16 or GCC 12.