Skip to content

[Jolt Physics / GodotPhysics] RayCast3D returns different collision normals when hitting a CollisionShape on the edge #107900

Open
@Grandro

Description

@Grandro

Tested versions

  • 4.4.1 stable

System information

Windows 11

Issue description

When a RayCast3D hits a CollisionShape on the edge there is different behavior between Jolt Physics and Godot Physics:
Jolt Physics:
Image
Ray shoots along the Z-Axis. Reported collision normal is (-1, 0, 0)

Godot Physics:
Image
Ray shoots along the Z-Axis. Reported collision normal is (0, 0, 1)

Jolt Physics behavior has a negative impact because if you put two CollisionShapes next to each other that leave no space inbetween, the reported normal suggest that the ray passed through the CollisionShape:
Image
Ray shoots along the Z-Axis. Reported collision normal is (-1, 0, 0)

Steps to reproduce

  1. Create a new project
  2. Create a RayCast3D
  3. Create a StaticBody3D and a CollisionShape3D with shape BoxShape3D
  4. Position the nodes so that the RayCast3D collides with the StaticBody3D on the edge of its shape.
  5. Print the collision shape normal

Minimal reproduction project (MRP)

Jolt_Collision_Normal.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions