Docs/ReleaseNotes.md
For breaking API changes see this document.
JPH_USE_DX12, JPH_USE_VK, JPH_USE_MTL and JPH_USE_CPU_COMPUTE to OFF. 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.CollideShapeSettings::mInternalEdgeRemovalVertexToleranceSq and PhysicsSettings::mInternalEdgeRemovalVertexToleranceSq.JPH namespace serializable.VehicleConstraints are automatically disabled when the vehicle body is not in the PhysicsSystem.mMaxSlopeAngle, the code to stop the constraint solver from ping ponging between two planes didn't work properly.mShape2Face in 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.Body::AddForce to 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.MoveKinematic more accurate when rotating a body by a very small angle.JPH_TRACK_SIMULATION_STATS which tracks simulation statistics on a per body basis. This can be used to figure out bodies are the most expensive to simulate.RagdollSettings::CalculateConstraintPriorities which calculates constraint priorities that boost the priority of joints towards the root of the ragdoll.BoxShape, CylinderShape and TaperedCylinderShape will now automatically reduce the convex radius if the specified value is too big for the shape (instead of erroring out).CollideSoftBodyVerticesVsTriangles::sTriangleThickness.JPH_DEFAULT_ALLOCATE_ALIGNMENT which allows defining the default Allocate alignment if your allocator's alignment is different from the alignment as defined by __STDCPP_DEFAULT_NEW_ALIGNMENT__.type_traits for std::is_trivial to avoid compile error on macOS with clang 21._CRTDBG_MAP_ALLOC define on Windows.TaperedCylinderShapeSettings and creating the shape.TriangleShape/MeshShape/HeightFieldShape. This would not find the closest collision point in case the shape was scaled. It would also make the triangles much thicker than intended causing collisions with back facing triangles that were very far away.SoftBodyCosseratRodConstraintTest demo.Ragdoll::DriveToPoseUsingMotors. This also adds HingeConstraint::SetTargetOrientationBS which sets the target angle in body space.JPH_USE_EXTERNAL_PROFILE cmake option that allows overriding the behavior of the profile macros.SoftBodyCreationSettings::mFacesDoubleSided which treats the faces of the soft body as double sided. This can be used to make e.g. flags double sided.CharacterSettings from a Character and CharacterVirtualSettings from a CharacterVirtual.CharacterVirtual.BodyInterface::SetIsSensor/IsSensor functions.ManifoldBetweenTwoFaces which would not find the correct manifold in case face 1 had 3 or more vertices and face 2 only 2. E.g. for a box resting the long edge of a cylinder this would mean that only a single contact point was found instead of 2 (the other way around would work fine).ConvexHullShape::CollideSoftBodyVertices where the wrong edge could be reported as the closest edge.PhysicsSystem::OptimizeBroadPhase. When calling this function after removing all bodies from the PhysicsSystem, the internal nodes would not be freed until bodies are added again. This could lead to running out of internal nodes in rare cases.MeshShape active edge calculation which could mark edges of non-manifold meshes as inactive instead of active.ContactListener::OnContactPersisted when the contact comes from the contact cache.QuadTree will now fall back to the heap when running out of stack space during collision queries. Previously this would trigger an assert and some collisions would not be detected.BodyInterface::MoveKinematic, SetLinearVelocity, SetAngularVelocity, SetLinearAndAngularVelocity, AddLinearVelocity, AddLinearAndAngularVelocity, SetPositionRotationAndVelocity and SetMotionType when body not added to the physics system yet.SimShapeFilter.WheelSettingsTV and WheelSettingsWV were not serializing their base class members.SoftBodySharedSettings::OptimizationResults mapped from new to old index instead of from old to new as was documented. The maps now behave as documented.TriangleShape vs a TriangleShape.CastRay / CastShape early out condition to avoid dividing by a very small number and overflowing to INF. This can cause a float overflow exception.VK_EXT_device_address_binding_report without checking if it is available.MotorcycleControllerSettings which led to the members of WheeledVehicleControllerSettings not being serialized.VehicleConstraint::GetConstraintSettings function.CollideShapeSettings::mMaxSeparationDistance. This potentially led to missed collisions.Build/ubuntu24_install_vulkan_sdk.sh).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.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.MeshShapeSettings::mBuildQuality which allows selecting between faster mesh creation or faster run time performance.OnContactPersisted, OnContactRemoved, OnCharacterContactPersisted and OnCharacterContactRemoved functions on CharacterContactListener to better match the interface of ContactListener.CharacterVirtual now has a CharacterID. 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.CharacterVirtual to override the inner rigid body ID. This can be used to make the simulation deterministic in e.g. client/server setups.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 in ContactListenerTest.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 in SimCollideBodyVsBodyTest.ClosestHitPerBodyCollisionCollector which will report the closest / deepest hit per body that the collision query collides with.CollisionCollector::OnBodyEnd that is called after all hits for a body have been processed when collecting hits through NarrowPhaseQuery.std::unordered_map and std::unordered_set and replaced them with our own implementation: UnorderedMap and UnorderedSet.MotionProperties::ScaleToMass. This lets you easily change the mass and inertia tensor of a body after creation.Body::ApplyBuoyancyImpulse into Body::GetSubmergedVolume and Body::ApplyBuoyancyImpulse. This allows you to use the calculated submerged volume for other purposes.SkeletalAnimation.MutableCompoundShape rather than at the end.STLLocalAllocator which is an allocator that can be used in e.g. the Array class. It keeps a fixed size buffer for N elements and only when it runs out of space falls back to the heap.cMaxBodiesLimit, cMaxBodyPairsLimit and cMaxContactConstraintsLimit. These constants are the max allowable values for PhysicsSystem::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.BodyInterface::AddForce applied 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_heap behave differently on macOS vs Windows/Linux when elements compare equal, this made the cross platform deterministic build not deterministic in some cases.MutableCompoundShape would not update the bounding box if the last shape was removed, which can result in a small performance loss.MutableCompoundShape now returns the same local bounding box as EmptyShape (a point at (0, 0, 0)). This prevents floating point overflow exceptions.Body::SetAllowSleeping every frame, making it impossible for client code to configure a vehicle that cannot go to sleep.CharacterVirtual::Contact::mIsSensorB not being persisted in SaveState.CharacterVirtual::Contact::mHadContact not being true for collisions with sensors. They will still be marked as mWasDiscarded to prevent any further interaction.Character::SetShape failing to switch when standing inside a sensor / Character::PostSimulation finding a sensor as ground collision.CollideShapeSettings::mMaxSeparationDistance was set to a really high value (e.g. 1000).Semaphore::Acquire for 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.ManifoldBetweenTwoFaces that led to incorrect ContactManifold::mRelativeContactPointsOn2 when the contact normal and the face normal were not roughly parallel. Also it possibly led to jitter in the simulation in that case.InternalEdgeRemovingCollector not 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.BodyID to avoid running out of NodeIDs in BroadPhaseQuadTree when calling PhysicsSystem::OptimizeBroadPhase on a tree with a very high body count.TempAllocatorImpl uses 64 bit integers internally to allow for a higher max contact constraint count.PhysicsSystem was destructed in this situation, a stack overflow would cause a crash.PhysicsSystem::Update with a delta time of 0, contact remove callbacks were triggered by accident for all existing contacts.HingeConstraint not having limits if LimitsMin was set to -JPH_PI or LimitsMax was set to JPH_PI. It should only be turned off if both are.CylinderShape::GetSupportingFace returning 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.JPH_OVERRIDE_NEW_DELETE macro, this means it is no longer needed to do :: new (address) JPH::class_name(constructor_arguments) but you can do new (address) JPH::class_name(constructor_arguments).-Wshadow=global.Shape::GetLeafShape to be able to get a leaf shape given a sub shape IDHeightFieldShape::GetSubShapeCoordinates to get the triangle coordinates of a particular sub shape IDSoftBodyManifold::GetSensorContactBodyID.StateRecorder::SetIsLastPart. Also added StateRecorderFilter::ShouldRestoreContact to allow selective restoring of contacts.JPH_DEBUG_SYMBOL_FORMAT cmake option. This allows switching from the default dwarf symbol format to e.g. the source-map format for emscripten, which speeds up compilation.CMake Error: No output files for WriteBuild! when using the 'Ninja Multi-Config' generator.ld: error: undefined symbol: pthread_create on FreeBSD.cmake --install.cmake --install when ENABLE_OBJECT_STREAM=OFF.cmake --install to install a shared library on Windows, the dll is installed in the 'bin' folder now.Policy CMP0177 is not set: install() DESTINATION paths are normalized.unresolved symbol '__emutls_v._ZN3JPH11PhysicsLock6sLocksE' when compiling Jolt as a shared library with MinGW._mm_blendv_ps intrinsic when compiling to WASM.