Conversation
foldout sample
mesh creation tests
There was a problem hiding this comment.
Pull request overview
This PR extends Box3D’s mesh and character-mover APIs by adding support for strided mesh vertex input, an option to interpret clockwise index winding, a joint awake-query helper, and a new body-vs-mover time-of-impact query—backed by new/expanded tests and sample updates.
Changes:
- Add
b3MeshDef::strideandb3MeshDef::clockWiseWinding, and update mesh creation/welding to read vertices with a stride and optionally flip winding. - Add
b3Joint_IsAwakeandb3Body_TimeOfImpactMover(with a newb3BodyTOIResultpublic type) plus new unit tests. - Update samples and mover user-data to support push filtering and visualize mover TOI impacts.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_mesh.c | New tests covering mesh stride, welding + stride, and clockwise-winding behavior. |
| test/test_body_query.c | Adds unit tests for b3Body_TimeOfImpactMover across hit/separated/overlap/filtering cases. |
| test/main.c | Registers the new MeshTest in the test runner. |
| test/CMakeLists.txt | Adds test_mesh.c to the test build. |
| src/mesh.c | Implements strided vertex reads, updates welding, adds clockwise winding option, and adds stride validation. |
| src/joint.c | Adds b3Joint_IsAwake and applies minor formatting cleanups. |
| src/body.c | Adds b3Body_TimeOfImpactMover and minor formatting cleanups. |
| samples/sample_joint.cpp | Adds a new “Fold Out” joints sample and tweaks existing samples. |
| samples/sample_character.cpp | Renames/expands mover sample and adds TOI visualization/respawn behavior. |
| samples/mover.h | Extends mover shape user data with canMoverPush. |
| samples/mover.cpp | Skips applying push impulses to shapes marked canMoverPush == false. |
| include/box3d/types.h | Adds b3BodyTOIResult, documents TOI point space, and extends b3MeshDef with stride/winding. |
| include/box3d/math_functions.h | Adjusts b3GetLengthAndNormalize to match b3Normalize’s small-vector handling. |
| include/box3d/box3d.h | Exposes b3Body_TimeOfImpactMover and b3Joint_IsAwake in the public API. |
| .github/issue_template.md | Expands issue template guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1588
to
+1591
| if ( def->stride != 0 && ( def->stride < ( sizeof( b3Vec3 ) <= def->stride || B3_MAX_STRIDE <= def->stride ) ) ) | ||
| { | ||
| return NULL; | ||
| } |
Comment on lines
+1576
to
+1579
| for ( int i = 0; i < count; ++i ) | ||
| { | ||
| dst[i] = *(b3Vec3*)( (uint8_t*)src + i * stride ); | ||
| } |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.