| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| 5.3.0 source code.tar.gz | 2025-03-15 | 18.8 MB | |
| 5.3.0 source code.zip | 2025-03-15 | 19.5 MB | |
| README.md | 2025-03-15 | 7.9 kB | |
| Totals: 3 Items | 38.4 MB | 0 | |
There are a few minor breaking changes, see this document.
New functionality
Samples
- The Samples and JoltViewer can run on Linux using Vulkan. Make sure to install the Vulkan SDK before compiling (see:
Build/ubuntu24_install_vulkan_sdk.sh). - The Samples and JoltViewer can run on macOS using Metal.
MeshShape
MeshShapes of up to 110M triangles are possible now, but the actual maximum is very dependent on how the triangles in the mesh are connected.- Optimized creation of
MeshShape. Improves build speed by about 25% and reduces number of allocations by a factor of 1000. Allocations caused contention when building meshes from multiple threads. - Added
MeshShapeSettings::mBuildQualitywhich allows selecting between faster mesh creation or faster run time performance.
Character
- Added
OnContactPersisted,OnContactRemoved,OnCharacterContactPersistedandOnCharacterContactRemovedfunctions onCharacterContactListenerto better match the interface ofContactListener. - Every
CharacterVirtualnow has aCharacterID. This ID can be used to identify the character after removal and is used to make the simulation deterministic in case a character collides with multiple other virtual characters. - Added support for
CharacterVirtualto override the inner rigid body ID. This can be used to make the simulation deterministic in e.g. client/server setups.
Collision Detection
- Added
PhysicsSystem::SetSimShapeFilter. This allows filtering out collisions between sub shapes within a body and can for example be used to have a single body that contains a low detail simulation shape an a high detail collision query shape. An example of a body that's both a sensor and a rigid body can be found inContactListenerTest. - Added
PhysicsSystem::SetSimCollideBodyVsBody. This allows overriding the collision detection between two bodies. It can be used to only store the 1st hit for sensor collisions. This makes sensors cheaper if you only need to know if there is an overlap or not. An example can be found inSimCollideBodyVsBodyTest. - Added
ClosestHitPerBodyCollisionCollectorwhich will report the closest / deepest hit per body that the collision query collides with. - Added overridable
CollisionCollector::OnBodyEndthat is called after all hits for a body have been processed when collecting hits throughNarrowPhaseQuery.
New Platforms
- Added support for RISC-V, LoongArch and PowerPC (Little Endian) CPUs.
- Added support for WASM64.
Various
- Removed the use of
std::unordered_mapandstd::unordered_setand replaced them with our own implementation:UnorderedMapandUnorderedSet. - Added
MotionProperties::ScaleToMass. This lets you easily change the mass and inertia tensor of a body after creation. - Split up
Body::ApplyBuoyancyImpulseintoBody::GetSubmergedVolumeandBody::ApplyBuoyancyImpulse. This allows you to use the calculated submerged volume for other purposes. - Added binary serialization to
SkeletalAnimation. - Added the ability to add a sub shape at a specified index in a
MutableCompoundShaperather than at the end. - Added
STLLocalAllocatorwhich is an allocator that can be used in e.g. theArrayclass. It keeps a fixed size buffer for N elements and only when it runs out of space falls back to the heap. - Added the following constants on PhysicsSystem:
cMaxBodiesLimit,cMaxBodyPairsLimitandcMaxContactConstraintsLimit. These constants are the max allowable values forPhysicsSystem::Init. Exceeding these will trigger an assert and the system will clamp the values. Note that on a 32 bit system, you'll run out of memory before you reach these values.
Bug fixes
- Fixed bodies gaining more energy than intended due to restitution. E.g. A restitution of 1 could lead to bodies bouncing ever higher.
BodyInterface::AddForceapplied a force per soft body vertex rather than to the whole body, this resulted in a soft body accelerating much more compared to a rigid body of the same mass.std::push_heap/pop_heapbehave differently on macOS vs Windows/Linux when elements compare equal, this made the cross platform deterministic build not deterministic in some cases.- Removing a sub shape from a
MutableCompoundShapewould not update the bounding box if the last shape was removed, which can result in a small performance loss. - An empty
MutableCompoundShapenow returns the same local bounding box asEmptyShape(a point at (0, 0, 0)). This prevents floating point overflow exceptions. - VehicleConstraint would override
Body::SetAllowSleepingevery frame, making it impossible for client code to configure a vehicle that cannot go to sleep. - Fixed
CharacterVirtual::Contact::mIsSensorBnot being persisted inSaveState. - Fixed
CharacterVirtual::Contact::mHadContactnot being true for collisions with sensors. They will still be marked asmWasDiscardedto prevent any further interaction. - Fixed
Character::SetShapefailing to switch when standing inside a sensor /Character::PostSimulationfinding a sensor as ground collision. - Fixed numerical inaccuracy in penetration depth calculation when
CollideShapeSettings::mMaxSeparationDistancewas set to a really high value (e.g. 1000). - Bugfix in
Semaphore::Acquirefor non-windows platform. The count was updated before waiting, meaning that the counter would become -(number of waiting threads) and the semaphore would not wake up until at least the same amount of releases was done. In practice this meant that the main thread had to do the last (number of threads) jobs, slowing down the simulation a bit. - Fixed a bug in
ManifoldBetweenTwoFacesthat led to incorrectContactManifold::mRelativeContactPointsOn2when the contact normal and the face normal were not roughly parallel. Also it possibly led to jitter in the simulation in that case. - Fixed
InternalEdgeRemovingCollectornot working when colliding with a very dense triangle grid because it ran out of internal space. Now falling back to memory allocations when this happens to avoid ghost collisions. - Fixed running out of stack space when simulating a really high number of active rigid bodies.
- Moved the 'broad phase bit' to the highest bit in
BodyIDto avoid running out ofNodeIDs inBroadPhaseQuadTreewhen callingPhysicsSystem::OptimizeBroadPhaseon a tree with a very high body count. TempAllocatorImpluses 64 bit integers internally to allow for a higher max contact constraint count.- When inserting lots of bodies without using batching, a broad phase tree of depth > 128 can be created. If the
PhysicsSystemwas destructed in this situation, a stack overflow would cause a crash. - When calling
PhysicsSystem::Updatewith a delta time of 0, contact remove callbacks were triggered by accident for all existing contacts. - Fixed
HingeConstraintnot having limits ifLimitsMinwas set to-JPH_PIorLimitsMaxwas set toJPH_PI. It should only be turned off if both are. - Fixed
CylinderShape::GetSupportingFacereturning the wrong face. When the height of a cylinder was small compared to its radius, it would sink more into the ground than needed during simulation. - When there were no active bodies, the step listeners weren't called. This meant they couldn't wake up bodies. The step listeners are now only skipped if the physics system is updated with zero delta time.
- Fixed a race condition in soft body simulation that could break determinism.
- Added overloads for placement new in the
JPH_OVERRIDE_NEW_DELETEmacro, this means it is no longer needed to do:: new (address) JPH::class_name(constructor_arguments)but you can donew (address) JPH::class_name(constructor_arguments). - Fixed a GCC warning
-Wshadow=global.