Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsm/physics/JoltPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getShape( geometry ) {
const sy = parameters.height !== undefined ? parameters.height / 2 : 0.5;
const sz = parameters.depth !== undefined ? parameters.depth / 2 : 0.5;

return new Jolt.BoxShape( new Jolt.Vec3( sx, sy, sz ), 0.05, null );
return new Jolt.BoxShape( new Jolt.Vec3( sx, sy, sz ), 0.05 * Math.min( sx, sy, sz ), null );

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrouwe What do you think about this solution?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the example uses boxes of 0.075, a convex radius of 0.05 is indeed too big (the debug version of Jolt will assert because it is bigger than half the size of the box). So this solution is better as it reduces the convex radius to 0.00375.

The default allowed penetration in Jolt is 0.02 (PhysicsSettings.mPenetrationSlop) which means the boxes can still sink into each other by this amount. Also, this will not help performance as the allowed penetration is bigger than the convex radius which causes a more expensive code path to trigger more often. You can update the physics settings through PhysicsSystem.SetPhysicsSettings.


} else if ( geometry.type === 'SphereGeometry' || geometry.type === 'IcosahedronGeometry' ) {

Expand Down
Binary file modified examples/screenshots/physics_jolt_instancing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/e2e/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const exceptionList = [
// TODO: implement determinism for setTimeout and setInterval
// could it fix some examples from above?
'physics_rapier_instancing',
'physics_jolt_instancing',

// Awaiting for WebGL backend support
'webgpu_clearcoat',
Expand Down