Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose parry triangle data in ray/shapecasts #648

Open
REN-aissance opened this issue Feb 5, 2025 · 0 comments
Open

Expose parry triangle data in ray/shapecasts #648

REN-aissance opened this issue Feb 5, 2025 · 0 comments
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Enhancement New feature or request

Comments

@REN-aissance
Copy link

Currently, raycasts' and shapecasts' "HitData" includes data about the normals, which limits options for some more niche use cases.

I would like to see the Parry ShapeId and/or Vertex data passed through the casting functions into Avian. I can imagine a number of use cases.

In mine, however, I want to be able to determine the backface status of the collided triangle using the CW/CCW test so I can detect and prevent near-wall-collisions on my camera. I think this use case is not particularly niche, but others would be. The change would be especially useful for games using lots of trimeshes.

My use case is not currently possible in pure Avian due to it inheriting the Parry convention that backface collisions return the negative normal of the triangle. This effectively makes it impossible to determine the backface status of a triangle and making them all double sided for the purposes of collision. I don't know the implications of Parry changing that (and am too intimidated to suggest it to them) but either way exposing some of that parry data would make workarounds possible as well as some cool niche functionalities. Painting triangles of meshes by swapping their materials comes to mind as another potential example.

Thanks!

@Jondolf Jondolf added C-Enhancement New feature or request A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests and removed A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants