Skip to content

Releases: jrouwe/JoltPhysics.js

1.0.0

28 Dec 15:47

Choose a tag to compare

New functionality

  • Updated to Jolt v5.5.0
  • Added 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).

Bug Fixes

  • A 6DOF constraint that constrains all rotation axis in combination with a body that has some of its rotation axis locked would not constrain the rotation in the unlocked axis.
  • Fixed cast shape possibly not returning a hit when a shape cast starts touching (but not intersecting) another shape and requesting the deepest hit.
  • Fixed division by zero when doing a really long (6 KM) sphere cast against a triangle. In this case the floating point accuracy became low enough so that the distance between the sphere center and the triangle (which should be 'radius') became zero instead.
  • Fixed memory leak when providing invalid parameters to TaperedCylinderShapeSettings and creating the shape.
  • Fixed collision between soft body and 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.

0.39.0

04 Nov 20:26

Choose a tag to compare

Changed user data from unsigned long long (64-bit) to unsigned long (32-bit)

WebIDL has issues with marshalling 64-bit integers between C++ and JavaScript. As a result using BodyActivationListener would hang the application.

0.38.1

22 Oct 19:36

Choose a tag to compare

Enabled 'worker' environment for single threaded build. See #278.

0.38.0

08 Oct 19:35

Choose a tag to compare

  • Update to Jolt 5.4.0:

    • Fixed bug in 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).
    • Fixed bug in MeshShape active edge calculation which could mark edges of non-manifold meshes as inactive instead of active.
  • Added BodyInterface::SetMaxLinearVelocity, GetMaxLinearVelocity, SetMaxAngularVelocity and GetMaxAngularVelocity

0.37.0

30 Aug 12:01

Choose a tag to compare

Breaking changes:

  • SoftBodySharedSettings::mVertexRadius was moved to SoftBodyCreationSettings::mVertexRadius.

Added:

  • Added SoftBodyCreationSettings::mFacesDoubleSided which treats the faces of the soft body as double sided. This can be used to make e.g. flags double sided.
  • Added support for compound shapes as character shape in CharacterVirtual.
  • Added BodyInterface::SetIsSensor/IsSensor functions.

Fixes:

  • Fixed bug in ConvexHullShape::CollideSoftBodyVertices where the wrong edge could be reported as the closest edge.
  • Fixed bug in 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.
  • Fixed passing underestimate of penetration depth in 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.
  • Fixed BodyInterface::MoveKinematic, SetLinearVelocity, SetAngularVelocity, SetLinearAndAngularVelocity, AddLinearVelocity, AddLinearAndAngularVelocity, SetPositionRotationAndVelocity and SetMotionType when body not added to the physics system yet.

0.36.0

06 May 20:41

Choose a tag to compare

0.36.0

  • Added Cosserat rods to soft bodies. This is a stick constraint with an orientation that can be used to attach geometry. Can be used e.g. to simulate vegetation in a cheap way.
  • Added CompoundShapeSettings AddShapeShape / AddShapeShapeSettings and deprecated AddShape
  • Added Vec4 IsNearZero
  • Added HingeConstraint SetTargetOrientationBS
  • Added ability to drive hinge constraints with Ragdoll::DriveToPoseUsingMotors. This also adds HingeConstraint::SetTargetOrientationBS which sets the target angle in body space.
  • Fixed an issue where soft body bend constraints could be created with identical vertices. This led to an assert triggering.
  • Fixed infinite recursion when colliding a TriangleShape vs a TriangleShape.

0.35.0

31 Mar 19:11

Choose a tag to compare

  • Renamed cmake option TOTAL_MEMORY to INITIAL_MEMORY
  • Exposing new cmake option MAXIMUM_MEMORY
  • Exposing all Array constructors to JavaScript
  • Updated to emscripten 4.0.6

0.34.0

17 Mar 21:20

Choose a tag to compare

Reverting back to emscripten 3.1.74 because there's multiple issues with emscripten 4.0.0+:

  • The WASM compat build became 2.4x as big
  • -s LEGACY_VM_SUPPORT=1 doesn't work in debug builds
  • i64 types need to be passed as BigInt now which breaks the API

0.33.0

16 Mar 10:37

Choose a tag to compare

Update to Jolt Physics v5.3.0, this brings in the following changes:

  • Added accessors to the vehicle anti roll bars.
  • Added Get/SetCollisionGroup on BodyInterface.
  • Fix stack corruption when destroying extremely unbalanced broad phase tree.
  • When updating the simulation with a delta time of 0, contact remove callbacks were triggered by accident for all existing contacts.
  • Fixed HingeConstraint not having limits if LimitsMin was set to -PI or LimitsMax was set to PI. It should only be turned off if both are.
  • Made BodyInterface::SetShape, NotifyShapeChanged, SetPosition, SetRotation, SetPositionAndRotation and SetPositionAndRotationWhenChanged work when body has not been added to the PhysicsSystem yet and passing the EActivation::Activate flag.
  • Improved stability of cylinder contact points.
  • When there were no active bodies, the step listeners weren't called.
  • Fixed assert: It should be possible to add zero bodies to the physics system.

0.32.0

15 Feb 10:10

Choose a tag to compare

Breaking changes:

  • Added OnContactPersisted, OnContactRemoved, OnCharacterContactPersisted and OnCharacterContactRemoved functions on CharacterContactListener to better match the interface of ContactListener.
  • Renamed PhysicsSettings mManifoldToleranceSq to mManifoldTolerance (and the value is no longer squared)
  • VehicleController is no longer a refcounted class

Added:

  • Added support for CharacterVirtual to override the inner rigid body ID. This can be used to make the simulation deterministic in e.g. client/server setups.
  • Every 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.
  • Added MeshShapeSettings mBuildQuality to control run time performance vs build speed
  • Added Vec3/RVec3/Vec4 sOne

Fixed:

  • Removing a sub shape from a MutableCompoundShape would not update the bounding box if the last shape was removed, which can result in a small performance loss.
  • VehicleConstraint would override Body::SetAllowSleeping every frame, making it impossible for client code to configure a vehicle that cannot go to sleep.
  • Fixed CharacterVirtual::Contact::mIsSensorB not being persisted in SaveState.
  • Fixed CharacterVirtual::Contact::mHadContact not being true for collisions with sensors. They will still be marked as mWasDiscarded to prevent any further interaction.
  • Fixed Character::SetShape failing to switch when standing inside a sensor / Character::PostSimulation finding a sensor as ground collision.
  • Fixed numerical inaccuracy in penetration depth calculation when CollideShapeSettings::mMaxSeparationDistance was set to a really high value (e.g. 1000).
  • Bugfix in 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.
  • An empty MutableCompoundShape now returns the same local bounding box as EmptyShape (a point at (0, 0, 0)). This prevents floating point overflow exceptions.
  • Fixed a bug in ManifoldBetweenTwoFaces that led to incorrect ContactManifold::mRelativeContactPointsOn2 when the contact normal and the face normal were not roughly parallel. Also it led to possibly jitter in the simulation in that case.
  • Fixed 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.
  • 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 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.