Skip to content

Update zphysics #761

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

Merged
merged 4 commits into from
Jul 24, 2025
Merged

Update zphysics #761

merged 4 commits into from
Jul 24, 2025

Conversation

hazeycode
Copy link
Member

@hazeycode hazeycode commented Jul 20, 2025

Update zphysics (zig-gamedev/zphysics#12)

Checklist:

  • physics_test_wgpu builds and runs correctly
  • monolith builds and runs correctly
  • zphysics_instanced_cubes_d3d12 builds and runs correctly
  • Merge zphysics PR and update submodule ref and build.zig.zon dependency

@hazeycode hazeycode marked this pull request as draft July 20, 2025 13:23
@hazeycode hazeycode requested a review from Copilot July 20, 2025 13:23
Copilot

This comment was marked as outdated.

@hazeycode hazeycode requested a review from Copilot July 20, 2025 17:04
Copy link

@Copilot Copilot AI left a comment

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 updates the zphysics library dependency, requiring significant code changes to adapt to the new API. The update involves modernizing the interface patterns from manual vtable management to a more structured approach using embedded interface objects and proper method visibility.

  • Migrates from manual vtable and usingnamespace patterns to embedded interface objects with .init() calls
  • Updates calling conventions from .C to .c throughout the codebase
  • Replaces std.math.maxInt sentinel values with proper .invalid enum values for body IDs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
samples/physics_test_wgpu/src/physics_test_wgpu.zig Updates interface implementations and shape creation methods for zphysics API changes
samples/monolith/src/monolith.zig Comprehensive migration including interface updates, body ID handling, and debug renderer vtable changes
libs/zphysics Updates submodule reference to newer zphysics version
Comments suppressed due to low confidence (1)

samples/monolith/src/monolith.zig:252

  • [nitpick] Inconsistent field naming: The field is named vtable but other interface objects in the same file use descriptive names like broad_phase_layer_interface. Consider renaming to debug_renderer for consistency with the established pattern.
    vtable: *const VTable = zphy.DebugRenderer.initVTable(@This()),

@hazeycode hazeycode marked this pull request as ready for review July 24, 2025 22:54
@hazeycode hazeycode merged commit d59bb3a into main Jul 24, 2025
2 of 3 checks passed
@hazeycode hazeycode deleted the update-zphysics branch July 24, 2025 22:54
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.

1 participant