-
Notifications
You must be signed in to change notification settings - Fork 70
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
Omit leading zeros when serializing float Attribute (and other Attributes consisting of floats) into TXML #768
Comments
Yes please :) |
Should be fairly trivial too, util func to remove all trailing Here https://github.com/realXtend/tundra/blob/tundra2/src/Core/TundraCore/Scene/IAttribute.cpp#L158-163 Then float2/3/4/Quat in the MGL classes https://github.com/realXtend/tundra/blob/tundra2/src/Core/TundraCore/Scene/IAttribute.cpp#L170 |
Btw is it ok to modify the MGL classes in Tundra? I mean there is some kind of manual merge/diffing step each time we want a new version of MGL in? Are these mods going to make that harder for @cadaver or whoever does that? |
Actually maybe its better to just do the to string logic in IAttribute (copying the format from matlib) and do all that stuff via |
Yeah it's probably better to do in IAttribute in order to keep the Tundra-specific mods of MGL at minimum. |
Yes, the more we mod MGL, the more troublesome it is to merge a new version. That is a manual process as Tundra's MGL is just files in the Tundra repo. Therefore this is indeed preferable to do in eg. IAttribute. |
However, I see no harm in pinging clb regarding this matter; maybe he'd prefer to have this in MGL. |
I'm sure the only thing where Jukka uses strings is debug prints if even there, but still reading that stuff is much nicer without extra zeros. @juj Any input? :) |
There were functions X::SerializeToString() added to MathGeoLib some time ago, see here juj/MathGeoLib@40d3981 Those functions have the two features:
Try that form, in particular the |
Ok, nice, I think we can pretty safely modify our MGL copy to use the 'g' modifier. |
Sure would be nice to sync whole MGL into Tundra again, seems out last update has been 1 year ago :( What was the main reason of keeping a copy in Tundra source tree instead of using it as a pre-built dependency? |
…lor, Quat and Transform Attributes into a string. Closes realXtend#768.
Currently f.ex. a default constructed Transform attribute looks like this in TXML:
By omitting unnecessary leading zeros in floats we would save a lot of bytes:
The text was updated successfully, but these errors were encountered: