jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6.77k stars 452 forks source link

Issue With RayCast3D #1280

Closed hodayfa000-h closed 1 month ago

hodayfa000-h commented 1 month ago

Hi, I am new to Godot and lately I heard about JoltPhysics, cool... it solves stuff and improves performance, however when switching to it, for some weird reason RayCast3D from direct space state doesn't behave normally, yet when I use the default physics engine, It works Just fine! any solutions? because it makes it unusable, I use Godot version 4.3 Mono Stable.

mihe commented 1 month ago

This repository is for the Jolt physics engine in general. You should be reporting this issue to the Godot Jolt repository instead. Please open a new issue there and provide more details surrounding the exact circumstances of your issue. The current description is a bit too vague.

With that said, if I had to guess, I suspect you're likely running up against the discrepancy of the hit_back_faces parameter behaving differently[^1] compared to Godot Physics, which is something that's been fixed recently but which I haven't had time to cut a new release for yet. If you just disable that parameter (which you'll find on the RayCast3D node as well) you should see the same behavior as with Godot Physics.

[^1]: Jolt considered all shapes to have back-faces, including convex shapes (spheres, boxes, capsules, etc), as opposed to Godot Physics which only considers triangle-based shapes to have back-faces, meaning ConcavePolygonShape3D and HeightMapShape3D.

hodayfa000-h commented 1 month ago

This repository is for the Jolt physics engine in general. You should be reporting this issue to the Godot Jolt repository instead. Please open a new issue there and provide more details surrounding the exact circumstances of your issue. The current description is a bit too vague.

With that said, if I had to guess, I suspect you're likely running up against the discrepancy of the hit_back_faces parameter behaving differently1 compared to Godot Physics, which is something that's been fixed recently but which I haven't had time to cut a new release for yet. If you just disable that parameter (which you'll find on the RayCast3D node as well) you should see the same behavior as with Godot Physics.

Footnotes

  1. Jolt considered all shapes to have back-faces, including convex shapes (spheres, boxes, capsules, etc), as opposed to Godot Physics which only considers triangle-based shapes to have back-faces, meaning ConcavePolygonShape3D and HeightMapShape3D.

oh I didn't know, sorry about that! I will try that if it doesn't work I'll report to there with more details.