Repository: godotengine/godot (language: cpp)

Issue:
Built-in Jolt Physics colliding shape index is always 0
### Tested versions

- Reproducible in: v4.4.stable.official [4c311cbee] with built-in Jolt Physics
- Not reproducible in: v4.3.stable.official [77dcf97d8] with Godot Jolt 0.15.0 Extension from AssetLib

### System information

Godot v4.3.stable - Garuda Linux #1 ZEN SMP PREEMPT_DYNAMIC Fri, 07 Mar 2025 20:18:44 +0000 - X11 - GLES3 (Compatibility) - Mesa Intel(R) HD Graphics 630 (KBL GT2) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

Issue: When using Godot 4.4 with built-in Jolt Physics, `shape` value in the `get_rest_info()` output dictionary (obtained as ShapeCast3D's `collision_result`) is 0 regardless of the actual shape with which ShapeCast3D collided. 

Expected: different shapes have different shape indexes.

This issue does not occur when using DEFAULT physics on Godot 4.4, and it also doesnt occur when using  Godot Jolt extension or DEFAULT physics on Godot 4.3 version.

### Steps to reproduce

- Open MRP
- Set project's physics engine to Jolt
- Launch the game, note the output in the terminal being all 0 (three collision shapes report three different shapes of the same rigid body have index 0)
- Change project's physics engine to DEFAULT
- Launch the game, the output in the terminal should read 0 1 2 (three different shapes have different indexes)

Identical setup in a 4.3 project using the Godot Jolt Extension produces 0 1 2 as expected.

### Minimal reproduction project (MRP)

[ShapeTest4.4.zip](https://github.com/user-attachments/files/19436320/ShapeTest4.4.zip)


Discussion / hints:
Update:
On 4.4, downloading the Jolt extension from the AssetLib and using it instead of the built-in Jolt solves the issue presented in the MRP.

Fix patch:
diff --git a/modules/jolt_physics/spaces/jolt_physics_direct_space_state_3d.cpp b/modules/jolt_physics/spaces/jolt_physics_direct_space_state_3d.cpp
index ba904f0e9192..02fcbbc7e6a7 100644
--- a/modules/jolt_physics/spaces/jolt_physics_direct_space_state_3d.cpp
+++ b/modules/jolt_physics/spaces/jolt_physics_direct_space_state_3d.cpp
@@ -787,7 +787,6 @@ bool JoltPhysicsDirectSpaceState3D::rest_info(const ShapeParameters &p_parameter
 	r_info->normal = to_godot(-hit.mPenetrationAxis.Normalized());
 	r_info->rid = object->get_rid();
 	r_info->collider_id = object->get_instance_id();
-	r_info->shape = 0;
 	r_info->linear_velocity = object->get_velocity_at_position(hit_point);
 
 	return true;


Test patch: