Skip to content

Conversation

@keyboardspecialist
Copy link
Contributor

Summary

With the SPZ 2.0.0 release they added new functionality for handling coordinate systems. Previously this was just hardcoded, and the spz-loader library enforced a rotation about the X axis.

This PR adds support for this allowing the user to specify exactly how they want the coordinates handled upon unpacking.

New

  • CoordinateSystem type - Strongly typed to reflect C++ enum
  • UnpackOptions type - Reflects new C++ struct for unpacking options. Only contains CoordinateSystem currently

Fixes

  • Explicitly exports HEAPU8 and HEAPF32 in the emscripten build. The release NPM has all types exported, but the build as it was on main did not export anything. This is restricted to types actually used.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @keyboardspecialist, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the spz-loader library to integrate with the SPZ 2.0.0 release, primarily by adding flexible coordinate system handling during data unpacking. It introduces new configuration options, updates the API surface across various integrations, and includes necessary build system adjustments for the WebAssembly module.

Highlights

  • SPZ 2.0.0 Coordinate System Support: The core spz-loader library now supports the new coordinate system handling introduced in SPZ 2.0.0, allowing users to specify how coordinates should be handled during unpacking. This removes a previously hardcoded X-axis rotation.
  • New Data Types for Unpacking Options: Introduced CoordinateSystem and UnpackOptions types to strongly type the new coordinate system handling, reflecting the C++ enum and struct from the SPZ 2.0.0 release.
  • API Updates Across Integrations: Modified loadSpz and related functions in both the Babylon.js and PlayCanvas integrations to accept the new UnpackOptions parameter, providing a consistent way to pass coordinate system preferences.
  • Emscripten Build Enhancements: Explicitly configured the Emscripten build to export HEAPU8 and HEAPF32 runtime methods, resolving an issue where these essential memory heaps were not properly exposed in previous builds.
  • SPZ Subproject Update: The underlying spz C++ library subproject has been updated to its latest version (commit cc5671d716740e02d57816d4a4a38d164926e695), aligning with the SPZ 2.0.0 release.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the SPZ loader to support version 2.0.0, introducing new functionality for handling coordinate systems. The changes are well-structured and propagate the new UnpackOptions effectively. The C++ bindings and TypeScript API are updated to expose this new functionality. The review includes suggestions for improving API consistency and code clarity.

@drumath2237 drumath2237 moved this from 🆕 New to 🏗 In progress in spz-loader Dev Project Jul 23, 2025
@drumath2237 drumath2237 self-requested a review July 23, 2025 18:34
@drumath2237
Copy link
Owner

@keyboardspecialist

Thank you so much for your contribution!
It looks like you’ve already done what I was planning for the next version of spz-loader (but haven’t had time to work on recently).
I’ll take a closer look soon!

@keyboardspecialist
Copy link
Contributor Author

@drumath2237

Thanks for the reply. Let me know if there's anything I can do to expedite getting this merged. I'd be glad to work with you on it.

Thanks

Copy link
Owner

@drumath2237 drumath2237 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this PR — it's heading in a great direction! 🙌

I left some comments mainly around two areas:

  • Suggestions on how to handle CoordinateSystem
  • Suggestions regarding UnpackOptions and where it might fit best

These are mostly to help avoid breaking changes and to streamline the usage a bit more.
Let me know what you think — happy to discuss further!

…in backwards compatibility

Added new CoordinateSystemEnum type to export to other modules using core. This allows other modules to easily specify coordinate systems without exposing any wasm module internals. Furthermore, it avoids any runtime shims or value creation.
@weegeekps
Copy link

Hi @drumath2237! Thank you for this great library and taking a look at my colleague's PR. Once your concerns are resolved, do you have an idea when you might be able to get this merged and released to npm?

We are looking to do a release this week and need to include an update to SPZ within it. We have a "plan b" but would like to stick with your npm package if possible.

@drumath2237
Copy link
Owner

@weegeekps

Hi! Thank you for reaching out. I'm really glad to hear that you're planning to use this package in your upcoming release.

I've reviewed the PR and am about to reply with one suggestion that might help improve the implementation. If the change can be smoothly incorporated, I believe I’ll be able to merge it and publish a new version to npm later this week.

That said, I completely understand if you need to move forward with your "plan B" depending on how things go. I'd be happy to continue the conversation either way.

Thanks again for your thoughtful message!

@drumath2237 drumath2237 self-requested a review July 30, 2025 01:13
Copy link
Owner

@drumath2237 drumath2237 left a comment

Choose a reason for hiding this comment

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

@keyboardspecialist
LGTM!
Thank you for your contribution! I'll merge this now.

@drumath2237 drumath2237 merged commit f4b3393 into drumath2237:main Jul 30, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in spz-loader Dev Project Jul 30, 2025
@drumath2237
Copy link
Owner

@weegeekps

I've just released v0.3.0! Thank you for your cooperation!

https://github.com/drumath2237/spz-loader/releases/tag/v0.3.0

@weegeekps
Copy link

@drumath2237 and thank you for this great library and being responsive to us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants