Skip to content

zphysics: support for shape serialization #731

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

Closed
wants to merge 1 commit into from

Conversation

kcbanner
Copy link
Contributor

@kcbanner kcbanner commented Nov 4, 2024

Here are some proposed changes to add support for binary serialization of shapes.

  • Add StreamOut and StreamIn interfaces
  • Add implementations of StreamOut / StreamIn that use AnyWriter / AnyReader
  • Add Shape::saveBinaryState and Shape::RestoreFromBinaryState

Opening this as a draft as I may be adding support for SaveMaterialState and SaveSubShapeState depending on if my use case requires it or not. I'm avoiding it for now as the map data structures may be tricky to easily map between C/C++.

- Add StreamOut and StreamIn interfaces
- Add implementations of StreamOut / StreamIn that use AnyWriter / AnyReader
- Add Shape::saveBinaryState and Shape::RestoreFromBinaryState
@kcbanner kcbanner force-pushed the zphysics_serialization branch from b49d86c to 3c81004 Compare November 4, 2024 00:34
@hazeycode
Copy link
Member

hazeycode commented Nov 4, 2024

Looks good to me.
Note I am about to move zphysics to its own repo and complete the lib migration.

@kcbanner
Copy link
Contributor Author

kcbanner commented Nov 4, 2024

Cool, I'll hold off until the migration and PR there, as I have some more changes for this patch - it turns out I do need to use SaveWithChildren / RestoreWithChildren in my use case so I need to add those as well.

@kcbanner
Copy link
Contributor Author

kcbanner commented Nov 5, 2024

Moved here zig-gamedev/zphysics#1

@kcbanner kcbanner closed this Nov 5, 2024
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