So far (outside of somehow adding it into Godot via C++ myself) this doesn’t seem possible but wanted to ask to see if i maybe missed something.

The most i could find was this issue and a couple of related ones.

My specific use case would be for drawing bullet holes onto meshes (via decals). Ideally also being able to determine the texture used on the faces of the meshes that are intersected (to determine an appropriate decal to use).

Having everything that is possible to hit duplicated as a static body or area seems excessive to me. Since the only data required for ray intersection should be the transform of the meshes faces/edges/vertices etc which i would think are already contained in the mesh itself?

Failing being able to make intersecting a ray with meshes work i will probably try experimenting with using areas. They seem the lowest performance cost out of all the options the existing ray cast can detect. I would still end up with most of the games geometry being duplicated though, once as actual meshes and once as collisions for all the areas.

  • Norodix@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I dont think there is anything wrong with that picture. That makes perfect physical sense to me.

    • Ti_KaOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Well yeah physically its sort of right, but for one (though im not sure if this is just a difference of opinion or if its not clear from the picture) imo the streched hole does seem abnormally large. But also if i use any decal more complicated than just this black circle it would seem off. Since the bullet hole texture would be modeled off a “clean” 90 degree impact bullet hole it would look off if streched like that.

      Here a simple example that makes it a bit more clear where i put a white x inside the bullet hole.

      Decals that make sense for (near) 90 degree impacts would look bad (or at least very different) when stretched like this.

      • Norodix@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Oh yeah, that makes sense. You can try capping the angle between the collision normal and the incoming ray. But it will always be an approximation. I dont think you should get too hung up on it. People always see malformed decals in games. Or footprints on hard surfaces etc. Its not a big deal.