Skip to content

clockwise option, joint is awake - #130

Merged
erincatto merged 24 commits into
mainfrom
optim_02
Aug 30, 2026
Merged

clockwise option, joint is awake#130
erincatto merged 24 commits into
mainfrom
optim_02

Conversation

@erincatto

@erincatto erincatto commented Aug 13, 2026

Copy link
Copy Markdown
Owner
  • b3MeshDef gets stride and clockwise option
  • Added b3Joint_IsAwake
  • Added b3Body_TimeOfImpactMover
  • b3MeshDef options #116
  • Smoother mover collision: Mover backside collision #141
  • Shape casts now ignore backside collision on mesh and height-field triangles, same as ray casts.
  • Mover collision now includes triangle information.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::stride and b3MeshDef::clockWiseWinding, and update mesh creation/welding to read vertices with a stride and optionally flip winding.
  • Add b3Joint_IsAwake and b3Body_TimeOfImpactMover (with a new b3BodyTOIResult public 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 thread src/mesh.c Outdated
Comment on lines +1588 to +1591
if ( def->stride != 0 && ( def->stride < ( sizeof( b3Vec3 ) <= def->stride || B3_MAX_STRIDE <= def->stride ) ) )
{
return NULL;
}
Comment thread src/mesh.c
Comment on lines +1576 to +1579
for ( int i = 0; i < count; ++i )
{
dst[i] = *(b3Vec3*)( (uint8_t*)src + i * stride );
}
Comment thread samples/mover.cpp Outdated
@erincatto
erincatto merged commit 47d7f7c into main Aug 30, 2026
20 checks passed
@erincatto
erincatto deleted the optim_02 branch August 30, 2026 04:47
@erincatto erincatto mentioned this pull request Aug 30, 2026
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