Skip to content

Expose JPH::ShapeFilter::mBodyID2 to C via JPC_ShapeFilter_getBodyID2 - #27

Merged
LPGhatguy merged 1 commit into
SecondHalfGames:mainfrom
HexyWitch:expose-body
Aug 19, 2026
Merged

LPGhatguy merged 1 commit into
SecondHalfGames:mainfrom
HexyWitch:expose-body

Conversation

@HexyWitch

Copy link
Copy Markdown
Contributor

And pass a ShapeFilter pointer to the ShapeFilterFns to get at the ShapeFilter form inside the ShapeFilterFns

The motivation for implementing it this way instead of simply passing the body ID into ShapeFilterFns is that the C API should support creating a ShapeFilter with JPC_ShapeFilter_new and read the body from it independently of the ShapeFilterFns. Also if JPH::ShapeFilter has members added in the future this won't bloat the ShapeFilterFns signatures.

reinterpret_cast<const JPC_ShapeFilter*>(this)

instead of

 to_jpc(this)

because the OPAQUE_WRAPPER(JPC_ShapeFilter, JPC_ShapeFilterBridge) is invoked after the JPC_ShapeFilterBridge definition so we can't use it.

@LPGhatguy LPGhatguy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me!

@LPGhatguy
LPGhatguy merged commit a04e431 into SecondHalfGames:main Aug 19, 2026
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants