Follow cam (#107)

- follow cam in replay viewer
- world text with halo
- fixed sensor crash
- sensor visitors must now be convex
This commit is contained in:
Erin Catto 2026-07-29 22:14:26 -07:00 • committed by GitHub
commit 3fc20f5b45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 7450 additions and 127 deletions

View file

@ -1429,20 +1429,20 @@ void b3World_Draw( b3WorldId worldId, b3DebugDraw* draw, uint64_t maskBits )
const char* name = b3FindName( &world->names, body->nameId );
if ( name != NULL )
{
draw->DrawStringFcn( p, name, b3_colorOrange, draw->context );
draw->DrawStringFcn( p, name, b3_colorWhite, draw->context );
}
}
if ( draw->drawMass && body->type == b3_dynamicBody )
{
b3Vec3 offset = { 0.1f, 0.1f, 0.1f };
b3Vec3 offset = { 0.05f, 0.05f, 0.05f };
b3WorldTransform transform = { bodySim->center, bodySim->transform.q };
draw->DrawTransformFcn( transform, draw->context );
b3Pos p = b3TransformWorldPoint( transform, offset );
char buffer[32];
snprintf( buffer, 32, " %.2f", body->mass );
snprintf( buffer, 32, "%.2f", body->mass );
draw->DrawStringFcn( p, buffer, b3_colorWhite, draw->context );
}

View file

@ -107,9 +107,8 @@ static bool b3SensorQueryCallback( int proxyId, uint64_t userData, void* context
b3World* world = queryContext->world;
b3Shape* otherShape = b3Array_Get( world->shapes, shapeId );
// Mesh vs mesh is not supported
if ( ( otherShape->type == b3_meshShape || otherShape->type == b3_heightShape ) &&
( sensorShape->type == b3_meshShape || sensorShape->type == b3_heightShape ) )
// Visitors must be convex.
if ( b3IsConvex( otherShape->type ) == false )
{
return true;
}

View file

@ -153,3 +153,8 @@ static inline bool b3ShouldQueryCollide( const b3Filter* shapeFilter, const b3Qu
return ( shapeFilter->categoryBits & queryFilter->maskBits ) != 0 &&
( shapeFilter->maskBits & queryFilter->categoryBits ) != 0;
}
static inline bool b3IsConvex( b3ShapeType type )
{
return type == b3_sphereShape || type == b3_capsuleShape || type == b3_hullShape;
}